diff --git a/.github/workflows/build_publish.yml b/.github/workflows/build_publish.yml index 13187de..ea6b00c 100644 --- a/.github/workflows/build_publish.yml +++ b/.github/workflows/build_publish.yml @@ -16,12 +16,10 @@ jobs: os: [ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v2 - - name: Build wheels uses: pypa/cibuildwheel@v2.3.1 env: - CIBW_BUILD: "cp37-* cp38-* cp39-*" - + CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-*" - uses: actions/upload-artifact@v2 with: path: ./wheelhouse/*.whl diff --git a/acv_app/sdp_app.py b/acv_app/sdp_app.py index e185f80..0e29f50 100644 --- a/acv_app/sdp_app.py +++ b/acv_app/sdp_app.py @@ -46,17 +46,14 @@ def write_pg(x_train, x_test, y_train, y_test, acvtree): @st.cache(allow_output_mutation=True) def compute_sdp(nb, x_train, y_train, x_test, y_test, pi_level, t): sufficient_coal, sdp_coal, sdp_global = acvtree.sufficient_expl_rf(x_test[:nb], y_test[:nb], x_train, y_train, - stop=False, pi_level=pi_level, - t=t) - for i in range(len(sufficient_coal)): - sufficient_coal[i].pop(0) - sdp_coal[i].pop(0) + stop=False, pi_level=pi_level) + return sufficient_coal, sdp_coal, sdp_global @st.cache(allow_output_mutation=True) def compute_sdp_rule(obs, x_train_np, y_train_np, x_test_np, y_test_np, t, S): sdp, rules = acvtree.compute_sdp_rule(x_test_np[obs:obs+1], y_test_np[obs:obs+1], - x_train_np, y_train_np, S=[S], t=t) + x_train_np, y_train_np, S=[S]) rule = rules[0] columns = [x_train.columns[i] for i in range(x_train.shape[1])] rule_string = ['{} <= {} <= {}'.format(rule[i, 0] if rule[i, 0] > -1e+10 else -np.inf, columns[i], @@ -67,7 +64,7 @@ def compute_sdp_rule(obs, x_train_np, y_train_np, x_test_np, y_test_np, t, S): @st.cache(allow_output_mutation=True) def compute_sdp_maxrule(obs, x_train_np, y_train_np, x_test_np, y_test_np, t, S, pi): sdp, rules, sdp_all, rules_data, w = acvtree.compute_sdp_maxrules(x_test_np[obs:obs + 1], y_test_np[obs:obs + 1], - x_train_np, y_train_np, S=[S], t=t, pi_level=pi) + x_train_np, y_train_np, S=[S], pi_level=pi) acvtree.fit_global_rules(x_train_np, y_train_np, rules, [S]) @@ -180,7 +177,6 @@ def bar_legacy(shap_values, features=None, feature_names=None, max_display=None, sufficient_coal, sdp_coal, sdp_global = compute_sdp(nb, x_train.values.astype(np.double), y_train.astype(np.double), x_test.values.astype(np.double), y_test.astype(np.double), pi_level=pi_level, t=t) - sufficient_coal_names = transform_scoal_to_col(sufficient_coal, x_train.columns) # explantions_load_state.text("SDP explanation Done!") @@ -197,7 +193,6 @@ def bar_legacy(shap_values, features=None, feature_names=None, max_display=None, 'SDP': sdp_coal[idx]} sufficient_coal_df = pd.DataFrame(sufficient_coal_df) - # print(sufficient_coal_df.head()) st.dataframe(sufficient_coal_df, 6000, 6000) with col2: diff --git a/acv_explainers/acv_agnosticX.py b/acv_explainers/acv_agnosticX.py index 1a02059..ccadcad 100644 --- a/acv_explainers/acv_agnosticX.py +++ b/acv_explainers/acv_agnosticX.py @@ -11,6 +11,9 @@ from sklearn.exceptions import NotFittedError import random + +# TODO: add model in exp and define by thr CRP and the regression pb + class ACXplainer: def __init__( self, @@ -100,35 +103,35 @@ def __init__( self.rules_s_star_ori = None if self.classifier: - self.model = RangerForestClassifier(self.n_estimators, - self.verbose, - self.mtry, - self.importance, - self.min_node_size, - self.max_depth, - self.replace, - self.sample_fraction, - self.keep_inbag, - self.inbag, - self.split_rule, - self.num_random_splits, + self.model = RangerForestClassifier(n_estimators=self.n_estimators, + verbose=self.verbose, + mtry=self.mtry, + importance=self.importance, + min_node_size=self.min_node_size, + max_depth=self.max_depth, + replace=self.replace, + sample_fraction=self.sample_fraction, + keep_inbag=self.keep_inbag, + inbag=self.inbag, + split_rule=self.split_rule, + num_random_splits=self.num_random_splits, seed=self.seed, enable_tree_details=True) else: if self.split_rule == 'gini': self.split_rule = 'variance' - self.model = RangerForestRegressor(self.n_estimators, - self.verbose, - self.mtry, - self.importance, - self.min_node_size, - self.max_depth, - self.replace, - self.sample_fraction, - self.keep_inbag, - self.inbag, - self.split_rule, - self.num_random_splits, + self.model = RangerForestRegressor(n_estimators=self.n_estimators, + verbose=self.verbose, + mtry=self.mtry, + importance=self.importance, + min_node_size=self.min_node_size, + max_depth=self.max_depth, + replace=self.replace, + sample_fraction=self.sample_fraction, + keep_inbag=self.keep_inbag, + inbag=self.inbag, + split_rule=self.split_rule, + num_random_splits=self.num_random_splits, seed=self.seed, enable_tree_details=True, quantiles=True) @@ -227,7 +230,7 @@ def check_is_explainer(self): self.ACXplainer = BaseAgnosTree(self.model, self.d) self.check_is_explain = True - def compute_sdp_rf(self, X, y, data, y_data, S, min_node_size=5, t=20): + def compute_sdp_rf(self, X, y, data, y_data, S, min_node_size=5, t=None): """ Estimate the Same Decision Probability (SDP) of a set of samples X given subset S using the consistent estimator (Projected Forest + Quantile Regression), see Paper [ref] @@ -262,6 +265,10 @@ def compute_sdp_rf(self, X, y, data, y_data, S, min_node_size=5, t=20): raise ValueError('{} for X (samples) and S (coalition)'.format(exp)) self.check_is_explainer() + if not self.classifier and t is None: + t = self.model.predict_quantiles(X, quantiles=[0.05, 0.95]) + elif self.classifier: + t = np.zeros(shape=(X.shape[0], 2)) sdp = cyext_acv.compute_sdp_rf(X, y, data, y_data, S, self.ACXplainer.features, self.ACXplainer.thresholds, self.ACXplainer.children_left, @@ -269,7 +276,7 @@ def compute_sdp_rf(self, X, y, data, y_data, S, min_node_size=5, t=20): self.classifier, t) return sdp - def compute_sdp_rule(self, X, y, data, y_data, S, min_node_size=5, t=20): + def compute_sdp_rule(self, X, y, data, y_data, S, min_node_size=5, t=None): """ Estimate the local rule-based explanations of a set of samples X given Sufficient Explanations S using the consistent estimator (Projected Forest + Quantile Regression), see Paper [ref]. For each observation x, all @@ -306,15 +313,21 @@ def compute_sdp_rule(self, X, y, data, y_data, S, min_node_size=5, t=20): self.check_is_explainer() + if not self.classifier and t is None: + t = self.model.predict_quantiles(X, quantiles=[0.05, 0.95]) + elif self.classifier: + t = np.zeros(shape=(X.shape[0], 2)) sdp, rules = cyext_acv.compute_sdp_rule(X, y, data, y_data, S, self.ACXplainer.features, self.ACXplainer.thresholds, self.ACXplainer.children_left, - self.ACXplainer.children_right, self.ACXplainer.max_depth, + self.ACXplainer.children_right, + self.ACXplainer.max_depth, min_node_size, self.classifier, t) return sdp, rules - def compute_sdp_maxrules(self, X, y, data, y_data, S, min_node_size=5, t=20, pi_level=0.95, - verbose=False, algo2=False, rdm_size=20): + def compute_sdp_maxrules(self, X, y, data, y_data, S, min_node_size=5, t=None, pi_level=0.95, + verbose=False, algo2=False, p_best=0.85, n_try=50, + batch=50, max_iter=200, temp=1, max_iter_convergence=10): """ Estimate the maximal rule-based explanations of a set of samples X given Sufficient Explanations S using the consistent estimator (Projected Forest + Quantile Regression), see Paper [ref]. For each instance x, all @@ -339,6 +352,14 @@ def compute_sdp_maxrules(self, X, y, data, y_data, S, min_node_size=5, t=20, pi_ pi_level (double): The minimal level of SDP for the Sufficient Explanations + p_best (double): The probability of chosing the best (maximal) rule instead of rdm among the compatible R + + n_try (int): number of try to find a good candidate (rule) + + max_iter (int): number of steps for the simulated annealing + + max_iter_convergence (int): stop if not improving after steps=max_iter_convergence + Returns: sdp (numpy.ndarray): A 1-D matrix (# samples), sdp[i] contains the Same Decision Probability (SDP) of the Sufficient Explanation of observation i @@ -355,6 +376,11 @@ def compute_sdp_maxrules(self, X, y, data, y_data, S, min_node_size=5, t=20, pi_ self.check_is_explainer() + if not self.classifier and t is None: + t = self.model.predict_quantiles(X, quantiles=[0.05, 0.95]) + elif self.classifier: + t = np.zeros(shape=(X.shape[0], 2)) + if not verbose: sdp, rules, sdp_all, rules_data, w = cyext_acv.compute_sdp_maxrule(X, y, data, y_data, S, self.ACXplainer.features, @@ -375,7 +401,11 @@ def compute_sdp_maxrules(self, X, y, data, y_data, S, min_node_size=5, t=20, pi_ t, pi_level) if not algo2: - extend_partition(rules, rules_data, sdp_all, pi=pi_level, S=S) + # extend_partition(rules, rules_data, sdp_all, pi=pi_level, S=S) + rules, rules_eval = rules_by_annealing(volume_rectangles, rules, rules_data, sdp_all, data, + pi_level=pi_level, p_best=p_best, n_try=n_try, + batch=batch, max_iter=max_iter, temp=temp, + max_iter_convergence=max_iter_convergence) else: # rules_rdm = [rules.copy() for z in range(rdm_size)] # for i in tqdm(range(rdm_size)): @@ -384,18 +414,17 @@ def compute_sdp_maxrules(self, X, y, data, y_data, S, min_node_size=5, t=20, pi_ # random.shuffle(rules_comp) # r, _ = return_best(rules_rdm[i][a], rules_comp, S[a]) # rules_rdm[i][a][S[a]] = r - for a in tqdm(range(rules.shape[0])): - rules_sets = [rules_data[a, j] for j in range(rules_data.shape[1]) if sdp_all[a, j] >= sdp[a]] - rules[a][S[a]] = overapprox_rule(rules[a], rules_sets, S[a]) + # for a in tqdm(range(rules.shape[0])): + # rules_sets = [rules_data[a, j] for j in range(rules_data.shape[1]) if sdp_all[a, j] >= sdp[a]] + # rules[a][S[a]] = overapprox_rule(rules[a], rules_sets, S[a]) # return sdp, rules_rdm, sdp_all, rules_data, w - + extend_partition(rules, rules_data, sdp_all, pi=pi_level, S=S) return sdp, rules, sdp_all, rules_data, w - def importance_sdp_rf(self, X, y, data, y_data, min_node_size=5, t=20, - C=[[]], pi_level=0.9, minimal=1, stop=True): + def compute_ddp_rf(self, X, y, data, y_data, S, min_node_size=5, t=None): """ - Estimate the Minimal Sufficient Explanations and the Global sdp importance of a set of samples X using the - consistent estimator (Projected Forest + Quantile Regression), see Paper [ref]. + Estimate the Same Decision Probability (SDP) of a set of samples X given subset S using the consistent estimator + (Projected Forest + Quantile Regression), see Paper [ref] Args: X (numpy.ndarray): A matrix of samples (# samples X # features) on which to compute the SDP @@ -407,66 +436,41 @@ def importance_sdp_rf(self, X, y, data, y_data, min_node_size=5, t=20, y_data (numpy.ndarray): The targets of the background dataset - min_node_size (int): The minimal node size - - t (float): The level of variations around the prediction that defines the SDP in regression (only for regression) - - C (list[list[int]]): A list that contains a list of the indices of column for each grouped variables - - pi_level (float): The minimal value of the Same Decision Probability (SDP) of the Sufficient Explanations. - It should be in (0, 1). + S (list[list[int]]): A list that contains the column indices of the variable on which we condition to compute the SDP + for each observation - minimal (int): It will search the Sufficient Explanations from subsets of size "minimal" instead of 1 by default + min_node_size (int): The minimal node size of the Projected Random Forest - stop (bool): If stop=True, it will stop searching for the Sufficient Explanations if it does not find - any Sufficient Explanations smaller than (# features / 2), otherwise it will continues until - end. + t (float): The level of variations around the prediction that defines the SDP in regression (only for regression) Returns: - global_sdp_importance (numpy.ndarray): A 1-D matrix (# features) that is the global explanatory importance - based on samples X. For a given i, sdp_importance[i] corresponds to the - frequency of apparition of feature i in the Minimal Sufficient Explanations - of the set of samples X - - sdp_index (numpy.ndarray): A matrix (# samples X # features) that contains the indices of the variables in the - the Minimal Sufficient Explanations for each sample. For a given i, the positive - values of sdp_index[i] corresponds to the Minimal Sufficient Explanations of - observation i. - - size (numpy.ndarray): A 1-D matrix (# samples) that contains the size of the Minimal Sufficient Explanation - for each sample. - - sdp (numpy.ndarray): A 1-D matrix (# samples) that contains the Same Decision Probability (SDP) - of the Sufficient Explanation for each sample. + sdp (numpy.ndarray): A 1-D matrix (# samples), sdp[i] contains the Same Decision Probability (SDP) + of the Minimal Sufficient Explanation of observation i """ X, y = check_X_y(X, y, dtype=np.double) data, y_data = check_X_y(data, y_data, dtype=np.double) y, y_data = as_float_array(y).astype(np.double), as_float_array(y_data).astype(np.double) - self.check_is_explainer() - - if X.shape[1] > 10: - feature_importance = -np.array(self.model.feature_importances_) - search_space = list(np.argsort(feature_importance)) - # flat_list = [item for t in self.ACXplainer.node_idx_trees for sublist in t for item in sublist] - # node_idx = pd.Series(flat_list) - # search_space = [] - # for v in (node_idx.value_counts().keys()): - # search_space += [v] - else: - search_space = [i for i in range(X.shape[1])] + try: + check_consistent_length(X, S) + except ValueError as exp: + raise ValueError('{} for X (samples) and S (coalition)'.format(exp)) - return cyext_acv.global_sdp_rf(X, y, data, y_data, self.ACXplainer.features, self.ACXplainer.thresholds, + self.check_is_explainer() + if not self.classifier and t is None: + t = self.model.predict_quantiles(X, quantiles=[0.05, 0.95]) + elif self.classifier: + t = np.zeros(shape=(X.shape[0], 2)) + ddp = cyext_acv.compute_ddp_rf(X, y, data, y_data, S, self.ACXplainer.features, self.ACXplainer.thresholds, self.ACXplainer.children_left, self.ACXplainer.children_right, self.ACXplainer.max_depth, min_node_size, - self.classifier, t, C, - pi_level, minimal, stop, search_space[:10]) - - def sufficient_expl_rf(self, X, y, data, y_data, min_node_size=5, t=20, - C=[[]], pi_level=0.9, minimal=1, stop=True): + self.classifier, t) + return ddp + def compute_ddp_rule(self, X, y, data, y_data, S, min_node_size=5, t=None): """ - Estimate all the Sufficient Explanations and the Global sdp importance of a set of samples X using the - consistent estimator (Projected Forest + Quantile Regression), see Paper [ref]. + Estimate the local rule-based explanations of a set of samples X given Sufficient Explanations S using + the consistent estimator (Projected Forest + Quantile Regression), see Paper [ref]. For each observation x, all + observations that falls in the rule of x has the same SDP as x. Args: X (numpy.ndarray): A matrix of samples (# samples X # features) on which to compute the SDP @@ -478,57 +482,107 @@ def sufficient_expl_rf(self, X, y, data, y_data, min_node_size=5, t=20, y_data (numpy.ndarray): The targets of the background dataset - min_node_size (int): The minimal node size + S (list[list[int]]): A list that contains the indices of the columns of the Sufficient Explanation for each observation - t (float): The level of variations around the prediction that defined the SDP for regression (only for regression) + min_node_size (int): The minimal node size of the Projected Random forest - C (list[list[int]]): A list that contains a list of the indices of the column for each grouped variables + t (float): The level of variations around the prediction that defines the SDP in regression (only for regression) - pi_level (float): The minimal value of the Same Decision Probability (SDP) of the Sufficient Explanations. - It should be in (0, 1). + Returns: + sdp (numpy.ndarray): A 1-D matrix (# samples), sdp[i] contains the Same Decision Probability (SDP) + of the Sufficient Explanation of observation i + rules (numpy.ndarray): A matrix (# samples x # features x 2), rules[i] that contains the local rule of observation i + """ + X, y = check_X_y(X, y, dtype=[np.double, np.double]) + data, y_data = check_X_y(data, y_data, dtype=[np.double, np.double]) + y, y_data = as_float_array(y).astype(np.double), as_float_array(y_data).astype(np.double) + try: + check_consistent_length(X, S) + except ValueError as exp: + raise ValueError('{} for X (samples) and S (coalition)'.format(exp)) - minimal (int): It will search the Sufficient Explanations from subsets of size "minimal" instead of 1 by default + self.check_is_explainer() + if not self.classifier and t is None: + t = self.model.predict_quantiles(X, quantiles=[0.05, 0.95]) + elif self.classifier: + t = np.zeros(shape=(X.shape[0], 2)) + ddp, rules = cyext_acv.compute_ddp_rule(X, y, data, y_data, S, self.ACXplainer.features, + self.ACXplainer.thresholds, + self.ACXplainer.children_left, + self.ACXplainer.children_right, self.ACXplainer.max_depth, + min_node_size, self.classifier, t) + return ddp, rules - stop (bool): If stop=True, it will stop searching for the Sufficient Explanations if it does not find - any Sufficient Explanations smaller than (# features / 2), otherwise it will continues until - end. + def compute_ddp_weights(self, X, y, data, y_data, S, min_node_size=5, t=None, pi_level=0.95, + verbose=False, algo2=False, rdm_size=20): + """ + Estimate the maximal rule-based explanations of a set of samples X given Sufficient Explanations S using the consistent estimator + (Projected Forest + Quantile Regression), see Paper [ref]. For each instance x, all + observations that falls in the rule of x has its SDP given S above \pi as x. - Returns: - sufficient_coal (list[list[list[int]]]): a list that contains the column indices of the Sufficient Explanations - of each sample - sdp_coal (list[list[list[int]]]): a list that contains the SDP of the Sufficient Explanations of each sample + Args: + X (numpy.ndarray): A matrix of samples (# samples X # features) on which to compute the SDP - sdp_global (numpy.ndarray): 1-D array (# features), sdp_global[i] corresponds to the frequency of apparition - of variable i in the **all** the sufficient explanations over the samples X. - """ + y (numpy.ndarray): 1-D array (# samples) the targets of X + + data (numpy.ndarray): The background dataset that is used for the estimation of the SDP. It should be the + training samples. + + y_data (numpy.ndarray): The targets of the background dataset + + S (list[list[int]]): A list that contains the indices of the columns of the variable of the Sufficient + Explanations for each observation + min_node_size (int): The minimal node size of the Projected Forest + + t (double): The level of variations around the prediction that defines the SDP in regression (only for regression) + + pi_level (double): The minimal level of SDP for the Sufficient Explanations + + Returns: + sdp (numpy.ndarray): A 1-D matrix (# samples), sdp[i] contains the Same Decision Probability (SDP) + of the Sufficient Explanation of observation i + rules (numpy.ndarray): A matrix (# samples x # features x 2), rules[i] that contains the maximal local rule + of observation i + """ X, y = check_X_y(X, y, dtype=np.double) data, y_data = check_X_y(data, y_data, dtype=np.double) y, y_data = as_float_array(y).astype(np.double), as_float_array(y_data).astype(np.double) - self.check_is_explainer() - if X.shape[1] > 10: + try: + check_consistent_length(X, S) + except ValueError as exp: + raise ValueError('{} for X (samples) and S (coalition)'.format(exp)) - feature_importance = -np.array(self.model.feature_importances_) - search_space = list(np.argsort(feature_importance)) - # flat_list = [item for t in self.ACXplainer.node_idx_trees for sublist in t for item in sublist] - # node_idx = pd.Series(flat_list) - # search_space = [] - # for v in (node_idx.value_counts().keys()): - # search_space += [v] + self.check_is_explainer() + if not self.classifier and t is None: + t = self.model.predict_quantiles(X, quantiles=[0.05, 0.95]) + elif self.classifier: + t = np.zeros(shape=(X.shape[0], 2)) + if not verbose: + ddp, w = cyext_acv.compute_ddp_weights(X, y, data, y_data, S, + self.ACXplainer.features, + self.ACXplainer.thresholds, + self.ACXplainer.children_left, + self.ACXplainer.children_right, + self.ACXplainer.max_depth, + min_node_size, self.classifier, t, + pi_level) else: - search_space = [i for i in range(X.shape[1])] - # TODO: Remove the [-1] in the Sufficent Coal - return cyext_acv.sufficient_expl_rf(X, y, data, y_data, self.ACXplainer.features, self.ACXplainer.thresholds, - self.ACXplainer.children_left, - self.ACXplainer.children_right, self.ACXplainer.max_depth, min_node_size, - self.classifier, t, C, - pi_level, minimal, stop, search_space[:10]) - - def compute_exp_rf(self, X, y, data, y_data, S, min_node_size=5, t=20): + ddp, w = cyext_acv.compute_ddp_weights_verbose(X, y, data, y_data, S, + self.ACXplainer.features, + self.ACXplainer.thresholds, + self.ACXplainer.children_left, + self.ACXplainer.children_right, + self.ACXplainer.max_depth, + min_node_size, self.classifier, + t, pi_level) + + return ddp, w + + def compute_cdp_cond_weights(self, X, y, down, up, data, y_data, S, cond, min_node_size=5, t=None, pi_level=0.95, + verbose=False, algo2=False, rdm_size=20): """ - Estimate the Conditional Expectation (exp) of a set of samples X given subset S using the consistent estimator - (Projected Forest), see Paper [ref] - + Compute P(Y \neq y | X_{\bar{S}} in rule_{\bar{S}}, X_S=x_S) Args: X (numpy.ndarray): A matrix of samples (# samples X # features) on which to compute the SDP @@ -539,16 +593,20 @@ def compute_exp_rf(self, X, y, data, y_data, S, min_node_size=5, t=20): y_data (numpy.ndarray): The targets of the background dataset - S (list[list[int]]): A list that contains the indices of the variable on which we condition to compute the SDP - for each observation + S (list[list[int]]): A list that contains the indices of the columns of the variable of the Sufficient + Explanations for each observation - min_node_size (int): The minimal node size + min_node_size (int): The minimal node size of the Projected Forest - t (float): not used here + t (double): The level of variations around the prediction that defines the SDP in regression (only for regression) + + pi_level (double): The minimal level of SDP for the Sufficient Explanations Returns: - exp (numpy.ndarray): A 1-D matrix (# samples), exp[i] contains the Conditional Expectation of observation i - given S + sdp (numpy.ndarray): A 1-D matrix (# samples), sdp[i] contains the Same Decision Probability (SDP) + of the Sufficient Explanation of observation i + rules (numpy.ndarray): A matrix (# samples x # features x 2), rules[i] that contains the maximal local rule + of observation i """ X, y = check_X_y(X, y, dtype=np.double) data, y_data = check_X_y(data, y_data, dtype=np.double) @@ -557,19 +615,28 @@ def compute_exp_rf(self, X, y, data, y_data, S, min_node_size=5, t=20): check_consistent_length(X, S) except ValueError as exp: raise ValueError('{} for X (samples) and S (coalition)'.format(exp)) - + if not self.classifier and t is None: + t = self.model.predict_quantiles(X, quantiles=[0.05, 0.95]) + elif self.classifier: + t = np.zeros(shape=(X.shape[0], 2)) self.check_is_explainer() - exp = cyext_acv.compute_exp_rf(X, y, data, y_data, S, self.ACXplainer.features, self.ACXplainer.thresholds, - self.ACXplainer.children_left, - self.ACXplainer.children_right, self.ACXplainer.max_depth, min_node_size, - self.classifier, t) - return exp + ddp, w = cyext_acv.compute_cdp_cond_weights(X, y, down, up, data, y_data, S, + self.ACXplainer.features, + self.ACXplainer.thresholds, + self.ACXplainer.children_left, + self.ACXplainer.children_right, + cond, + self.ACXplainer.max_depth, + min_node_size, self.classifier, t, + pi_level) + + return ddp, w - def compute_cdf_rf(self, X, y, data, y_data, S, min_node_size=5, t=20): + def compute_cdp_rf(self, X, y, down, up, data, y_data, S, min_node_size=5, t=None): """ - Estimate the Projected Cumulative Distribution Function (P-CDF) of a set of samples X given subset S using the - consistent estimator (Projected Forest + Quantile Regression), see Paper [ref] + Estimate the Same Decision Probability (SDP) of a set of samples X given subset S using the consistent estimator + (Projected Forest + Quantile Regression), see Paper [ref] Args: X (numpy.ndarray): A matrix of samples (# samples X # features) on which to compute the SDP @@ -581,16 +648,16 @@ def compute_cdf_rf(self, X, y, data, y_data, S, min_node_size=5, t=20): y_data (numpy.ndarray): The targets of the background dataset - S (list[list[int]]): A list that contains the indices of the variable on which we condition to compute the P-CDF + S (list[list[int]]): A list that contains the column indices of the variable on which we condition to compute the SDP for each observation - min_node_size (int): The minimal node size of the Projected Forest + min_node_size (int): The minimal node size of the Projected Random Forest - t (float): not used here + t (float): The level of variations around the prediction that defines the SDP in regression (only for regression) Returns: - exp (numpy.ndarray): A 1-D matrix (# samples), exp[i] contains the Conditional Expectation of observation i - given S + sdp (numpy.ndarray): A 1-D matrix (# samples), sdp[i] contains the Same Decision Probability (SDP) + of the Minimal Sufficient Explanation of observation i """ X, y = check_X_y(X, y, dtype=np.double) data, y_data = check_X_y(data, y_data, dtype=np.double) @@ -601,74 +668,716 @@ def compute_cdf_rf(self, X, y, data, y_data, S, min_node_size=5, t=20): raise ValueError('{} for X (samples) and S (coalition)'.format(exp)) self.check_is_explainer() - - sdp = cyext_acv.compute_cdf_rf(X, y, data, y_data, S, self.ACXplainer.features, self.ACXplainer.thresholds, + if not self.classifier and t is None: + t = self.model.predict_quantiles(X, quantiles=[0.05, 0.95]) + elif self.classifier: + t = np.zeros(shape=(X.shape[0], 2)) + ddp = cyext_acv.compute_cdp_rf(X, y, down, up, data, y_data, S, self.ACXplainer.features, + self.ACXplainer.thresholds, self.ACXplainer.children_left, self.ACXplainer.children_right, self.ACXplainer.max_depth, min_node_size, self.classifier, t) - return sdp + return ddp - @staticmethod - def compute_local_sdp(d, sufficient_coal): + def compute_cdp_rule(self, X, y, down, up, data, y_data, S, min_node_size=5, t=None): """ - Estimate the local explanatory importance of each variable given the set of Sufficient Explanations of each - sample + Estimate the local rule-based explanations of a set of samples X given Sufficient Explanations S using + the consistent estimator (Projected Forest + Quantile Regression), see Paper [ref]. For each observation x, all + observations that falls in the rule of x has the same SDP as x. + Args: - d (int): # features - sufficient_coal (list[list[list[int]]]): a list that contains the column indices of the Sufficient Explanations - of each sample + X (numpy.ndarray): A matrix of samples (# samples X # features) on which to compute the SDP - Returns: - local_exp_imp (numpy.ndarray): 1-D array (# features) the local explanatory importance of each variable for each - sample. - """ - flat = [item for sublist in sufficient_coal for item in sublist] - flat = pd.Series(flat) - flat = dict(flat.value_counts() / len(sufficient_coal)) - local_sdp = np.zeros(d) - for key in flat.keys(): - local_sdp[key] = flat[key] - return local_sdp + y (numpy.ndarray): 1-D array (# samples) the targets of X - @staticmethod - def compute_msdp_clf(X, S, data, model=None): - """ - Compute marginal SDP of a set of sample X given S for classifier - """ - return msdp(X, S, model, data) + data (numpy.ndarray): The background dataset that is used for the estimation of the SDP. It should be the + training samples. - @staticmethod - def importance_msdp_clf_search(X, data, model=None, C=[[]], minimal=1, pi_level=0.9, r_search_space=None, - stop=True): - """ - Compute the marginal minimal sufficient explanations of any classifier - """ + y_data (numpy.ndarray): The targets of the background dataset - return importance_msdp_clf_search(X=X, rg_data=data, model=model, C=C, minimal=minimal, - pi_level=pi_level, r_search_space=r_search_space, stop=stop) + S (list[list[int]]): A list that contains the indices of the columns of the Sufficient Explanation for each observation - @staticmethod - def compute_msdp_reg(X, S, data, model=None, threshold=0.2): - """ - Compute marginal SDP of a set of sample X given S for regressor - """ - return msdp_reg(X, S, model, data, threshold) + min_node_size (int): The minimal node size of the Projected Random forest - @staticmethod - def importance_msdp_reg_search(X, data, model=None, C=[[]], minimal=1, pi_level=0.9, threshold=0.2, - r_search_space=None, stop=True): - """ - Compute the marginal minimal sufficient explanations of any regressor model - """ - return importance_msdp_reg_search(X, rg_data=data, model=model, C=C, minimal=minimal, pi_level=pi_level, - threshold=threshold, r_search_space=r_search_space, stop=stop) + t (float): The level of variations around the prediction that defines the SDP in regression (only for regression) - # def compute_quantile_rf(self, X, y, data, y_data, S, min_node_size=5, classifier=1, t=20, quantile=95): - # X, y = check_X_y(X, y, dtype=np.double) - # data, y_data = check_X_y(data, y_data, dtype=np.double) - # y, y_data = as_float_array(y).astype(np.double), as_float_array(y_data).astype(np.double) - # try: - # check_consistent_length(X, S) + Returns: + sdp (numpy.ndarray): A 1-D matrix (# samples), sdp[i] contains the Same Decision Probability (SDP) + of the Sufficient Explanation of observation i + rules (numpy.ndarray): A matrix (# samples x # features x 2), rules[i] that contains the local rule of observation i + """ + X, y = check_X_y(X, y, dtype=[np.double, np.double]) + data, y_data = check_X_y(data, y_data, dtype=[np.double, np.double]) + y, y_data = as_float_array(y).astype(np.double), as_float_array(y_data).astype(np.double) + try: + check_consistent_length(X, S) + except ValueError as exp: + raise ValueError('{} for X (samples) and S (coalition)'.format(exp)) + + self.check_is_explainer() + if not self.classifier and t is None: + t = self.model.predict_quantiles(X, quantiles=[0.05, 0.95]) + elif self.classifier: + t = np.zeros(shape=(X.shape[0], 2)) + ddp, rules = cyext_acv.compute_cdp_rule(X, y, down, up, data, y_data, S, self.ACXplainer.features, + self.ACXplainer.thresholds, + self.ACXplainer.children_left, + self.ACXplainer.children_right, self.ACXplainer.max_depth, + min_node_size, self.classifier, t) + return ddp, rules + + def compute_cdp_weights(self, X, y, down, up, data, y_data, S, min_node_size=5, t=None, pi_level=0.95, + verbose=False, algo2=False, rdm_size=20): + """ + Estimate the maximal rule-based explanations of a set of samples X given Sufficient Explanations S using the consistent estimator + (Projected Forest + Quantile Regression), see Paper [ref]. For each instance x, all + observations that falls in the rule of x has its SDP given S above \pi as x. + + Args: + X (numpy.ndarray): A matrix of samples (# samples X # features) on which to compute the SDP + + y (numpy.ndarray): 1-D array (# samples) the targets of X + + data (numpy.ndarray): The background dataset that is used for the estimation of the SDP. It should be the + training samples. + + y_data (numpy.ndarray): The targets of the background dataset + + S (list[list[int]]): A list that contains the indices of the columns of the variable of the Sufficient + Explanations for each observation + + min_node_size (int): The minimal node size of the Projected Forest + + t (double): The level of variations around the prediction that defines the SDP in regression (only for regression) + + pi_level (double): The minimal level of SDP for the Sufficient Explanations + + Returns: + sdp (numpy.ndarray): A 1-D matrix (# samples), sdp[i] contains the Same Decision Probability (SDP) + of the Sufficient Explanation of observation i + rules (numpy.ndarray): A matrix (# samples x # features x 2), rules[i] that contains the maximal local rule + of observation i + """ + X, y = check_X_y(X, y, dtype=np.double) + data, y_data = check_X_y(data, y_data, dtype=np.double) + y, y_data = as_float_array(y).astype(np.double), as_float_array(y_data).astype(np.double) + try: + check_consistent_length(X, S) + except ValueError as exp: + raise ValueError('{} for X (samples) and S (coalition)'.format(exp)) + + self.check_is_explainer() + if not self.classifier and t is None: + t = self.model.predict_quantiles(X, quantiles=[0.05, 0.95]) + elif self.classifier: + t = np.zeros(shape=(X.shape[0], 2)) + if not verbose: + ddp, w = cyext_acv.compute_cdp_weights(X, y, down, up, data, y_data, S, + self.ACXplainer.features, + self.ACXplainer.thresholds, + self.ACXplainer.children_left, + self.ACXplainer.children_right, + self.ACXplainer.max_depth, + min_node_size, self.classifier, t, + pi_level) + else: + ddp, w = cyext_acv.compute_cdp_weights_verbose(X, y, down, up, data, y_data, S, + self.ACXplainer.features, + self.ACXplainer.thresholds, + self.ACXplainer.children_left, + self.ACXplainer.children_right, + self.ACXplainer.max_depth, + min_node_size, self.classifier, t, + pi_level) + + return ddp, w + + def compute_ddp_cond_weights(self, X, y, data, y_data, S, cond, min_node_size=5, t=None, pi_level=0.95, + verbose=False, algo2=False, rdm_size=20): + """ + Compute P(Y \neq y | X_{\bar{S}} in rule_{\bar{S}}, X_S=x_S) + Args: + X (numpy.ndarray): A matrix of samples (# samples X # features) on which to compute the SDP + + y (numpy.ndarray): 1-D array (# samples) the targets of X + + data (numpy.ndarray): The background dataset that is used for the estimation of the SDP. It should be the + training samples. + + y_data (numpy.ndarray): The targets of the background dataset + + S (list[list[int]]): A list that contains the indices of the columns of the variable of the Sufficient + Explanations for each observation + + min_node_size (int): The minimal node size of the Projected Forest + + t (double): The level of variations around the prediction that defines the SDP in regression (only for regression) + + pi_level (double): The minimal level of SDP for the Sufficient Explanations + + Returns: + sdp (numpy.ndarray): A 1-D matrix (# samples), sdp[i] contains the Same Decision Probability (SDP) + of the Sufficient Explanation of observation i + rules (numpy.ndarray): A matrix (# samples x # features x 2), rules[i] that contains the maximal local rule + of observation i + """ + X, y = check_X_y(X, y, dtype=np.double) + data, y_data = check_X_y(data, y_data, dtype=np.double) + y, y_data = as_float_array(y).astype(np.double), as_float_array(y_data).astype(np.double) + try: + check_consistent_length(X, S) + except ValueError as exp: + raise ValueError('{} for X (samples) and S (coalition)'.format(exp)) + + self.check_is_explainer() + if not self.classifier and t is None: + t = self.model.predict_quantiles(X, quantiles=[0.05, 0.95]) + elif self.classifier: + t = np.zeros(shape=(X.shape[0], 2)) + ddp, w = cyext_acv.compute_ddp_cond_weights(X, y, data, y_data, S, + self.ACXplainer.features, + self.ACXplainer.thresholds, + self.ACXplainer.children_left, + self.ACXplainer.children_right, + cond, + self.ACXplainer.max_depth, + min_node_size, self.classifier, t, + pi_level) + + return ddp, w + + def importance_sdp_rf(self, X, y, data, y_data, min_node_size=5, t=None, + C=[[]], pi_level=0.9, minimal=1, stop=True): + """ + Estimate the Minimal Sufficient Explanations and the Global sdp importance of a set of samples X using the + consistent estimator (Projected Forest + Quantile Regression), see Paper [ref]. + + Args: + X (numpy.ndarray): A matrix of samples (# samples X # features) on which to compute the SDP + + y (numpy.ndarray): 1-D array (# samples) the targets of X + + data (numpy.ndarray): The background dataset that is used for the estimation of the SDP. It should be the + training samples. + + y_data (numpy.ndarray): The targets of the background dataset + + min_node_size (int): The minimal node size + + t (float): The level of variations around the prediction that defines the SDP in regression (only for regression) + + C (list[list[int]]): A list that contains a list of the indices of column for each grouped variables + + pi_level (float): The minimal value of the Same Decision Probability (SDP) of the Sufficient Explanations. + It should be in (0, 1). + + minimal (int): It will search the Sufficient Explanations from subsets of size "minimal" instead of 1 by default + + stop (bool): If stop=True, it will stop searching for the Sufficient Explanations if it does not find + any Sufficient Explanations smaller than (# features / 2), otherwise it will continues until + end. + + Returns: + global_sdp_importance (numpy.ndarray): A 1-D matrix (# features) that is the global explanatory importance + based on samples X. For a given i, sdp_importance[i] corresponds to the + frequency of apparition of feature i in the Minimal Sufficient Explanations + of the set of samples X + + sdp_index (numpy.ndarray): A matrix (# samples X # features) that contains the indices of the variables in the + the Minimal Sufficient Explanations for each sample. For a given i, the positive + values of sdp_index[i] corresponds to the Minimal Sufficient Explanations of + observation i. + + size (numpy.ndarray): A 1-D matrix (# samples) that contains the size of the Minimal Sufficient Explanation + for each sample. + + sdp (numpy.ndarray): A 1-D matrix (# samples) that contains the Same Decision Probability (SDP) + of the Sufficient Explanation for each sample. + """ + X, y = check_X_y(X, y, dtype=np.double) + data, y_data = check_X_y(data, y_data, dtype=np.double) + y, y_data = as_float_array(y).astype(np.double), as_float_array(y_data).astype(np.double) + self.check_is_explainer() + + # TODO: Deal with Coalition of feature for categorical features in the importance selection + if X.shape[1] > 10: + feature_importance = -np.array(self.model.feature_importances_) + search_space = list(np.argsort(feature_importance)) + # flat_list = [item for t in self.ACXplainer.node_idx_trees for sublist in t for item in sublist] + # node_idx = pd.Series(flat_list) + # search_space = [] + # for v in (node_idx.value_counts().keys()): + # search_space += [v] + else: + search_space = [i for i in range(X.shape[1])] + + if not self.classifier and t is None: + t = self.model.predict_quantiles(X, quantiles=[0.05, 0.95]) + elif self.classifier: + t = np.zeros(shape=(X.shape[0], 2)) + + return cyext_acv.global_sdp_rf(X, y, data, y_data, self.ACXplainer.features, self.ACXplainer.thresholds, + self.ACXplainer.children_left, + self.ACXplainer.children_right, self.ACXplainer.max_depth, min_node_size, + self.classifier, t, C, + pi_level, minimal, stop, search_space[:10]) + + def importance_ddp_rf(self, X, y, data, y_data, min_node_size=5, t=None, + C=[[]], pi_level=0.9, minimal=1, stop=True): + """ + Estimate the Minimal Sufficient Explanations and the Global sdp importance of a set of samples X using the + consistent estimator (Projected Forest + Quantile Regression), see Paper [ref]. + + Args: + X (numpy.ndarray): A matrix of samples (# samples X # features) on which to compute the SDP + + y (numpy.ndarray): 1-D array (# samples) the targets of X + + data (numpy.ndarray): The background dataset that is used for the estimation of the SDP. It should be the + training samples. + + y_data (numpy.ndarray): The targets of the background dataset + + min_node_size (int): The minimal node size + + t (float): The level of variations around the prediction that defines the SDP in regression (only for regression) + + C (list[list[int]]): A list that contains a list of the indices of column for each grouped variables + + pi_level (float): The minimal value of the Same Decision Probability (SDP) of the Sufficient Explanations. + It should be in (0, 1). + + minimal (int): It will search the Sufficient Explanations from subsets of size "minimal" instead of 1 by default + + stop (bool): If stop=True, it will stop searching for the Sufficient Explanations if it does not find + any Sufficient Explanations smaller than (# features / 2), otherwise it will continues until + end. + + Returns: + global_sdp_importance (numpy.ndarray): A 1-D matrix (# features) that is the global explanatory importance + based on samples X. For a given i, sdp_importance[i] corresponds to the + frequency of apparition of feature i in the Minimal Sufficient Explanations + of the set of samples X + + sdp_index (numpy.ndarray): A matrix (# samples X # features) that contains the indices of the variables in the + the Minimal Sufficient Explanations for each sample. For a given i, the positive + values of sdp_index[i] corresponds to the Minimal Sufficient Explanations of + observation i. + + size (numpy.ndarray): A 1-D matrix (# samples) that contains the size of the Minimal Sufficient Explanation + for each sample. + + sdp (numpy.ndarray): A 1-D matrix (# samples) that contains the Same Decision Probability (SDP) + of the Sufficient Explanation for each sample. + """ + X, y = check_X_y(X, y, dtype=np.double) + data, y_data = check_X_y(data, y_data, dtype=np.double) + y, y_data = as_float_array(y).astype(np.double), as_float_array(y_data).astype(np.double) + self.check_is_explainer() + + # TODO: Deal with Coalition of feature for categorical features in the importance selection + if X.shape[1] > 10: + feature_importance = -np.array(self.model.feature_importances_) + search_space = list(np.argsort(feature_importance)) + # flat_list = [item for t in self.ACXplainer.node_idx_trees for sublist in t for item in sublist] + # node_idx = pd.Series(flat_list) + # search_space = [] + # for v in (node_idx.value_counts().keys()): + # search_space += [v] + else: + search_space = [i for i in range(X.shape[1])] + if not self.classifier and t is None: + t = self.model.predict_quantiles(X, quantiles=[0.05, 0.95]) + elif self.classifier: + t = np.zeros(shape=(X.shape[0], 2)) + return cyext_acv.global_ddp_rf(X, y, data, y_data, self.ACXplainer.features, self.ACXplainer.thresholds, + self.ACXplainer.children_left, + self.ACXplainer.children_right, self.ACXplainer.max_depth, min_node_size, + self.classifier, t, C, + pi_level, minimal, stop, search_space[:10]) + + def importance_cdp_rf(self, X, y, down, up, data, y_data, min_node_size=5, t=None, + C=[[]], pi_level=0.9, minimal=1, stop=True): + """ + Estimate the Minimal Sufficient Explanations and the Global sdp importance of a set of samples X using the + consistent estimator (Projected Forest + Quantile Regression), see Paper [ref]. + + Args: + X (numpy.ndarray): A matrix of samples (# samples X # features) on which to compute the SDP + + y (numpy.ndarray): 1-D array (# samples) the targets of X + + data (numpy.ndarray): The background dataset that is used for the estimation of the SDP. It should be the + training samples. + + y_data (numpy.ndarray): The targets of the background dataset + + min_node_size (int): The minimal node size + + t (float): The level of variations around the prediction that defines the SDP in regression (only for regression) + + C (list[list[int]]): A list that contains a list of the indices of column for each grouped variables + + pi_level (float): The minimal value of the Same Decision Probability (SDP) of the Sufficient Explanations. + It should be in (0, 1). + + minimal (int): It will search the Sufficient Explanations from subsets of size "minimal" instead of 1 by default + + stop (bool): If stop=True, it will stop searching for the Sufficient Explanations if it does not find + any Sufficient Explanations smaller than (# features / 2), otherwise it will continues until + end. + + Returns: + global_sdp_importance (numpy.ndarray): A 1-D matrix (# features) that is the global explanatory importance + based on samples X. For a given i, sdp_importance[i] corresponds to the + frequency of apparition of feature i in the Minimal Sufficient Explanations + of the set of samples X + + sdp_index (numpy.ndarray): A matrix (# samples X # features) that contains the indices of the variables in the + the Minimal Sufficient Explanations for each sample. For a given i, the positive + values of sdp_index[i] corresponds to the Minimal Sufficient Explanations of + observation i. + + size (numpy.ndarray): A 1-D matrix (# samples) that contains the size of the Minimal Sufficient Explanation + for each sample. + + sdp (numpy.ndarray): A 1-D matrix (# samples) that contains the Same Decision Probability (SDP) + of the Sufficient Explanation for each sample. + """ + X, y = check_X_y(X, y, dtype=np.double) + data, y_data = check_X_y(data, y_data, dtype=np.double) + y, y_data = as_float_array(y).astype(np.double), as_float_array(y_data).astype(np.double) + self.check_is_explainer() + + if X.shape[1] > 10: + feature_importance = -np.array(self.model.feature_importances_) + search_space = list(np.argsort(feature_importance)) + # flat_list = [item for t in self.ACXplainer.node_idx_trees for sublist in t for item in sublist] + # node_idx = pd.Series(flat_list) + # search_space = [] + # for v in (node_idx.value_counts().keys()): + # search_space += [v] + else: + search_space = [i for i in range(X.shape[1])] + if not self.classifier and t is None: + t = self.model.predict_quantiles(X, quantiles=[0.05, 0.95]) + elif self.classifier: + t = np.zeros(shape=(X.shape[0], 2)) + + return cyext_acv.global_cdp_rf(X, y, down, up, data, y_data, self.ACXplainer.features, + self.ACXplainer.thresholds, + self.ACXplainer.children_left, + self.ACXplainer.children_right, self.ACXplainer.max_depth, min_node_size, + self.classifier, t, C, + pi_level, minimal, stop, search_space[:10]) + + def sufficient_expl_rf(self, X, y, data, y_data, min_node_size=5, t=None, + C=[[]], pi_level=0.9, minimal=1, stop=True): + + """ + Estimate all the Sufficient Explanations and the Global sdp importance of a set of samples X using the + consistent estimator (Projected Forest + Quantile Regression), see Paper [ref]. + + Args: + X (numpy.ndarray): A matrix of samples (# samples X # features) on which to compute the SDP + + y (numpy.ndarray): 1-D array (# samples) the targets of X + + data (numpy.ndarray): The background dataset that is used for the estimation of the SDP. It should be the + training samples. + + y_data (numpy.ndarray): The targets of the background dataset + + min_node_size (int): The minimal node size + + t (float): The level of variations around the prediction that defined the SDP for regression (only for regression) + + C (list[list[int]]): A list that contains a list of the indices of the column for each grouped variables + + pi_level (float): The minimal value of the Same Decision Probability (SDP) of the Sufficient Explanations. + It should be in (0, 1). + + minimal (int): It will search the Sufficient Explanations from subsets of size "minimal" instead of 1 by default + + stop (bool): If stop=True, it will stop searching for the Sufficient Explanations if it does not find + any Sufficient Explanations smaller than (# features / 2), otherwise it will continues until + end. + + Returns: + sufficient_coal (list[list[list[int]]]): a list that contains the column indices of the Sufficient Explanations + of each sample + sdp_coal (list[list[list[int]]]): a list that contains the SDP of the Sufficient Explanations of each sample + + sdp_global (numpy.ndarray): 1-D array (# features), sdp_global[i] corresponds to the frequency of apparition + of variable i in the **all** the sufficient explanations over the samples X. + """ + + X, y = check_X_y(X, y, dtype=np.double) + data, y_data = check_X_y(data, y_data, dtype=np.double) + y, y_data = as_float_array(y).astype(np.double), as_float_array(y_data).astype(np.double) + self.check_is_explainer() + if X.shape[1] > 10: + + feature_importance = -np.array(self.model.feature_importances_) + search_space = list(np.argsort(feature_importance)) + # flat_list = [item for t in self.ACXplainer.node_idx_trees for sublist in t for item in sublist] + # node_idx = pd.Series(flat_list) + # search_space = [] + # for v in (node_idx.value_counts().keys()): + # search_space += [v] + else: + search_space = [i for i in range(X.shape[1])] + # TODO: Remove the [-1] in the Sufficent Coal + + if not self.classifier and t is None: + t = self.model.predict_quantiles(X, quantiles=[0.05, 0.95]) + elif self.classifier: + t = np.zeros(shape=(X.shape[0], 2)) + sufficient_expl, sdp_expl, sdp_global = cyext_acv.sufficient_expl_rf(X, y, data, y_data, + self.ACXplainer.features, + self.ACXplainer.thresholds, + self.ACXplainer.children_left, + self.ACXplainer.children_right, + self.ACXplainer.max_depth, min_node_size, + self.classifier, t, C, + pi_level, minimal, stop, search_space[:10]) + + sufficient_expl = [sufficient_coal[1:] for sufficient_coal in sufficient_expl] + sdp_expl = [sdp_ind[1:] for sdp_ind in sdp_expl] + return sufficient_expl, sdp_expl, sdp_global + + def sufficient_cxpl_rf(self, X, y, data, y_data, min_node_size=5, t=None, + C=[[]], pi_level=0.9, minimal=1, stop=True): + + """ + Estimate all the Sufficient Explanations and the Global sdp importance of a set of samples X using the + consistent estimator (Projected Forest + Quantile Regression), see Paper [ref]. + + Args: + X (numpy.ndarray): A matrix of samples (# samples X # features) on which to compute the SDP + + y (numpy.ndarray): 1-D array (# samples) the targets of X + + data (numpy.ndarray): The background dataset that is used for the estimation of the SDP. It should be the + training samples. + + y_data (numpy.ndarray): The targets of the background dataset + + min_node_size (int): The minimal node size + + t (float): The level of variations around the prediction that defined the SDP for regression (only for regression) + + C (list[list[int]]): A list that contains a list of the indices of the column for each grouped variables + + pi_level (float): The minimal value of the Same Decision Probability (SDP) of the Sufficient Explanations. + It should be in (0, 1). + + minimal (int): It will search the Sufficient Explanations from subsets of size "minimal" instead of 1 by default + + stop (bool): If stop=True, it will stop searching for the Sufficient Explanations if it does not find + any Sufficient Explanations smaller than (# features / 2), otherwise it will continues until + end. + + Returns: + sufficient_coal (list[list[list[int]]]): a list that contains the column indices of the Sufficient Explanations + of each sample + sdp_coal (list[list[list[int]]]): a list that contains the SDP of the Sufficient Explanations of each sample + + sdp_global (numpy.ndarray): 1-D array (# features), sdp_global[i] corresponds to the frequency of apparition + of variable i in the **all** the sufficient explanations over the samples X. + """ + + X, y = check_X_y(X, y, dtype=np.double) + data, y_data = check_X_y(data, y_data, dtype=np.double) + y, y_data = as_float_array(y).astype(np.double), as_float_array(y_data).astype(np.double) + self.check_is_explainer() + if X.shape[1] > 10: + + feature_importance = -np.array(self.model.feature_importances_) + search_space = list(np.argsort(feature_importance)) + # flat_list = [item for t in self.ACXplainer.node_idx_trees for sublist in t for item in sublist] + # node_idx = pd.Series(flat_list) + # search_space = [] + # for v in (node_idx.value_counts().keys()): + # search_space += [v] + else: + search_space = [i for i in range(X.shape[1])] + # TODO: Remove the [-1] in the Sufficent Coal + # TODO: Check S_bar_set for this function + if not self.classifier and t is None: + t = self.model.predict_quantiles(X, quantiles=[0.05, 0.95]) + elif self.classifier: + t = np.zeros(shape=(X.shape[0], 2)) + c_expl, cdp_expl, cdp_global = cyext_acv.sufficient_cxpl_rf(X, y, data, y_data, self.ACXplainer.features, self.ACXplainer.thresholds, + self.ACXplainer.children_left, + self.ACXplainer.children_right, self.ACXplainer.max_depth, min_node_size, + self.classifier, t, C, + pi_level, minimal, stop, search_space[:10]) + + c_expl = [sufficient_coal[1:] for sufficient_coal in c_expl] + return c_expl, cdp_expl[1:], cdp_global + + def compute_exp_rf(self, X, y, data, y_data, S, min_node_size=5, t=None): + """ + Estimate the Conditional Expectation (exp) of a set of samples X given subset S using the consistent estimator + (Projected Forest), see Paper [ref] + + Args: + X (numpy.ndarray): A matrix of samples (# samples X # features) on which to compute the SDP + + y (numpy.ndarray): 1-D array (# samples) the targets of X + + data (numpy.ndarray): The background dataset that is used for the estimation of the SDP. It should be the + training samples. + + y_data (numpy.ndarray): The targets of the background dataset + + S (list[list[int]]): A list that contains the indices of the variable on which we condition to compute the SDP + for each observation + + min_node_size (int): The minimal node size + + t (float): not used here + + Returns: + exp (numpy.ndarray): A 1-D matrix (# samples), exp[i] contains the Conditional Expectation of observation i + given S + """ + X, y = check_X_y(X, y, dtype=np.double) + data, y_data = check_X_y(data, y_data, dtype=np.double) + y, y_data = as_float_array(y).astype(np.double), as_float_array(y_data).astype(np.double) + try: + check_consistent_length(X, S) + except ValueError as exp: + raise ValueError('{} for X (samples) and S (coalition)'.format(exp)) + + self.check_is_explainer() + if not self.classifier and t is None: + t = self.model.predict_quantiles(X, quantiles=[0.05, 0.95]) + elif self.classifier: + t = np.zeros(shape=(X.shape[0], 2)) + exp = cyext_acv.compute_exp_rf(X, y, data, y_data, S, self.ACXplainer.features, self.ACXplainer.thresholds, + self.ACXplainer.children_left, + self.ACXplainer.children_right, self.ACXplainer.max_depth, min_node_size, + self.classifier, t) + return exp + + def compute_cdf_rf(self, X, y, data, y_data, S, min_node_size=5, t=None): + """ + Estimate the Projected Cumulative Distribution Function (P-CDF) of a set of samples X given subset S using the + consistent estimator (Projected Forest + Quantile Regression), see Paper [ref] + + Args: + X (numpy.ndarray): A matrix of samples (# samples X # features) on which to compute the SDP + + y (numpy.ndarray): 1-D array (# samples) the targets of X + + data (numpy.ndarray): The background dataset that is used for the estimation of the SDP. It should be the + training samples. + + y_data (numpy.ndarray): The targets of the background dataset + + S (list[list[int]]): A list that contains the indices of the variable on which we condition to compute the P-CDF + for each observation + + min_node_size (int): The minimal node size of the Projected Forest + + t (float): not used here + + Returns: + exp (numpy.ndarray): A 1-D matrix (# samples), exp[i] contains the Conditional Expectation of observation i + given S + """ + X, y = check_X_y(X, y, dtype=np.double) + data, y_data = check_X_y(data, y_data, dtype=np.double) + y, y_data = as_float_array(y).astype(np.double), as_float_array(y_data).astype(np.double) + try: + check_consistent_length(X, S) + except ValueError as exp: + raise ValueError('{} for X (samples) and S (coalition)'.format(exp)) + + self.check_is_explainer() + if not self.classifier and t is None: + t = self.model.predict_quantiles(X, quantiles=[0.05, 0.95]) + elif self.classifier: + t = np.zeros(shape=(X.shape[0], 2)) + sdp = cyext_acv.compute_cdf_rf(X, y, data, y_data, S, self.ACXplainer.features, self.ACXplainer.thresholds, + self.ACXplainer.children_left, + self.ACXplainer.children_right, self.ACXplainer.max_depth, min_node_size, + self.classifier, t) + return sdp + + @staticmethod + def compute_local_sdp(d, all_sufficient_coal): + + def compute_local_sdp_one(sufficient_coal): + """ + Estimate the local explanatory importance of each variable given the set of Sufficient Explanations of each + sample + Args: + d (int): # features + sufficient_coal (list[list[list[int]]]): a list that contains the column indices of the Sufficient Explanations + of each sample + Returns: + local_exp_imp (numpy.ndarray): 1-D array (# features) the local explanatory importance of each variable for each + sample. + """ + flat = [item for sublist in sufficient_coal for item in sublist] + flat = pd.Series(flat) + flat = dict(flat.value_counts() / len(sufficient_coal)) + local_sdp = np.zeros(d) + for key in flat.keys(): + local_sdp[key] = flat[key] + return local_sdp + + nb_obs = len(all_sufficient_coal) + lximp = np.zeros(d) + for i in range(nb_obs): + if len(all_sufficient_coal[i]) == 0: + nb_obs -= 1 + continue + lximp += compute_local_sdp_one(all_sufficient_coal[i]) + return lximp / nb_obs + + @staticmethod + def compute_msdp_clf(X, S, data, model=None): + """ + Compute marginal SDP of a set of sample X given S for classifier + """ + return msdp(X, S, model, data) + + @staticmethod + def importance_msdp_clf_search(X, data, model=None, C=[[]], minimal=1, pi_level=0.9, r_search_space=None, + stop=True): + """ + Compute the marginal minimal sufficient explanations of any classifier + """ + + return importance_msdp_clf_search(X=X, rg_data=data, model=model, C=C, minimal=minimal, + pi_level=pi_level, r_search_space=r_search_space, stop=stop) + + @staticmethod + def compute_msdp_reg(X, S, data, model=None, threshold=0.2): + """ + Compute marginal SDP of a set of sample X given S for regressor + """ + return msdp_reg(X, S, model, data, threshold) + + @staticmethod + def importance_msdp_reg_search(X, data, model=None, C=[[]], minimal=1, pi_level=0.9, threshold=0.2, + r_search_space=None, stop=True): + """ + Compute the marginal minimal sufficient explanations of any regressor model + """ + return importance_msdp_reg_search(X, rg_data=data, model=model, C=C, minimal=minimal, pi_level=pi_level, + threshold=threshold, r_search_space=r_search_space, stop=stop) + + # def compute_quantile_rf(self, X, y, data, y_data, S, min_node_size=5, classifier=1, t=20, quantile=95): + # X, y = check_X_y(X, y, dtype=np.double) + # data, y_data = check_X_y(data, y_data, dtype=np.double) + # y, y_data = as_float_array(y).astype(np.double), as_float_array(y_data).astype(np.double) + # try: + # check_consistent_length(X, S) # except ValueError as exp: # raise ValueError('{} for X (samples) and S (coalition)'.format(exp)) # @@ -701,3 +1410,365 @@ def importance_msdp_reg_search(X, data, model=None, C=[[]], minimal=1, pi_level= # min_node_size, # classifier, t, quantile) # return y_quantiles_diff + + def compute_ddp_intv_weights(self, X, y, data, y_data, S, cond, min_node_size=5, t=None, pi_level=0.95, + verbose=False, algo2=False, rdm_size=20): + """ + Compute P(Y \neq y | X_{\bar{S}} in rule_{\bar{S}}), X_S is missing + + Args: + X (numpy.ndarray): A matrix of samples (# samples X # features) on which to compute the SDP + + y (numpy.ndarray): 1-D array (# samples) the targets of X + + data (numpy.ndarray): The background dataset that is used for the estimation of the SDP. It should be the + training samples. + + y_data (numpy.ndarray): The targets of the background dataset + + S (list[list[int]]): A list that contains the indices of the columns of the variable of the Sufficient + Explanations for each observation + + min_node_size (int): The minimal node size of the Projected Forest + + t (double): The level of variations around the prediction that defines the SDP in regression (only for regression) + + pi_level (double): The minimal level of SDP for the Sufficient Explanations + + Returns: + sdp (numpy.ndarray): A 1-D matrix (# samples), sdp[i] contains the Same Decision Probability (SDP) + of the Sufficient Explanation of observation i + rules (numpy.ndarray): A matrix (# samples x # features x 2), rules[i] that contains the maximal local rule + of observation i + """ + X, y = check_X_y(X, y, dtype=np.double) + data, y_data = check_X_y(data, y_data, dtype=np.double) + y, y_data = as_float_array(y).astype(np.double), as_float_array(y_data).astype(np.double) + try: + check_consistent_length(X, S) + except ValueError as exp: + raise ValueError('{} for X (samples) and S (coalition)'.format(exp)) + + self.check_is_explainer() + + if not self.classifier and t is None: + t = self.model.predict_quantiles(X, quantiles=[0.05, 0.95]) + elif self.classifier: + t = np.zeros(shape=(X.shape[0], 2)) + ddp, w = cyext_acv.compute_ddp_intv_weights(X, y, data, y_data, S, + self.ACXplainer.features, + self.ACXplainer.thresholds, + self.ACXplainer.children_left, + self.ACXplainer.children_right, + cond, + self.ACXplainer.max_depth, + min_node_size, self.classifier, t) + + return ddp, w + + def compute_ddp_intv_same(self, X, y, data, y_data, S, cond, min_node_size=5, t=None, pi_level=0.95, + verbose=False, algo2=False, rdm_size=20): + """ + Compute P(Y \neq y | X_{\bar{S}} in rule_{\bar{S}}), X_S is missing using same S + + Args: + X (numpy.ndarray): A matrix of samples (# samples X # features) on which to compute the SDP + + y (numpy.ndarray): 1-D array (# samples) the targets of X + + data (numpy.ndarray): The background dataset that is used for the estimation of the SDP. It should be the + training samples. + + y_data (numpy.ndarray): The targets of the background dataset + + S (list[list[int]]): A list that contains the indices of the columns of the variable of the Sufficient + Explanations for each observation + + min_node_size (int): The minimal node size of the Projected Forest + + t (double): The level of variations around the prediction that defines the SDP in regression (only for regression) + + pi_level (double): The minimal level of SDP for the Sufficient Explanations + + Returns: + sdp (numpy.ndarray): A 1-D matrix (# samples), sdp[i] contains the Same Decision Probability (SDP) + of the Sufficient Explanation of observation i + rules (numpy.ndarray): A matrix (# samples x # features x 2), rules[i] that contains the maximal local rule + of observation i + """ + X, y = check_X_y(X, y, dtype=np.double) + data, y_data = check_X_y(data, y_data, dtype=np.double) + y, y_data = as_float_array(y).astype(np.double), as_float_array(y_data).astype(np.double) + # try: + # check_consistent_length(X, S) + # except ValueError as exp: + # raise ValueError('{} for X (samples) and S (coalition)'.format(exp)) + + self.check_is_explainer() + if not self.classifier and t is None: + t = self.model.predict_quantiles(X, quantiles=[0.05, 0.95]) + elif self.classifier: + t = np.zeros(shape=(X.shape[0], 2)) + ddp = cyext_acv.compute_ddp_intv_same_set(X, y, data, y_data, S, + self.ACXplainer.features, + self.ACXplainer.thresholds, + self.ACXplainer.children_left, + self.ACXplainer.children_right, + cond, + self.ACXplainer.max_depth, + min_node_size, self.classifier, t) + + return ddp + + def importance_ddp_intv(self, X, y, data, y_data, cond, min_node_size=5, t=None, + C=[[]], pi_level=0.9, minimal=1, stop=True): + """ + Find Minimal Divergent Set for Rule P(Y \neq y | X_{\bar{S}} in rule_{\bar{S}}), X_S is missing + + Args: + X (numpy.ndarray): A matrix of samples (# samples X # features) on which to compute the SDP + + y (numpy.ndarray): 1-D array (# samples) the targets of X + + data (numpy.ndarray): The background dataset that is used for the estimation of the SDP. It should be the + training samples. + + y_data (numpy.ndarray): The targets of the background dataset + + min_node_size (int): The minimal node size + + t (float): The level of variations around the prediction that defines the SDP in regression (only for regression) + + C (list[list[int]]): A list that contains a list of the indices of column for each grouped variables + + pi_level (float): The minimal value of the Same Decision Probability (SDP) of the Sufficient Explanations. + It should be in (0, 1). + + minimal (int): It will search the Sufficient Explanations from subsets of size "minimal" instead of 1 by default + + stop (bool): If stop=True, it will stop searching for the Sufficient Explanations if it does not find + any Sufficient Explanations smaller than (# features / 2), otherwise it will continues until + end. + + Returns: + global_sdp_importance (numpy.ndarray): A 1-D matrix (# features) that is the global explanatory importance + based on samples X. For a given i, sdp_importance[i] corresponds to the + frequency of apparition of feature i in the Minimal Sufficient Explanations + of the set of samples X + + sdp_index (numpy.ndarray): A matrix (# samples X # features) that contains the indices of the variables in the + the Minimal Sufficient Explanations for each sample. For a given i, the positive + values of sdp_index[i] corresponds to the Minimal Sufficient Explanations of + observation i. + + size (numpy.ndarray): A 1-D matrix (# samples) that contains the size of the Minimal Sufficient Explanation + for each sample. + + sdp (numpy.ndarray): A 1-D matrix (# samples) that contains the Same Decision Probability (SDP) + of the Sufficient Explanation for each sample. + """ + X, y = check_X_y(X, y, dtype=np.double) + data, y_data = check_X_y(data, y_data, dtype=np.double) + y, y_data = as_float_array(y).astype(np.double), as_float_array(y_data).astype(np.double) + self.check_is_explainer() + + if X.shape[1] > 10: + feature_importance = -np.array(self.model.feature_importances_) + search_space = list(np.argsort(feature_importance)) + # flat_list = [item for t in self.ACXplainer.node_idx_trees for sublist in t for item in sublist] + # node_idx = pd.Series(flat_list) + # search_space = [] + # for v in (node_idx.value_counts().keys()): + # search_space += [v] + else: + search_space = [i for i in range(X.shape[1])] + if not self.classifier and t is None: + t = self.model.predict_quantiles(X, quantiles=[0.05, 0.95]) + elif self.classifier: + t = np.zeros(shape=(X.shape[0], 2)) + return cyext_acv.global_ddp_intv(X, y, data, y_data, self.ACXplainer.features, self.ACXplainer.thresholds, + self.ACXplainer.children_left, + self.ACXplainer.children_right, cond, self.ACXplainer.max_depth, min_node_size, + self.classifier, t, C, + pi_level, minimal, stop, search_space[:10]) + + def compute_cdp_intv_weights(self, X, y, data, y_data, S, cond, min_node_size=5, t=None, pi_level=0.95, + verbose=False, algo2=False, rdm_size=20): + """ + Compute P(Y \neq y | X_{\bar{S}} in rule_{\bar{S}}), X_S is missing + + Args: + X (numpy.ndarray): A matrix of samples (# samples X # features) on which to compute the SDP + + y (numpy.ndarray): 1-D array (# samples) the targets of X + + data (numpy.ndarray): The background dataset that is used for the estimation of the SDP. It should be the + training samples. + + y_data (numpy.ndarray): The targets of the background dataset + + S (list[list[int]]): A list that contains the indices of the columns of the variable of the Sufficient + Explanations for each observation + + min_node_size (int): The minimal node size of the Projected Forest + + t (double): The level of variations around the prediction that defines the SDP in regression (only for regression) + + pi_level (double): The minimal level of SDP for the Sufficient Explanations + + Returns: + sdp (numpy.ndarray): A 1-D matrix (# samples), sdp[i] contains the Same Decision Probability (SDP) + of the Sufficient Explanation of observation i + rules (numpy.ndarray): A matrix (# samples x # features x 2), rules[i] that contains the maximal local rule + of observation i + """ + X, y = check_X_y(X, y, dtype=np.double) + data, y_data = check_X_y(data, y_data, dtype=np.double) + y, y_data = as_float_array(y).astype(np.double), as_float_array(y_data).astype(np.double) + try: + check_consistent_length(X, S) + except ValueError as exp: + raise ValueError('{} for X (samples) and S (coalition)'.format(exp)) + + self.check_is_explainer() + + if not self.classifier and t is None: + t = self.model.predict_quantiles(X, quantiles=[0.05, 0.95]) + elif self.classifier: + t = np.zeros(shape=(X.shape[0], 2)) + ddp, w = cyext_acv.compute_cdp_intv_weights(X, y, data, y_data, S, + self.ACXplainer.features, + self.ACXplainer.thresholds, + self.ACXplainer.children_left, + self.ACXplainer.children_right, + cond, + self.ACXplainer.max_depth, + min_node_size, self.classifier, t) + + return ddp, w + + def compute_cdp_intv_same(self, X, y, data, y_data, S, cond, min_node_size=5, t=None, pi_level=0.95, + verbose=False, algo2=False, rdm_size=20): + """ + Compute P(Y \neq y | X_{\bar{S}} in rule_{\bar{S}}), X_S is missing using same S + + Args: + X (numpy.ndarray): A matrix of samples (# samples X # features) on which to compute the SDP + + y (numpy.ndarray): 1-D array (# samples) the targets of X + + data (numpy.ndarray): The background dataset that is used for the estimation of the SDP. It should be the + training samples. + + y_data (numpy.ndarray): The targets of the background dataset + + S (list[list[int]]): A list that contains the indices of the columns of the variable of the Sufficient + Explanations for each observation + + min_node_size (int): The minimal node size of the Projected Forest + + t (double): The level of variations around the prediction that defines the SDP in regression (only for regression) + + pi_level (double): The minimal level of SDP for the Sufficient Explanations + + Returns: + sdp (numpy.ndarray): A 1-D matrix (# samples), sdp[i] contains the Same Decision Probability (SDP) + of the Sufficient Explanation of observation i + rules (numpy.ndarray): A matrix (# samples x # features x 2), rules[i] that contains the maximal local rule + of observation i + """ + X, y = check_X_y(X, y, dtype=np.double) + data, y_data = check_X_y(data, y_data, dtype=np.double) + y, y_data = as_float_array(y).astype(np.double), as_float_array(y_data).astype(np.double) + # try: + # check_consistent_length(X, S) + # except ValueError as exp: + # raise ValueError('{} for X (samples) and S (coalition)'.format(exp)) + + self.check_is_explainer() + if not self.classifier and t is None: + t = self.model.predict_quantiles(X, quantiles=[0.05, 0.95]) + elif self.classifier: + t = np.zeros(shape=(X.shape[0], 2)) + ddp = cyext_acv.compute_cdp_intv_same_set(X, y, data, y_data, S, + self.ACXplainer.features, + self.ACXplainer.thresholds, + self.ACXplainer.children_left, + self.ACXplainer.children_right, + cond, + self.ACXplainer.max_depth, + min_node_size, self.classifier, t) + + return ddp + + def importance_cdp_intv(self, X, y, data, y_data, cond, min_node_size=5, t=None, + C=[[]], pi_level=0.9, minimal=1, stop=True): + """ + Find Minimal Divergent Set for Rule P(Y \neq y | X_{\bar{S}} in rule_{\bar{S}}), X_S is missing + + Args: + X (numpy.ndarray): A matrix of samples (# samples X # features) on which to compute the SDP + + y (numpy.ndarray): 1-D array (# samples) the targets of X + + data (numpy.ndarray): The background dataset that is used for the estimation of the SDP. It should be the + training samples. + + y_data (numpy.ndarray): The targets of the background dataset + + min_node_size (int): The minimal node size + + t (float): The level of variations around the prediction that defines the SDP in regression (only for regression) + + C (list[list[int]]): A list that contains a list of the indices of column for each grouped variables + + pi_level (float): The minimal value of the Same Decision Probability (SDP) of the Sufficient Explanations. + It should be in (0, 1). + + minimal (int): It will search the Sufficient Explanations from subsets of size "minimal" instead of 1 by default + + stop (bool): If stop=True, it will stop searching for the Sufficient Explanations if it does not find + any Sufficient Explanations smaller than (# features / 2), otherwise it will continues until + end. + + Returns: + global_sdp_importance (numpy.ndarray): A 1-D matrix (# features) that is the global explanatory importance + based on samples X. For a given i, sdp_importance[i] corresponds to the + frequency of apparition of feature i in the Minimal Sufficient Explanations + of the set of samples X + + sdp_index (numpy.ndarray): A matrix (# samples X # features) that contains the indices of the variables in the + the Minimal Sufficient Explanations for each sample. For a given i, the positive + values of sdp_index[i] corresponds to the Minimal Sufficient Explanations of + observation i. + + size (numpy.ndarray): A 1-D matrix (# samples) that contains the size of the Minimal Sufficient Explanation + for each sample. + + sdp (numpy.ndarray): A 1-D matrix (# samples) that contains the Same Decision Probability (SDP) + of the Sufficient Explanation for each sample. + """ + X, y = check_X_y(X, y, dtype=np.double) + data, y_data = check_X_y(data, y_data, dtype=np.double) + y, y_data = as_float_array(y).astype(np.double), as_float_array(y_data).astype(np.double) + self.check_is_explainer() + + if X.shape[1] > 10: + feature_importance = -np.array(self.model.feature_importances_) + search_space = list(np.argsort(feature_importance)) + # flat_list = [item for t in self.ACXplainer.node_idx_trees for sublist in t for item in sublist] + # node_idx = pd.Series(flat_list) + # search_space = [] + # for v in (node_idx.value_counts().keys()): + # search_space += [v] + else: + search_space = [i for i in range(X.shape[1])] + if not self.classifier and t is None: + t = self.model.predict_quantiles(X, quantiles=[0.05, 0.95]) + elif self.classifier: + t = np.zeros(shape=(X.shape[0], 2)) + return cyext_acv.global_cdp_intv(X, y, data, y_data, self.ACXplainer.features, self.ACXplainer.thresholds, + self.ACXplainer.children_left, + self.ACXplainer.children_right, cond, self.ACXplainer.max_depth, min_node_size, + self.classifier, t, C, + pi_level, minimal, stop, search_space[:10]) diff --git a/acv_explainers/base_tree.py b/acv_explainers/base_tree.py index 2b7753b..9980aea 100644 --- a/acv_explainers/base_tree.py +++ b/acv_explainers/base_tree.py @@ -610,6 +610,9 @@ def __init__(self, model, data=None, data_missing=None, cache=False, cache_norma # data_leaves_trees = -np.ones(shape=(len(self.leaves_nb), np.max(self.leaves_nb), self.data.shape[0], self.data.shape[1]), dtype=np.int) for i in range(len(self.leaves_nb)): leaf_idx_trees[i, :self.leaves_nb[i]] = np.array(self.leaf_idx_trees[i], dtype=np.int) + + if self.data.shape[1] == 1: + self.partition_leaves_trees[i] = np.expand_dims(self.partition_leaves_trees[i], axis=1) partition_leaves_trees[i, :self.leaves_nb[i]] = np.array(self.partition_leaves_trees[i]) # data_leaves_trees[i, :self.leaves_nb[i]] = np.array(self.data_leaves_trees[i], dtype=np.int) diff --git a/acv_explainers/counterfactual_rules.py b/acv_explainers/counterfactual_rules.py new file mode 100644 index 0000000..3853788 --- /dev/null +++ b/acv_explainers/counterfactual_rules.py @@ -0,0 +1,359 @@ +from .utils_cr import * +import acv_explainers + +class CR: + + def __init__(self, acv_explainer, x_train, x_test, y_train, y_test, columns_name, model=None): + self.model = None + self.columns_name = columns_name + self.acv_explainer = acv_explainer + self.x_train = x_train + self.x_test = x_test + self.y_train = y_train + self.y_test = y_test + self.ddp_importance_local, self.ddp_index_local, self.size_local, self.ddp_local = None, None, None, None + self.S_star_local, self.S_bar_set_local = None, None + self.ddp_local, self.w_local = None, None + self.counterfactuals_samples_local, self.counterfactuals_samples_sdp_local, \ + self.counterfactuals_samples_w_local = None, None, None + self.isolation = None, None + self.dist_local = None + self.score_local = None + self.errs_local = None + self.errs_local_original = None + self.accuracy_local = None + self.accuracy_local_original = None + self.coverage_local = None + self.sdp_importance_se, self.sdp_index_se, self.size_se, self.sdp_se = None, None, None, None + self.S_star_se, self.N_star_se = None, None + self.sdp_rules, self.rules, self.sdp_all, self.rules_data, self.w_rules = None, None, None, None, None + + self.ddp_importance_regional, self.ddp_index_regional, self.size_regional, self.ddp_regional = None, None, None, None + self.S_star_regional, self.S_bar_set_regional = None, None + self.counterfactuals_samples_regional, self.counterfactuals_samples_sdp_regional, \ + self.counterfactuals_samples_w_regional = None, None, None + self.dist_regional = None + self.score_regional = None + self.errs_regional = None + self.errs_regional_original = None + self.accuracy_regional = None + self.accuracy_regional_original = None + self.coverage_regional = None + + def run_local_divergent_set(self, x, y_target=None, down=None, up=None, t=None, stop=True, pi_level=0.8): + if y_target is None: + y_target = np.zeros(shape=(x.shape[0])) + if down is None: + down = np.zeros(shape=(x.shape[0])) + if up is None: + up = np.zeros(shape=(x.shape[0])) + + print('### Computing the local divergent set of (x, y)') + self.ddp_importance_local, self.ddp_index_local, self.size_local, self.ddp_local = \ + self.acv_explainer.importance_cdp_rf(x, y_target, down, up, self.x_train, self.y_train, t=t, + stop=stop, pi_level=pi_level) + + self.S_star_local, self.S_bar_set_local = \ + acv_explainers.utils.get_active_null_coalition_list(self.ddp_index_local, self.size_local) + + self.ddp_local, self.w_local = self.acv_explainer.compute_cdp_weights(x, y_target, down, up, self.x_train, + self.y_train, + S=self.S_bar_set_local) + + def run_local_counterfactual_rules(self, x, y_target=None, down=None, up=None, + acc_level=0.8, pi_level=0.8, p_best=0.85, n_try=100, + batch=100, max_iter=100, temp=1, max_iter_convergence=100): + if y_target is None: + y_target = np.zeros(shape=(x.shape[0])) + if down is None: + down = np.zeros(shape=(x.shape[0])) + if up is None: + up = np.zeros(shape=(x.shape[0])) + + print('### Computing the local counterfactual rules of (x, y)') + if self.acv_explainer.classifier: + self.counterfactuals_samples_local, self.counterfactuals_samples_sdp_local, \ + self.counterfactuals_samples_w_local = return_global_counterfactuals(self.acv_explainer, x, y_target, + self.S_star_local, + self.S_bar_set_local, + self.x_train, self.y_train, + self.w_local, + acc_level=acc_level, + pi_level=pi_level, + p_best=p_best, n_try=n_try, + batch=batch, max_iter=max_iter, + temp=temp, + max_iter_convergence=max_iter_convergence + ) + else: + self.counterfactuals_samples_local, self.counterfactuals_samples_sdp_local, \ + self.counterfactuals_samples_w_local = return_global_counterfactuals_reg(self.acv_explainer, x, y_target, + down, up, + self.S_star_local, + self.S_bar_set_local, + self.x_train, self.y_train, + self.w_local, + acc_level=acc_level, + pi_level=acc_level) + + def run_sampling_local_counterfactuals(self, x, y_target=None, down=None, up=None, batch=1000, max_iter=1000, temp=0.5): + if y_target is None: + y_target = np.zeros(shape=(x.shape[0])) + if down is None: + down = np.zeros(shape=(x.shape[0])) + if up is None: + up = np.zeros(shape=(x.shape[0])) + + print('### Sampling using the local counterfactual rules of (x, y)') + self.isolation = IsolationForest() + self.isolation.fit(self.x_train) + outlier_score = lambda x: self.isolation.decision_function(x) + + self.dist_local = [] + self.score_local = [] + self.errs_local = [] + self.errs_local_original = [] + for i in tqdm(range(x.shape[0])): + if len(self.counterfactuals_samples_local[i]) != 0: + a, sco = simulated_annealing(outlier_score, x[i], self.S_star_local[i], self.x_train, + self.counterfactuals_samples_local[i][ + np.argmax(self.counterfactuals_samples_sdp_local[i])], + batch, max_iter, temp) + self.dist_local.append(np.squeeze(a)) + self.score_local.append(sco) + + if self.acv_explainer.classifier: + self.errs_local.append(self.acv_explainer.predict(self.dist_local[-1].reshape(1, -1)) != self.acv_explainer.predict( + x[i].reshape(1, -1))) + else: + self.errs_local.append( + down[i] <= self.acv_explainer.predict(self.dist_local[-1].reshape(1, -1)) <= up[i]) + if self.model != None: + self.errs_local_original.append( + self.model.predict(self.dist_local[-1].reshape(1, -1)) != self.model.predict( + x[i].reshape(1, -1))) + + self.accuracy_local = np.mean(self.errs_local) + self.accuracy_local_original = np.mean(self.errs_local_original) + self.coverage_local = len(self.errs_local) / x.shape[0] + + def run_sufficient_rules(self, x_rule, y_rule, t=None, pi_level=0.9, algo2=False, p_best=0.6, n_try=50, + batch=100, max_iter=200, temp=1, max_iter_convergence=50): + print('### Computing the Sufficient Explanations and the Sufficient Rules') + self.x_rules, self.y_rules, self.t = x_rule, y_rule, t + self.sdp_importance_se, self.sdp_index_se, self.size_se, self.sdp_se = \ + self.acv_explainer.importance_sdp_rf(x_rule, y_rule, + self.x_train, self.y_train, t=t, + stop=False, + pi_level=pi_level) + + self.S_star_se, self.N_star_se = get_active_null_coalition_list(self.sdp_index_se, self.size_se) + self.sdp_rules, self.rules, self.sdp_all, self.rules_data, self.w_rules =\ + self.acv_explainer.compute_sdp_maxrules(x_rule, y_rule, self.x_train, self.y_train, self.S_star_se, + t=t, verbose=True, algo2=algo2, pi_level=pi_level, + p_best=p_best, n_try=n_try, batch=batch, max_iter=max_iter, + temp=temp, max_iter_convergence=max_iter_convergence) + + def run_regional_divergent_set(self, y_rules_target=None, down_up=None, stop=True, pi_level=0.8): + if y_rules_target is None: + y_rules_target = np.zeros(shape=(self.x_rules.shape[0])) + if down_up is None: + down_up = np.zeros(shape=(self.x_rules.shape[0], 2)) + print('### Computing the regional divergent set of (x, y)') + self.y_rules_target, self.down_up = y_rules_target, down_up + + self.ddp_importance_regional, self.ddp_index_regional, self.size_regional, self.ddp_regional = \ + self.acv_explainer.importance_cdp_intv(self.x_rules, self.y_rules_target, + self.x_train, self.y_train, + self.rules, + t=self.down_up, + stop=stop, + pi_level=pi_level) + + self.S_star_regional, self.S_bar_set_regional = \ + acv_explainers.utils.get_active_null_coalition_list(self.ddp_index_regional, self.size_regional) + + self.ddp_regional, self.w_regional = self.acv_explainer.compute_cdp_intv_weights(self.x_rules, self.y_rules_target, + self.x_train, self.y_train, + cond=self.rules, + t=self.down_up, + S=self.S_bar_set_regional) + + def run_regional_counterfactual_rules(self, acc_level=0.8, pi_level=0.8, p_best=0.85, n_try=100, + batch=100, max_iter=100, temp=1, max_iter_convergence=100): + if self.acv_explainer.classifier: + self.counterfactuals_samples_regional, self.counterfactuals_samples_sdp_regional, \ + self.counterfactuals_samples_w_regional = \ + return_ge_global_counterfactuals(self.acv_explainer, self.x_rules, self.y_rules_target, + self.S_star_regional, self.S_bar_set_regional, + self.x_train, self.y_train, self.w_regional, acc_level, self.rules, + pi_level, p_best=p_best, n_try=n_try, + batch=batch, max_iter=max_iter, temp=temp, + max_iter_convergence=max_iter_convergence) + else: + down = self.down_up[:, 0] + up = self.down_up[:, 1] + print('### Computing the regional counterfactual rules of (x, y)') + self.counterfactuals_samples_regional, self.counterfactuals_samples_sdp_regional, \ + self.counterfactuals_samples_w_regional = \ + return_ge_global_counterfactuals_reg(self.acv_explainer, self.x_rules, self.y_rules_target, down, up, + self.S_star_regional, self.S_bar_set_regional, + self.x_train, self.y_train, self.w_regional, acc_level, self.rules, + pi_level, p_best=p_best, n_try=n_try, + batch=batch, max_iter=max_iter, temp=temp, + max_iter_convergence=max_iter_convergence + ) + + def run_sampling_regional_counterfactuals(self, max_obs=2, batch=1000, max_iter=1000, temp=0.5): + down = self.down_up[:, 0] + up = self.down_up[:, 1] + print('### Sampling using the regional counterfactual rules') + outlier_score = lambda x: self.isolation.decision_function(x) + self.dist_regional = [] + self.score_regional = [] + self.errs_regional = [] + self.errs_regional_original = [] + nb = 0 + for i in range(self.x_rules.shape[0]): + if len(self.counterfactuals_samples_regional[i]) != 0: + x_in = np.prod([(self.x_test[:, s] <= self.rules[i, s, 1]) * (self.x_test[:, s] >= self.rules[i, s, 0]) + for s in range(self.x_train.shape[1])], axis=0).astype(bool) + nb += np.sum(x_in) if np.sum(x_in) <= max_obs else max_obs + print('observations in rule = {}'.format(np.sum(x_in))) + if np.sum(x_in) > 0: + for xi in tqdm(self.x_test[x_in][:max_obs]): + a, sco = simulated_annealing(outlier_score, xi, self.S_star_regional[i], self.x_train, + self.counterfactuals_samples_regional[i][ + np.argmax(self.counterfactuals_samples_sdp_regional[i])], + batch, max_iter, temp) + self.dist_regional.append(np.squeeze(a)) + self.score_regional.append(sco) + if self.acv_explainer.classifier: + self.errs_regional.append(self.acv_explainer.predict( + self.dist_regional[-1].reshape(1, -1)) != self.acv_explainer.predict(xi.reshape(1, -1))) + else: + self.errs_regional.append( + down[i] <= self.acv_explainer.predict(self.dist_regional[-1].reshape(1, -1)) <= up[i]) + if self.model != None: + self.errs_regional_original.append(self.model.predict( + self.dist_regional[-1].reshape(1, -1)) != self.model.predict(xi.reshape(1, -1))) + + self.accuracy_regional = np.mean(self.errs_regional) + self.accuracy_regional_original = np.mean(self.errs_regional_original) + self.coverage_regional = len(self.errs_regional) / nb + + def run_sampling_regional_counterfactuals_alltests(self, max_obs=2, batch=1000, max_iter=1000, temp=0.5): + down = self.down_up[:, 0] + up = self.down_up[:, 1] + + print('### Sampling using the regional counterfactual rules') + outlier_score = lambda x: self.isolation.decision_function(x) + + self.dist_regional = [] + self.score_regional = [] + self.errs_regional = [] + self.errs_regional_original = [] + x_test_pb = [] + + for i in range(self.x_rules.shape[0]): + x_in = np.prod([(self.x_test[:, s] <= self.rules[i, s, 1]) * (self.x_test[:, s] > self.rules[i, s, 0]) + for s in range(self.x_train.shape[1])], axis=0) + if len(self.counterfactuals_samples_regional[i]) != 0: + x_in = np.max(self.counterfactuals_samples_sdp_regional[i]) * x_in + else: + x_in = 0 * x_in + x_test_pb.append(x_in) + + x_test_pb = np.array(x_test_pb) + best_counterfactuals = np.argmax(x_test_pb, axis=0) + + for i in tqdm(range(self.x_test.shape[0])): + xi = self.x_test[i] + best_id = best_counterfactuals[i] + if len(self.counterfactuals_samples_regional[best_id]) != 0: + a, sco = simulated_annealing(outlier_score, xi, self.S_star_regional[best_id], self.x_train, + self.counterfactuals_samples_regional[best_id][ + np.argmax(self.counterfactuals_samples_sdp_regional[best_id])][0], + batch, max_iter, temp) + self.dist_regional.append(np.squeeze(a)) + self.score_regional.append(sco) + if self.acv_explainer.classifier: + self.errs_regional.append(self.acv_explainer.predict( + self.dist_regional[-1].reshape(1, -1)) != self.acv_explainer.predict(xi.reshape(1, -1))) + else: + self.errs_regional.append( + down[i] <= self.acv_explainer.predict(self.dist_regional[-1].reshape(1, -1)) <= up[i]) + + if self.model != None: + self.errs_regional_original.append(self.model.predict( + self.dist_regional[-1].reshape(1, -1)) != self.model.predict(xi.reshape(1, -1))) + + self.accuracy_regional = np.mean(self.errs_regional) + self.accuracy_regional_original = np.mean(self.errs_regional_original) + self.coverage_regional = len(self.errs_regional) / self.x_test.shape[0] + + def show_global_counterfactuals(self): + if not self.acv_explainer.classifier: + for idt in range(self.rules.shape[0]): + print('Example {}'.format(idt)) + r = self.rules[idt] + + print_rule(self.columns_name, r, self.sdp_rules[idt], True, self.y_rules[idt]) + + print(' ') + print(' ') + print(' ') + for l in range(len(self.counterfactuals_samples_sdp_regional[idt])): + print('Example {} - Counterfactual {}'.format(idt, l)) + w = self.counterfactuals_samples_w_regional[idt][l] + print_rule(self.columns_name, self.counterfactuals_samples_regional[idt][l], + self.counterfactuals_samples_sdp_regional[idt][l], False, np.mean(self.y_train[w != 0])) + print(' ') + print(' ') + else: + for idt in range(self.rules.shape[0]): + print('Example {}'.format(idt)) + r = self.rules[idt] + + print_rule(self.columns_name, r, self.sdp_rules[idt], True, self.y_rules[idt]) + + print(' ') + print(' ') + print(' ') + for l in range(len(self.counterfactuals_samples_sdp_regional[idt])): + print('Example {} - Counterfactual {}'.format(idt, l)) + print_rule(self.columns_name, self.counterfactuals_samples_regional[idt][l], + self.counterfactuals_samples_sdp_regional[idt][l], False, self.y_rules_target[idt]) + print(' ') + print(' ') + + def show_local_counterfactuals(self, x, y_target): + if not self.acv_explainer.classifier: + for idt in range(x.shape[0]): + print(self.columns_name) + print('Example {} = {}'.format(idt, x[idt])) + + print(' ') + print(' ') + print(' ') + for l in range(len(self.counterfactuals_samples_sdp_local[idt])): + w = self.counterfactuals_samples_w_local[idt][l] + print('Example {} - Counterfactual {}'.format(idt, l)) + print_rule(self.columns_name, self.counterfactuals_samples_local[idt][l], + self.counterfactuals_samples_sdp_local[idt][l], False, np.mean(self.y_train[w != 0])) + print(' ') + print(' ') + else: + for idt in range(x.shape[0]): + print(self.columns_name) + print('Example {} = {}'.format(idt, x[idt])) + + print(' ') + print(' ') + print(' ') + for l in range(len(self.counterfactuals_samples_sdp_local[idt])): + print('Example {} - Counterfactual {}'.format(idt, l)) + print_rule(self.columns_name, self.counterfactuals_samples_local[idt][l], + self.counterfactuals_samples_sdp_local[idt][l], False, y_target[idt]) + print(' ') + print(' ') diff --git a/acv_explainers/cyext_acv/cyext_acv.cpp b/acv_explainers/cyext_acv/cyext_acv.cpp index 56cc3c1..4a18d9e 100644 --- a/acv_explainers/cyext_acv/cyext_acv.cpp +++ b/acv_explainers/cyext_acv/cyext_acv.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.28 */ +/* Generated by Cython 0.29.32 */ /* BEGIN: Cython Metadata { @@ -29,8 +29,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_28" -#define CYTHON_HEX_VERSION 0x001D1CF0 +#define CYTHON_ABI "0_29_32" +#define CYTHON_HEX_VERSION 0x001D20F0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -69,6 +69,7 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_PYTYPE_LOOKUP @@ -105,10 +106,14 @@ END: Cython Metadata */ #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900) + #endif #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 1 #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif @@ -146,10 +151,59 @@ END: Cython Metadata */ #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(PY_NOGIL) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_NOGIL 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #ifndef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 1 + #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif @@ -199,7 +253,7 @@ END: Cython Metadata */ #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030B00A1) + #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000) #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) @@ -216,6 +270,9 @@ END: Cython Metadata */ #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) #endif + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 + #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) @@ -681,8 +738,10 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { } __Pyx_PyAsyncMethodsStruct; #endif -#if defined(WIN32) || defined(MS_WINDOWS) - #define _USE_MATH_DEFINES +#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) + #if !defined(_USE_MATH_DEFINES) + #define _USE_MATH_DEFINES + #endif #endif #include #ifdef NAN @@ -1010,30 +1069,26 @@ typedef struct { #ifndef CYTHON_ATOMICS #define CYTHON_ATOMICS 1 #endif +#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS #define __pyx_atomic_int_type int -#if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\ - (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\ - !defined(__i386__) - #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1) - #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1) +#if CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\ + (__GNUC_MINOR__ > 1 ||\ + (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2)))) + #define __pyx_atomic_incr_aligned(value) __sync_fetch_and_add(value, 1) + #define __pyx_atomic_decr_aligned(value) __sync_fetch_and_sub(value, 1) #ifdef __PYX_DEBUG_ATOMICS #warning "Using GNU atomics" #endif -#elif CYTHON_ATOMICS && defined(_MSC_VER) && 0 - #include +#elif CYTHON_ATOMICS && defined(_MSC_VER) && CYTHON_COMPILING_IN_NOGIL + #include #undef __pyx_atomic_int_type - #define __pyx_atomic_int_type LONG - #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value) - #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value) + #define __pyx_atomic_int_type long + #pragma intrinsic (_InterlockedExchangeAdd) + #define __pyx_atomic_incr_aligned(value) _InterlockedExchangeAdd(value, 1) + #define __pyx_atomic_decr_aligned(value) _InterlockedExchangeAdd(value, -1) #ifdef __PYX_DEBUG_ATOMICS #pragma message ("Using MSVC atomics") #endif -#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0 - #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value) - #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value) - #ifdef __PYX_DEBUG_ATOMICS - #warning "Using Intel atomics" - #endif #else #undef CYTHON_ATOMICS #define CYTHON_ATOMICS 0 @@ -1044,9 +1099,9 @@ typedef struct { typedef volatile __pyx_atomic_int_type __pyx_atomic_int; #if CYTHON_ATOMICS #define __pyx_add_acquisition_count(memview)\ - __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) + __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview)) #define __pyx_sub_acquisition_count(memview)\ - __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) + __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview)) #else #define __pyx_add_acquisition_count(memview)\ __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) @@ -1096,7 +1151,7 @@ typedef struct { } __Pyx_BufFmt_Context; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":690 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":690 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -1105,7 +1160,7 @@ typedef struct { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":691 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":691 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -1114,7 +1169,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":692 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":692 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -1123,7 +1178,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":693 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":693 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -1132,7 +1187,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":697 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":697 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -1141,7 +1196,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":698 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":698 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -1150,7 +1205,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":699 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":699 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -1159,7 +1214,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":700 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":700 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -1168,7 +1223,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":704 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":704 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -1177,7 +1232,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":705 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":705 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -1186,7 +1241,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":714 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":714 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< @@ -1195,7 +1250,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":715 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":715 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< @@ -1204,7 +1259,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":716 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":716 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -1213,7 +1268,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":718 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":718 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -1222,7 +1277,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":719 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":719 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -1231,7 +1286,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":720 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":720 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -1240,7 +1295,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":722 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":722 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -1249,7 +1304,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":723 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":723 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -1258,7 +1313,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":725 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":725 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -1267,7 +1322,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":726 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":726 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -1276,7 +1331,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":727 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":727 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -1326,7 +1381,7 @@ struct __pyx_MemviewEnum_obj; struct __pyx_memoryview_obj; struct __pyx_memoryviewslice_obj; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":729 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":729 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -1335,7 +1390,7 @@ struct __pyx_memoryviewslice_obj; */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":730 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":730 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -1344,7 +1399,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":731 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":731 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -1353,7 +1408,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":733 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":733 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -1392,7 +1447,7 @@ struct __pyx_obj_9cyext_acv___pyx_scope_struct_1_genexpr { }; -/* "View.MemoryView":105 +/* "View.MemoryView":106 * * @cname("__pyx_array") * cdef class array: # <<<<<<<<<<<<<< @@ -1417,7 +1472,7 @@ struct __pyx_array_obj { }; -/* "View.MemoryView":279 +/* "View.MemoryView":280 * * @cname('__pyx_MemviewEnum') * cdef class Enum(object): # <<<<<<<<<<<<<< @@ -1430,7 +1485,7 @@ struct __pyx_MemviewEnum_obj { }; -/* "View.MemoryView":330 +/* "View.MemoryView":331 * * @cname('__pyx_memoryview') * cdef class memoryview(object): # <<<<<<<<<<<<<< @@ -1453,7 +1508,7 @@ struct __pyx_memoryview_obj { }; -/* "View.MemoryView":965 +/* "View.MemoryView":967 * * @cname('__pyx_memoryviewslice') * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< @@ -1470,7 +1525,7 @@ struct __pyx_memoryviewslice_obj { -/* "View.MemoryView":105 +/* "View.MemoryView":106 * * @cname("__pyx_array") * cdef class array: # <<<<<<<<<<<<<< @@ -1484,7 +1539,7 @@ struct __pyx_vtabstruct_array { static struct __pyx_vtabstruct_array *__pyx_vtabptr_array; -/* "View.MemoryView":330 +/* "View.MemoryView":331 * * @cname('__pyx_memoryview') * cdef class memoryview(object): # <<<<<<<<<<<<<< @@ -1504,7 +1559,7 @@ struct __pyx_vtabstruct_memoryview { static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview; -/* "View.MemoryView":965 +/* "View.MemoryView":967 * * @cname('__pyx_memoryviewslice') * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< @@ -1662,6 +1717,12 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, #if CYTHON_FAST_PYCALL static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" +#if PY_VERSION_HEX >= 0x030b00a6 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) @@ -1919,6 +1980,14 @@ static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v); static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, int wraparound, int boundscheck); +/* CallUnboundCMethod1.proto */ +static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); +#else +#define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) +#endif + /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); @@ -2310,6 +2379,9 @@ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_d /* ObjectToMemviewSlice.proto */ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsdsdsdsds_double(PyObject *, int writable_flag); +/* MemviewDtypeToObject.proto */ +static CYTHON_INLINE PyObject *__pyx_memview_get_double__const__(const char *itemp); + /* RealImag.proto */ #if CYTHON_CCOMPLEX #ifdef __cplusplus @@ -2639,14 +2711,14 @@ static double __pyx_f_9cyext_acv__comb_int_long(unsigned long, unsigned long, in static double __pyx_f_9cyext_acv_single_compute_sdp_rf_v0(__Pyx_memviewslice &, double &, __Pyx_memviewslice &, __Pyx_memviewslice &, std::vector &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, int &, int &, int &, double &); /*proto*/ static PyObject *__pyx_f_9cyext_acv_compute_sdp_rf_v0(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, std::vector , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, double &, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_9cyext_acv_global_sdp_rf_v0(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, double &, PyObject *, double, int, int, PyObject *, int __pyx_skip_dispatch); /*proto*/ -static double __pyx_f_9cyext_acv_single_compute_exp_rf(__Pyx_memviewslice &, double &, __Pyx_memviewslice &, __Pyx_memviewslice &, std::vector &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, int &, int &, int &, double &); /*proto*/ -static PyObject *__pyx_f_9cyext_acv_compute_exp_rf(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, std::vector > , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, double &, int __pyx_skip_dispatch); /*proto*/ +static double __pyx_f_9cyext_acv_single_compute_exp_rf(__Pyx_memviewslice &, double &, __Pyx_memviewslice &, __Pyx_memviewslice &, std::vector &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, int &, int &, int &, __Pyx_memviewslice &); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_exp_rf(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, std::vector > , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, __Pyx_memviewslice &, int __pyx_skip_dispatch); /*proto*/ static double __pyx_f_9cyext_acv_single_compute_quantile_rf(__Pyx_memviewslice &, double &, __Pyx_memviewslice &, __Pyx_memviewslice &, std::vector &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, int &, int &, int &, double &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, double &); /*proto*/ static PyObject *__pyx_f_9cyext_acv_compute_quantile_rf(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, std::vector > , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, double &, double &, int __pyx_skip_dispatch); /*proto*/ static double __pyx_f_9cyext_acv_single_compute_quantile_diff_rf(__Pyx_memviewslice &, double &, __Pyx_memviewslice &, __Pyx_memviewslice &, std::vector &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, int &, int &, int &, double &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, double &); /*proto*/ static PyObject *__pyx_f_9cyext_acv_compute_quantile_diff_rf(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, std::vector > , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, double &, double &, int __pyx_skip_dispatch); /*proto*/ static double __pyx_f_9cyext_acv_single_compute_cdf_rf(__Pyx_memviewslice &, double &, __Pyx_memviewslice &, __Pyx_memviewslice &, std::vector &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, int &, int &, int &, double &); /*proto*/ -static PyObject *__pyx_f_9cyext_acv_compute_cdf_rf(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, std::vector > , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, double &, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_cdf_rf(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, std::vector > , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, __Pyx_memviewslice &, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_9cyext_acv_sufficient_expl_rf_v0(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, double &, PyObject *, double, int, int, PyObject *, int __pyx_skip_dispatch); /*proto*/ static double __pyx_f_9cyext_acv_single_compute_sdp_rule_v0(__Pyx_memviewslice &, double &, __Pyx_memviewslice &, __Pyx_memviewslice &, std::vector &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, int &, int &, int &, double &, __Pyx_memviewslice &); /*proto*/ static PyObject *__pyx_f_9cyext_acv_compute_sdp_rule_v0(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, std::vector > , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, double &, int __pyx_skip_dispatch); /*proto*/ @@ -2658,16 +2730,47 @@ static PyObject *__pyx_f_9cyext_acv_compute_sdp_maxrule_biased(__Pyx_memviewslic static double __pyx_f_9cyext_acv_single_compute_sdp_rule_v0_weights(__Pyx_memviewslice &, double &, __Pyx_memviewslice &, __Pyx_memviewslice &, std::vector &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, int &, int &, int &, double &, __Pyx_memviewslice &, __Pyx_memviewslice &); /*proto*/ static PyObject *__pyx_f_9cyext_acv_compute_sdp_maxrule_opti(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, std::vector > , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, double &, double &, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_9cyext_acv_compute_sdp_maxrule_biased_v2(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, std::vector > , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, double &, double &, int __pyx_skip_dispatch); /*proto*/ -static double __pyx_f_9cyext_acv_single_compute_sdp_rule(__Pyx_memviewslice &, double &, __Pyx_memviewslice &, __Pyx_memviewslice &, std::vector &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, int &, int &, int &, double &, __Pyx_memviewslice &); /*proto*/ -static PyObject *__pyx_f_9cyext_acv_compute_sdp_rule(__Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, std::vector > &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, int &, int &, int &, double &, int __pyx_skip_dispatch); /*proto*/ -static double __pyx_f_9cyext_acv_single_compute_sdp_rule_weights(__Pyx_memviewslice &, double &, __Pyx_memviewslice &, __Pyx_memviewslice &, std::vector &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, int &, int &, int &, double &, __Pyx_memviewslice &, __Pyx_memviewslice &); /*proto*/ -static PyObject *__pyx_f_9cyext_acv_compute_sdp_maxrule(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, std::vector > , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, double &, double &, int __pyx_skip_dispatch); /*proto*/ -static PyObject *__pyx_f_9cyext_acv_compute_sdp_maxrule_verbose(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, std::vector > , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, double &, double &, int __pyx_skip_dispatch); /*proto*/ -static double __pyx_f_9cyext_acv_single_compute_sdp_rf(__Pyx_memviewslice &, double &, __Pyx_memviewslice &, __Pyx_memviewslice &, std::vector &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, int &, int &, int &, double &); /*proto*/ -static PyObject *__pyx_f_9cyext_acv_compute_sdp_rf(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, std::vector > , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, double &, int __pyx_skip_dispatch); /*proto*/ -static PyObject *__pyx_f_9cyext_acv_compute_sdp_rf_same_set(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, std::vector , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, double &, int __pyx_skip_dispatch); /*proto*/ -static PyObject *__pyx_f_9cyext_acv_global_sdp_rf(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, double &, PyObject *, double, int, int, PyObject *, int __pyx_skip_dispatch); /*proto*/ -static PyObject *__pyx_f_9cyext_acv_sufficient_expl_rf(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, double &, PyObject *, double, int, int, PyObject *, int __pyx_skip_dispatch); /*proto*/ +static double __pyx_f_9cyext_acv_single_compute_sdp_rule(__Pyx_memviewslice &, double &, __Pyx_memviewslice &, __Pyx_memviewslice &, std::vector &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, int &, int &, int &, __Pyx_memviewslice &, __Pyx_memviewslice &); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_sdp_rule(__Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, std::vector > &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, int &, int &, int &, __Pyx_memviewslice &, int __pyx_skip_dispatch); /*proto*/ +static double __pyx_f_9cyext_acv_single_compute_sdp_rule_weights(__Pyx_memviewslice &, double &, __Pyx_memviewslice &, __Pyx_memviewslice &, std::vector &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, int &, int &, int &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_sdp_maxrule(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, std::vector > , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, __Pyx_memviewslice &, double &, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_sdp_maxrule_verbose(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, std::vector > , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, __Pyx_memviewslice &, double &, int __pyx_skip_dispatch); /*proto*/ +static double __pyx_f_9cyext_acv_single_compute_ddp_rule(__Pyx_memviewslice &, double &, __Pyx_memviewslice &, __Pyx_memviewslice &, std::vector &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, int &, int &, int &, __Pyx_memviewslice &, __Pyx_memviewslice &); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_ddp_rule(__Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, std::vector > &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, int &, int &, int &, __Pyx_memviewslice &, int __pyx_skip_dispatch); /*proto*/ +static double __pyx_f_9cyext_acv_single_compute_ddp_rule_weights(__Pyx_memviewslice &, double &, __Pyx_memviewslice &, __Pyx_memviewslice &, std::vector &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, int &, int &, int &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_ddp_weights(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, std::vector > , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, __Pyx_memviewslice &, double &, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_ddp_weights_verbose(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, std::vector > , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, __Pyx_memviewslice &, double &, int __pyx_skip_dispatch); /*proto*/ +static double __pyx_f_9cyext_acv_single_compute_ddp_cond_rule_weights(__Pyx_memviewslice &, double &, __Pyx_memviewslice &, __Pyx_memviewslice &, std::vector &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, int &, int &, int &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_ddp_cond_weights(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, std::vector > , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice &, int, int, int &, __Pyx_memviewslice &, double &, int __pyx_skip_dispatch); /*proto*/ +static double __pyx_f_9cyext_acv_single_compute_sdp_rf(__Pyx_memviewslice &, double &, __Pyx_memviewslice &, __Pyx_memviewslice &, std::vector &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, int &, int &, int &, __Pyx_memviewslice &); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_sdp_rf(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, std::vector > , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, __Pyx_memviewslice &, int __pyx_skip_dispatch); /*proto*/ +static double __pyx_f_9cyext_acv_single_compute_ddp_rf(__Pyx_memviewslice &, double &, __Pyx_memviewslice &, __Pyx_memviewslice &, std::vector &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, int &, int &, int &, __Pyx_memviewslice &); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_ddp_rf(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, std::vector > , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, __Pyx_memviewslice &, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_ddp_rf_same_set(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, std::vector , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, __Pyx_memviewslice &, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_global_ddp_rf(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, __Pyx_memviewslice &, PyObject *, double, int, int, PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_sdp_rf_same_set(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, std::vector , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, __Pyx_memviewslice &, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_global_sdp_rf(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, __Pyx_memviewslice &, PyObject *, double, int, int, PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_sufficient_expl_rf(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, __Pyx_memviewslice &, PyObject *, double, int, int, PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_sufficient_cxpl_rf(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, __Pyx_memviewslice &, PyObject *, double, int, int, PyObject *, int __pyx_skip_dispatch); /*proto*/ +static double __pyx_f_9cyext_acv_single_compute_ddp_intv_rule_weights(__Pyx_memviewslice &, double &, __Pyx_memviewslice &, __Pyx_memviewslice &, std::vector &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, int &, int &, int &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_ddp_intv_weights(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, std::vector > , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice &, int, int, int &, __Pyx_memviewslice &, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_ddp_intv_same_set(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, std::vector , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice &, int, int, int &, __Pyx_memviewslice &, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_global_ddp_intv(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice &, int, int, int &, __Pyx_memviewslice &, PyObject *, double, int, int, PyObject *, int __pyx_skip_dispatch); /*proto*/ +static double __pyx_f_9cyext_acv_single_compute_cdp_rule(__Pyx_memviewslice &, double &, double &, double &, __Pyx_memviewslice &, __Pyx_memviewslice &, std::vector &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, int &, int &, int &, __Pyx_memviewslice &, __Pyx_memviewslice &); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_cdp_rule(__Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice &, __Pyx_memviewslice &, std::vector > &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, int &, int &, int &, __Pyx_memviewslice &, int __pyx_skip_dispatch); /*proto*/ +static double __pyx_f_9cyext_acv_single_compute_cdp_cond_rule_weights(__Pyx_memviewslice &, double &, double &, double &, __Pyx_memviewslice &, __Pyx_memviewslice &, std::vector &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, int &, int &, int &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_cdp_cond_weights(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, std::vector > , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice &, int, int, int &, __Pyx_memviewslice &, double &, int __pyx_skip_dispatch); /*proto*/ +static double __pyx_f_9cyext_acv_single_compute_cdp_rf(__Pyx_memviewslice &, double &, double &, double &, __Pyx_memviewslice &, __Pyx_memviewslice &, std::vector &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, int &, int &, int &, __Pyx_memviewslice &); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_cdp_rf(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, std::vector > , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, __Pyx_memviewslice &, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_cdp_rf_same_set(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, std::vector , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, __Pyx_memviewslice &, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_global_cdp_rf(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, __Pyx_memviewslice &, PyObject *, double, int, int, PyObject *, int __pyx_skip_dispatch); /*proto*/ +static double __pyx_f_9cyext_acv_single_compute_cdp_rule_weights(__Pyx_memviewslice &, double &, double &, double &, __Pyx_memviewslice &, __Pyx_memviewslice &, std::vector &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, int &, int &, int &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_cdp_weights(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, std::vector > , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, __Pyx_memviewslice &, double &, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_cdp_weights_verbose(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, std::vector > , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int &, __Pyx_memviewslice &, double &, int __pyx_skip_dispatch); /*proto*/ +static double __pyx_f_9cyext_acv_single_compute_cdp_intv_rule_weights(__Pyx_memviewslice &, double &, __Pyx_memviewslice &, __Pyx_memviewslice &, std::vector &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, int &, int &, int &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &, __Pyx_memviewslice &); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_cdp_intv_weights(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, std::vector > , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice &, int, int, int &, __Pyx_memviewslice &, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_cdp_intv_same_set(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, std::vector , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice &, int, int, int &, __Pyx_memviewslice &, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_global_cdp_intv(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice &, int, int, int &, __Pyx_memviewslice &, PyObject *, double, int, int, PyObject *, int __pyx_skip_dispatch); /*proto*/ static std::vector __pyx_convert_vector_from_py_long(PyObject *); /*proto*/ static std::vector > __pyx_convert_vector_from_py_std_3a__3a_vector_3c_long_3e___(PyObject *); /*proto*/ static std::vector > > __pyx_convert_vector_from_py_std_3a__3a_vector_3c_std_3a__3a_vector_3c_long_3e____3e___(PyObject *); /*proto*/ @@ -2743,11 +2846,13 @@ static const char __pyx_k_c[] = "c"; static const char __pyx_k_k[] = "k"; static const char __pyx_k_s[] = "s"; static const char __pyx_k_t[] = "t"; +static const char __pyx_k_UP[] = "UP"; static const char __pyx_k_fX[] = "fX"; static const char __pyx_k_id[] = "id"; static const char __pyx_k_np[] = "np"; static const char __pyx_k_pi[] = "pi"; static const char __pyx_k_tX[] = "tX"; +static const char __pyx_k_up[] = "up"; static const char __pyx_k_int[] = "int"; static const char __pyx_k_max[] = "max"; static const char __pyx_k_min[] = "min"; @@ -2755,13 +2860,16 @@ static const char __pyx_k_new[] = "__new__"; static const char __pyx_k_obj[] = "obj"; static const char __pyx_k_sum[] = "sum"; static const char __pyx_k_y_X[] = "y_X"; +static const char __pyx_k_DOWN[] = "DOWN"; static const char __pyx_k_args[] = "args"; static const char __pyx_k_axis[] = "axis"; static const char __pyx_k_base[] = "base"; static const char __pyx_k_comb[] = "comb"; +static const char __pyx_k_cond[] = "cond"; static const char __pyx_k_copy[] = "copy"; static const char __pyx_k_data[] = "data"; static const char __pyx_k_dict[] = "__dict__"; +static const char __pyx_k_down[] = "down"; static const char __pyx_k_long[] = "long"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_mode[] = "mode"; @@ -2889,7 +2997,7 @@ static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview"; static const char __pyx_k_Check_condition_in_the_computati[] = "Check condition in the computation of SDP"; static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; -static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))"; +static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))"; static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported"; static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s"; static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)"; @@ -2907,10 +3015,11 @@ static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor; static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi; static PyObject *__pyx_kp_s_Cannot_index_with_type_s; static PyObject *__pyx_kp_s_Check_condition_in_the_computati; +static PyObject *__pyx_n_s_DOWN; static PyObject *__pyx_n_s_Ellipsis; static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr; static PyObject *__pyx_n_s_ImportError; -static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0; +static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0; static PyObject *__pyx_n_s_IndexError; static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte; static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr; @@ -2926,6 +3035,7 @@ static PyObject *__pyx_n_s_PickleError; static PyObject *__pyx_n_s_S; static PyObject *__pyx_n_s_S_star; static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_n_s_UP; static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_n_s_View_MemoryView; @@ -2953,6 +3063,7 @@ static PyObject *__pyx_n_s_close; static PyObject *__pyx_n_s_comb; static PyObject *__pyx_n_s_combinations; static PyObject *__pyx_n_s_concatenate; +static PyObject *__pyx_n_s_cond; static PyObject *__pyx_kp_s_contiguous_and_direct; static PyObject *__pyx_kp_s_contiguous_and_indirect; static PyObject *__pyx_n_s_copy; @@ -2960,6 +3071,7 @@ static PyObject *__pyx_n_s_cyext_acv; static PyObject *__pyx_n_s_data; static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_double; +static PyObject *__pyx_n_s_down; static PyObject *__pyx_n_s_dtype; static PyObject *__pyx_n_s_dtype_is_object; static PyObject *__pyx_n_s_empty; @@ -3059,6 +3171,7 @@ static PyObject *__pyx_n_s_tqdm; static PyObject *__pyx_kp_s_unable_to_allocate_array_data; static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str; static PyObject *__pyx_n_s_unpack; +static PyObject *__pyx_n_s_up; static PyObject *__pyx_n_s_update; static PyObject *__pyx_n_s_values; static PyObject *__pyx_n_s_weighted_percentile; @@ -3093,10 +3206,10 @@ static PyObject *__pyx_pf_9cyext_acv_44binomialC(CYTHON_UNUSED PyObject *__pyx_s static PyObject *__pyx_pf_9cyext_acv_46_comb_int_long(CYTHON_UNUSED PyObject *__pyx_self, unsigned long __pyx_v_N, unsigned long __pyx_v_k); /* proto */ static PyObject *__pyx_pf_9cyext_acv_48compute_sdp_rf_v0(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, double __pyx_v_t); /* proto */ static PyObject *__pyx_pf_9cyext_acv_50global_sdp_rf_v0(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, double __pyx_v_t, PyObject *__pyx_v_C, double __pyx_v_pi_level, int __pyx_v_minimal, int __pyx_v_stop, PyObject *__pyx_v_search_space); /* proto */ -static PyObject *__pyx_pf_9cyext_acv_52compute_exp_rf(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, double __pyx_v_t); /* proto */ +static PyObject *__pyx_pf_9cyext_acv_52compute_exp_rf(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t); /* proto */ static PyObject *__pyx_pf_9cyext_acv_54compute_quantile_rf(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, double __pyx_v_t, double __pyx_v_quantile); /* proto */ static PyObject *__pyx_pf_9cyext_acv_56compute_quantile_diff_rf(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, double __pyx_v_t, double __pyx_v_quantile); /* proto */ -static PyObject *__pyx_pf_9cyext_acv_58compute_cdf_rf(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, double __pyx_v_t); /* proto */ +static PyObject *__pyx_pf_9cyext_acv_58compute_cdf_rf(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t); /* proto */ static PyObject *__pyx_pf_9cyext_acv_60sufficient_expl_rf_v0(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, double __pyx_v_t, PyObject *__pyx_v_C, double __pyx_v_pi_level, int __pyx_v_minimal, int __pyx_v_stop, PyObject *__pyx_v_search_space); /* proto */ static PyObject *__pyx_pf_9cyext_acv_62compute_sdp_rule_v0(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, double __pyx_v_t); /* proto */ static PyObject *__pyx_pf_9cyext_acv_64compute_sdp_maxrule_v0(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, double __pyx_v_t, double __pyx_v_pi); /* proto */ @@ -3105,13 +3218,34 @@ static PyObject *__pyx_pf_9cyext_acv_68compute_sdp_rule_biased(CYTHON_UNUSED PyO static PyObject *__pyx_pf_9cyext_acv_70compute_sdp_maxrule_biased(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, double __pyx_v_t, double __pyx_v_pi); /* proto */ static PyObject *__pyx_pf_9cyext_acv_72compute_sdp_maxrule_opti(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, double __pyx_v_t, double __pyx_v_pi); /* proto */ static PyObject *__pyx_pf_9cyext_acv_74compute_sdp_maxrule_biased_v2(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, double __pyx_v_t, double __pyx_v_pi); /* proto */ -static PyObject *__pyx_pf_9cyext_acv_76compute_sdp_rule(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, double __pyx_v_t); /* proto */ -static PyObject *__pyx_pf_9cyext_acv_78compute_sdp_maxrule(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, double __pyx_v_t, double __pyx_v_pi); /* proto */ -static PyObject *__pyx_pf_9cyext_acv_80compute_sdp_maxrule_verbose(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, double __pyx_v_t, double __pyx_v_pi); /* proto */ -static PyObject *__pyx_pf_9cyext_acv_82compute_sdp_rf(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, double __pyx_v_t); /* proto */ -static PyObject *__pyx_pf_9cyext_acv_84compute_sdp_rf_same_set(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, double __pyx_v_t); /* proto */ -static PyObject *__pyx_pf_9cyext_acv_86global_sdp_rf(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, double __pyx_v_t, PyObject *__pyx_v_C, double __pyx_v_pi_level, int __pyx_v_minimal, int __pyx_v_stop, PyObject *__pyx_v_search_space); /* proto */ -static PyObject *__pyx_pf_9cyext_acv_88sufficient_expl_rf(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, double __pyx_v_t, PyObject *__pyx_v_C, double __pyx_v_pi_level, int __pyx_v_minimal, int __pyx_v_stop, PyObject *__pyx_v_search_space); /* proto */ +static PyObject *__pyx_pf_9cyext_acv_76compute_sdp_rule(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t); /* proto */ +static PyObject *__pyx_pf_9cyext_acv_78compute_sdp_maxrule(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t, double __pyx_v_pi); /* proto */ +static PyObject *__pyx_pf_9cyext_acv_80compute_sdp_maxrule_verbose(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t, double __pyx_v_pi); /* proto */ +static PyObject *__pyx_pf_9cyext_acv_82compute_ddp_rule(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t); /* proto */ +static PyObject *__pyx_pf_9cyext_acv_84compute_ddp_weights(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t, double __pyx_v_pi); /* proto */ +static PyObject *__pyx_pf_9cyext_acv_86compute_ddp_weights_verbose(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t, double __pyx_v_pi); /* proto */ +static PyObject *__pyx_pf_9cyext_acv_88compute_ddp_cond_weights(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, __Pyx_memviewslice __pyx_v_cond, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t, double __pyx_v_pi); /* proto */ +static PyObject *__pyx_pf_9cyext_acv_90compute_sdp_rf(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t); /* proto */ +static PyObject *__pyx_pf_9cyext_acv_92compute_ddp_rf(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t); /* proto */ +static PyObject *__pyx_pf_9cyext_acv_94compute_ddp_rf_same_set(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t); /* proto */ +static PyObject *__pyx_pf_9cyext_acv_96global_ddp_rf(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t, PyObject *__pyx_v_C, double __pyx_v_pi_level, int __pyx_v_minimal, int __pyx_v_stop, PyObject *__pyx_v_search_space); /* proto */ +static PyObject *__pyx_pf_9cyext_acv_98compute_sdp_rf_same_set(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t); /* proto */ +static PyObject *__pyx_pf_9cyext_acv_100global_sdp_rf(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t, PyObject *__pyx_v_C, double __pyx_v_pi_level, int __pyx_v_minimal, int __pyx_v_stop, PyObject *__pyx_v_search_space); /* proto */ +static PyObject *__pyx_pf_9cyext_acv_102sufficient_expl_rf(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t, PyObject *__pyx_v_C, double __pyx_v_pi_level, int __pyx_v_minimal, int __pyx_v_stop, PyObject *__pyx_v_search_space); /* proto */ +static PyObject *__pyx_pf_9cyext_acv_104sufficient_cxpl_rf(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t, PyObject *__pyx_v_C, double __pyx_v_pi_level, int __pyx_v_minimal, int __pyx_v_stop, PyObject *__pyx_v_search_space); /* proto */ +static PyObject *__pyx_pf_9cyext_acv_106compute_ddp_intv_weights(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, __Pyx_memviewslice __pyx_v_cond, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t); /* proto */ +static PyObject *__pyx_pf_9cyext_acv_108compute_ddp_intv_same_set(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, __Pyx_memviewslice __pyx_v_cond, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t); /* proto */ +static PyObject *__pyx_pf_9cyext_acv_110global_ddp_intv(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, __Pyx_memviewslice __pyx_v_cond, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t, PyObject *__pyx_v_C, double __pyx_v_pi_level, int __pyx_v_minimal, int __pyx_v_stop, PyObject *__pyx_v_search_space); /* proto */ +static PyObject *__pyx_pf_9cyext_acv_112compute_cdp_rule(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_down, __Pyx_memviewslice __pyx_v_up, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t); /* proto */ +static PyObject *__pyx_pf_9cyext_acv_114compute_cdp_cond_weights(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_down, __Pyx_memviewslice __pyx_v_up, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, __Pyx_memviewslice __pyx_v_cond, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t, double __pyx_v_pi); /* proto */ +static PyObject *__pyx_pf_9cyext_acv_116compute_cdp_rf(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_down, __Pyx_memviewslice __pyx_v_up, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t); /* proto */ +static PyObject *__pyx_pf_9cyext_acv_118compute_cdp_rf_same_set(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_down, __Pyx_memviewslice __pyx_v_up, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t); /* proto */ +static PyObject *__pyx_pf_9cyext_acv_120global_cdp_rf(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_DOWN, __Pyx_memviewslice __pyx_v_UP, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t, PyObject *__pyx_v_C, double __pyx_v_pi_level, int __pyx_v_minimal, int __pyx_v_stop, PyObject *__pyx_v_search_space); /* proto */ +static PyObject *__pyx_pf_9cyext_acv_122compute_cdp_weights(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_down, __Pyx_memviewslice __pyx_v_up, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t, double __pyx_v_pi); /* proto */ +static PyObject *__pyx_pf_9cyext_acv_124compute_cdp_weights_verbose(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_down, __Pyx_memviewslice __pyx_v_up, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t, double __pyx_v_pi); /* proto */ +static PyObject *__pyx_pf_9cyext_acv_126compute_cdp_intv_weights(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, __Pyx_memviewslice __pyx_v_cond, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t); /* proto */ +static PyObject *__pyx_pf_9cyext_acv_128compute_cdp_intv_same_set(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, __Pyx_memviewslice __pyx_v_cond, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t); /* proto */ +static PyObject *__pyx_pf_9cyext_acv_130global_cdp_intv(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, __Pyx_memviewslice __pyx_v_cond, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t, PyObject *__pyx_v_C, double __pyx_v_pi_level, int __pyx_v_minimal, int __pyx_v_stop, PyObject *__pyx_v_search_space); /* proto */ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */ @@ -3161,12 +3295,15 @@ static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); / static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static __Pyx_CachedCFunction __pyx_umethod_PyList_Type_copy = {0, &__pyx_n_s_copy, 0, 0, 0}; +static __Pyx_CachedCFunction __pyx_umethod_PyList_Type_remove = {0, &__pyx_n_s_remove, 0, 0, 0}; static PyObject *__pyx_float_1e_10; static PyObject *__pyx_float_neg_1e_10; static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_2; static PyObject *__pyx_int_3; +static PyObject *__pyx_int_112105877; +static PyObject *__pyx_int_136983863; static PyObject *__pyx_int_184977713; static PyObject *__pyx_int_neg_1; static PyObject *__pyx_tuple_; @@ -3195,14 +3332,15 @@ static PyObject *__pyx_tuple__23; static PyObject *__pyx_tuple__24; static PyObject *__pyx_tuple__25; static PyObject *__pyx_tuple__26; -static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__27; static PyObject *__pyx_tuple__29; static PyObject *__pyx_tuple__30; static PyObject *__pyx_tuple__31; static PyObject *__pyx_tuple__32; static PyObject *__pyx_tuple__33; -static PyObject *__pyx_codeobj__27; -static PyObject *__pyx_codeobj__34; +static PyObject *__pyx_tuple__34; +static PyObject *__pyx_codeobj__28; +static PyObject *__pyx_codeobj__35; /* Late includes */ /* "cyext_acv.pyx":32 @@ -63922,10 +64060,10 @@ static PyObject *__pyx_pf_9cyext_acv_50global_sdp_rf_v0(CYTHON_UNUSED PyObject * * @cython.cdivision(True) * cdef double single_compute_exp_rf(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, # <<<<<<<<<<<<<< * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, - * int & max_depth, int & min_node_size, int & classifier, double & t) nogil: + * int & max_depth, int & min_node_size, int & classifier, double[:] & t) nogil: */ -static double __pyx_f_9cyext_acv_single_compute_exp_rf(__Pyx_memviewslice &__pyx_v_x, CYTHON_UNUSED double &__pyx_v_y_x, __Pyx_memviewslice &__pyx_v_data, __Pyx_memviewslice &__pyx_v_y_data, std::vector &__pyx_v_S, __Pyx_memviewslice &__pyx_v_features, __Pyx_memviewslice &__pyx_v_thresholds, __Pyx_memviewslice &__pyx_v_children_left, __Pyx_memviewslice &__pyx_v_children_right, int &__pyx_v_max_depth, int &__pyx_v_min_node_size, int &__pyx_v_classifier, CYTHON_UNUSED double &__pyx_v_t) { +static double __pyx_f_9cyext_acv_single_compute_exp_rf(__Pyx_memviewslice &__pyx_v_x, CYTHON_UNUSED double &__pyx_v_y_x, __Pyx_memviewslice &__pyx_v_data, __Pyx_memviewslice &__pyx_v_y_data, std::vector &__pyx_v_S, __Pyx_memviewslice &__pyx_v_features, __Pyx_memviewslice &__pyx_v_thresholds, __Pyx_memviewslice &__pyx_v_children_left, __Pyx_memviewslice &__pyx_v_children_right, int &__pyx_v_max_depth, int &__pyx_v_min_node_size, int &__pyx_v_classifier, CYTHON_UNUSED __Pyx_memviewslice &__pyx_v_t) { unsigned int __pyx_v_n_trees; unsigned int __pyx_v_N; double __pyx_v_sdp; @@ -63960,7 +64098,7 @@ static double __pyx_f_9cyext_acv_single_compute_exp_rf(__Pyx_memviewslice &__pyx int __pyx_clineno = 0; /* "cyext_acv.pyx":4246 - * int & max_depth, int & min_node_size, int & classifier, double & t) nogil: + * int & max_depth, int & min_node_size, int & classifier, double[:] & t) nogil: * * cdef unsigned int n_trees = features.shape[0] # <<<<<<<<<<<<<< * cdef unsigned int N = data.shape[0] @@ -64603,7 +64741,7 @@ static double __pyx_f_9cyext_acv_single_compute_exp_rf(__Pyx_memviewslice &__pyx * @cython.cdivision(True) * cdef double single_compute_exp_rf(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, # <<<<<<<<<<<<<< * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, - * int & max_depth, int & min_node_size, int & classifier, double & t) nogil: + * int & max_depth, int & min_node_size, int & classifier, double[:] & t) nogil: */ /* function exit code */ @@ -64619,11 +64757,11 @@ static double __pyx_f_9cyext_acv_single_compute_exp_rf(__Pyx_memviewslice &__pyx * @cython.cdivision(True) * cpdef compute_exp_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, # <<<<<<<<<<<<<< * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, - * int max_depth, int min_node_size, int & classifier, double & t): + * int max_depth, int min_node_size, int & classifier, double[:, :] & t): */ static PyObject *__pyx_pw_9cyext_acv_53compute_exp_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_f_9cyext_acv_compute_exp_rf(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, double &__pyx_v_t, CYTHON_UNUSED int __pyx_skip_dispatch) { +static PyObject *__pyx_f_9cyext_acv_compute_exp_rf(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, CYTHON_UNUSED int __pyx_skip_dispatch) { int __pyx_v_N; __Pyx_memviewslice __pyx_v_sdp = { 0, 0, { 0 }, { 0 }, { 0 } }; int __pyx_v_i; @@ -64639,14 +64777,15 @@ static PyObject *__pyx_f_9cyext_acv_compute_exp_rf(__Pyx_memviewslice __pyx_v_X, int __pyx_t_8; __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } }; Py_ssize_t __pyx_t_10; - Py_ssize_t __pyx_t_11; + __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("compute_exp_rf", 0); /* "cyext_acv.pyx":4322 - * int max_depth, int min_node_size, int & classifier, double & t): + * int max_depth, int min_node_size, int & classifier, double[:, :] & t): * * cdef int N = X.shape[0] # <<<<<<<<<<<<<< * cdef double[::1] sdp = np.zeros(N) @@ -64717,7 +64856,7 @@ static PyObject *__pyx_f_9cyext_acv_compute_exp_rf(__Pyx_memviewslice __pyx_v_X, if (__pyx_t_8 > 0) { #ifdef _OPENMP - #pragma omp parallel private(__pyx_t_10, __pyx_t_11) firstprivate(__pyx_t_9) + #pragma omp parallel private(__pyx_t_10, __pyx_t_12) firstprivate(__pyx_t_11, __pyx_t_9) #endif /* _OPENMP */ { #ifdef _OPENMP @@ -64732,7 +64871,7 @@ static PyObject *__pyx_f_9cyext_acv_compute_exp_rf(__Pyx_memviewslice __pyx_v_X, * for i in prange(N, nogil=True, schedule='dynamic'): * sdp[i] = single_compute_exp_rf(X[i], y_X[i], data, y_data, S[i], # <<<<<<<<<<<<<< * features, thresholds, children_left, children_right, - * max_depth, min_node_size, classifier, t) + * max_depth, min_node_size, classifier, t[i]) */ __pyx_t_9.data = __pyx_v_X.data; __pyx_t_9.memview = __pyx_v_X.memview; @@ -64752,15 +64891,39 @@ __pyx_t_10 = __pyx_v_i; /* "cyext_acv.pyx":4328 * sdp[i] = single_compute_exp_rf(X[i], y_X[i], data, y_data, S[i], * features, thresholds, children_left, children_right, - * max_depth, min_node_size, classifier, t) # <<<<<<<<<<<<<< + * max_depth, min_node_size, classifier, t[i]) # <<<<<<<<<<<<<< * return np.array(sdp) * */ - __pyx_t_11 = __pyx_v_i; - *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_sdp.data) + __pyx_t_11)) )) = __pyx_f_9cyext_acv_single_compute_exp_rf(__pyx_t_9, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_10)) ))), __pyx_v_data, __pyx_v_y_data, (__pyx_v_S[__pyx_v_i]), __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t); + __pyx_t_11.data = __pyx_v_t.data; + __pyx_t_11.memview = __pyx_v_t.memview; + __PYX_INC_MEMVIEW(&__pyx_t_11, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_t.strides[0]; + __pyx_t_11.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_11.shape[0] = __pyx_v_t.shape[1]; +__pyx_t_11.strides[0] = __pyx_v_t.strides[1]; + __pyx_t_11.suboffsets[0] = -1; + +__pyx_t_12 = __pyx_v_i; + + /* "cyext_acv.pyx":4326 + * cdef int i + * for i in prange(N, nogil=True, schedule='dynamic'): + * sdp[i] = single_compute_exp_rf(X[i], y_X[i], data, y_data, S[i], # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i]) + */ + *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_sdp.data) + __pyx_t_12)) )) = __pyx_f_9cyext_acv_single_compute_exp_rf(__pyx_t_9, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_10)) ))), __pyx_v_data, __pyx_v_y_data, (__pyx_v_S[__pyx_v_i]), __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_t_11); __PYX_XDEC_MEMVIEW(&__pyx_t_9, 0); __pyx_t_9.memview = NULL; __pyx_t_9.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_11, 0); + __pyx_t_11.memview = NULL; + __pyx_t_11.data = NULL; } } } @@ -64795,7 +64958,7 @@ __pyx_t_10 = __pyx_v_i; /* "cyext_acv.pyx":4329 * features, thresholds, children_left, children_right, - * max_depth, min_node_size, classifier, t) + * max_depth, min_node_size, classifier, t[i]) * return np.array(sdp) # <<<<<<<<<<<<<< * * @cython.boundscheck(False) @@ -64833,7 +64996,7 @@ __pyx_t_10 = __pyx_v_i; * @cython.cdivision(True) * cpdef compute_exp_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, # <<<<<<<<<<<<<< * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, - * int max_depth, int min_node_size, int & classifier, double & t): + * int max_depth, int min_node_size, int & classifier, double[:, :] & t): */ /* function exit code */ @@ -64844,6 +65007,7 @@ __pyx_t_10 = __pyx_v_i; __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1); __Pyx_AddTraceback("cyext_acv.compute_exp_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; @@ -64868,7 +65032,7 @@ static PyObject *__pyx_pw_9cyext_acv_53compute_exp_rf(PyObject *__pyx_self, PyOb int __pyx_v_max_depth; int __pyx_v_min_node_size; int __pyx_v_classifier; - double __pyx_v_t; + __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } }; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -65021,7 +65185,7 @@ static PyObject *__pyx_pw_9cyext_acv_53compute_exp_rf(PyObject *__pyx_self, PyOb __pyx_v_max_depth = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4320, __pyx_L3_error) __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4320, __pyx_L3_error) __pyx_v_classifier = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4320, __pyx_L3_error) - __pyx_v_t = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4320, __pyx_L3_error) + __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[12], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 4320, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; @@ -65038,7 +65202,7 @@ static PyObject *__pyx_pw_9cyext_acv_53compute_exp_rf(PyObject *__pyx_self, PyOb return __pyx_r; } -static PyObject *__pyx_pf_9cyext_acv_52compute_exp_rf(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, double __pyx_v_t) { +static PyObject *__pyx_pf_9cyext_acv_52compute_exp_rf(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -65055,6 +65219,7 @@ static PyObject *__pyx_pf_9cyext_acv_52compute_exp_rf(CYTHON_UNUSED PyObject *__ if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 4318, __pyx_L1_error) } if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 4318, __pyx_L1_error) } if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 4318, __pyx_L1_error) } + if (unlikely(!__pyx_v_t.memview)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 4318, __pyx_L1_error) } __pyx_t_1 = __pyx_f_9cyext_acv_compute_exp_rf(__pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; @@ -65075,6 +65240,7 @@ static PyObject *__pyx_pf_9cyext_acv_52compute_exp_rf(CYTHON_UNUSED PyObject *__ __PYX_XDEC_MEMVIEW(&__pyx_v_thresholds, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_children_left, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_children_right, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_t, 1); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -68402,11 +68568,11 @@ static double __pyx_f_9cyext_acv_single_compute_cdf_rf(__Pyx_memviewslice &__pyx * @cython.cdivision(True) * cpdef compute_cdf_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, # <<<<<<<<<<<<<< * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, - * int max_depth, int min_node_size, int & classifier, double & t): + * int max_depth, int min_node_size, int & classifier, double[:] & t): */ static PyObject *__pyx_pw_9cyext_acv_59compute_cdf_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_f_9cyext_acv_compute_cdf_rf(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, double &__pyx_v_t, CYTHON_UNUSED int __pyx_skip_dispatch) { +static PyObject *__pyx_f_9cyext_acv_compute_cdf_rf(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, CYTHON_UNUSED int __pyx_skip_dispatch) { int __pyx_v_N; __Pyx_memviewslice __pyx_v_sdp = { 0, 0, { 0 }, { 0 }, { 0 } }; int __pyx_v_i; @@ -68423,13 +68589,14 @@ static PyObject *__pyx_f_9cyext_acv_compute_cdf_rf(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } }; Py_ssize_t __pyx_t_10; Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("compute_cdf_rf", 0); /* "cyext_acv.pyx":4580 - * int max_depth, int min_node_size, int & classifier, double & t): + * int max_depth, int min_node_size, int & classifier, double[:] & t): * * cdef int N = X.shape[0] # <<<<<<<<<<<<<< * cdef double[::1] sdp = np.zeros(N) @@ -68500,7 +68667,7 @@ static PyObject *__pyx_f_9cyext_acv_compute_cdf_rf(__Pyx_memviewslice __pyx_v_X, if (__pyx_t_8 > 0) { #ifdef _OPENMP - #pragma omp parallel private(__pyx_t_10, __pyx_t_11) firstprivate(__pyx_t_9) + #pragma omp parallel private(__pyx_t_10, __pyx_t_11, __pyx_t_12) firstprivate(__pyx_t_9) #endif /* _OPENMP */ { #ifdef _OPENMP @@ -68515,7 +68682,7 @@ static PyObject *__pyx_f_9cyext_acv_compute_cdf_rf(__Pyx_memviewslice __pyx_v_X, * for i in prange(N, nogil=True): * sdp[i] = single_compute_cdf_rf(X[i], y_X[i], data, y_data, S[i], # <<<<<<<<<<<<<< * features, thresholds, children_left, children_right, - * max_depth, min_node_size, classifier, t) + * max_depth, min_node_size, classifier, t[i]) */ __pyx_t_9.data = __pyx_v_X.data; __pyx_t_9.memview = __pyx_v_X.memview; @@ -68535,12 +68702,21 @@ __pyx_t_10 = __pyx_v_i; /* "cyext_acv.pyx":4586 * sdp[i] = single_compute_cdf_rf(X[i], y_X[i], data, y_data, S[i], * features, thresholds, children_left, children_right, - * max_depth, min_node_size, classifier, t) # <<<<<<<<<<<<<< + * max_depth, min_node_size, classifier, t[i]) # <<<<<<<<<<<<<< * return np.array(sdp) * */ __pyx_t_11 = __pyx_v_i; - *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_sdp.data) + __pyx_t_11)) )) = __pyx_f_9cyext_acv_single_compute_cdf_rf(__pyx_t_9, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_10)) ))), __pyx_v_data, __pyx_v_y_data, (__pyx_v_S[__pyx_v_i]), __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t); + + /* "cyext_acv.pyx":4584 + * cdef int i + * for i in prange(N, nogil=True): + * sdp[i] = single_compute_cdf_rf(X[i], y_X[i], data, y_data, S[i], # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i]) + */ + __pyx_t_12 = __pyx_v_i; + *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_sdp.data) + __pyx_t_12)) )) = __pyx_f_9cyext_acv_single_compute_cdf_rf(__pyx_t_9, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_10)) ))), __pyx_v_data, __pyx_v_y_data, (__pyx_v_S[__pyx_v_i]), __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, (*((double *) ( /* dim=0 */ (__pyx_v_t.data + __pyx_t_11 * __pyx_v_t.strides[0]) )))); __PYX_XDEC_MEMVIEW(&__pyx_t_9, 0); __pyx_t_9.memview = NULL; __pyx_t_9.data = NULL; @@ -68578,7 +68754,7 @@ __pyx_t_10 = __pyx_v_i; /* "cyext_acv.pyx":4587 * features, thresholds, children_left, children_right, - * max_depth, min_node_size, classifier, t) + * max_depth, min_node_size, classifier, t[i]) * return np.array(sdp) # <<<<<<<<<<<<<< * * @@ -68616,7 +68792,7 @@ __pyx_t_10 = __pyx_v_i; * @cython.cdivision(True) * cpdef compute_cdf_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, # <<<<<<<<<<<<<< * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, - * int max_depth, int min_node_size, int & classifier, double & t): + * int max_depth, int min_node_size, int & classifier, double[:] & t): */ /* function exit code */ @@ -68651,7 +68827,7 @@ static PyObject *__pyx_pw_9cyext_acv_59compute_cdf_rf(PyObject *__pyx_self, PyOb int __pyx_v_max_depth; int __pyx_v_min_node_size; int __pyx_v_classifier; - double __pyx_v_t; + __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } }; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -68804,7 +68980,7 @@ static PyObject *__pyx_pw_9cyext_acv_59compute_cdf_rf(PyObject *__pyx_self, PyOb __pyx_v_max_depth = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4578, __pyx_L3_error) __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4578, __pyx_L3_error) __pyx_v_classifier = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4578, __pyx_L3_error) - __pyx_v_t = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4578, __pyx_L3_error) + __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[12], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 4578, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; @@ -68821,7 +68997,7 @@ static PyObject *__pyx_pw_9cyext_acv_59compute_cdf_rf(PyObject *__pyx_self, PyOb return __pyx_r; } -static PyObject *__pyx_pf_9cyext_acv_58compute_cdf_rf(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, double __pyx_v_t) { +static PyObject *__pyx_pf_9cyext_acv_58compute_cdf_rf(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -68838,6 +69014,7 @@ static PyObject *__pyx_pf_9cyext_acv_58compute_cdf_rf(CYTHON_UNUSED PyObject *__ if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 4576, __pyx_L1_error) } if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 4576, __pyx_L1_error) } if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 4576, __pyx_L1_error) } + if (unlikely(!__pyx_v_t.memview)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 4576, __pyx_L1_error) } __pyx_t_1 = __pyx_f_9cyext_acv_compute_cdf_rf(__pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; @@ -68858,6 +69035,7 @@ static PyObject *__pyx_pf_9cyext_acv_58compute_cdf_rf(CYTHON_UNUSED PyObject *__ __PYX_XDEC_MEMVIEW(&__pyx_v_thresholds, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_children_left, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_children_right, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_t, 1); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -78770,10 +78948,10 @@ static PyObject *__pyx_pf_9cyext_acv_74compute_sdp_maxrule_biased_v2(CYTHON_UNUS * @cython.cdivision(True) * cdef double single_compute_sdp_rule(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, # <<<<<<<<<<<<<< * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, - * int & max_depth, int & min_node_size, int & classifier, double & t, double[:, :] & partition) nogil: + * int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition) nogil: */ -static double __pyx_f_9cyext_acv_single_compute_sdp_rule(__Pyx_memviewslice &__pyx_v_x, double &__pyx_v_y_x, __Pyx_memviewslice &__pyx_v_data, __Pyx_memviewslice &__pyx_v_y_data, std::vector &__pyx_v_S, __Pyx_memviewslice &__pyx_v_features, __Pyx_memviewslice &__pyx_v_thresholds, __Pyx_memviewslice &__pyx_v_children_left, __Pyx_memviewslice &__pyx_v_children_right, int &__pyx_v_max_depth, int &__pyx_v_min_node_size, int &__pyx_v_classifier, double &__pyx_v_t, __Pyx_memviewslice &__pyx_v_partition) { +static double __pyx_f_9cyext_acv_single_compute_sdp_rule(__Pyx_memviewslice &__pyx_v_x, double &__pyx_v_y_x, __Pyx_memviewslice &__pyx_v_data, __Pyx_memviewslice &__pyx_v_y_data, std::vector &__pyx_v_S, __Pyx_memviewslice &__pyx_v_features, __Pyx_memviewslice &__pyx_v_thresholds, __Pyx_memviewslice &__pyx_v_children_left, __Pyx_memviewslice &__pyx_v_children_right, int &__pyx_v_max_depth, int &__pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, __Pyx_memviewslice &__pyx_v_partition) { unsigned int __pyx_v_n_trees; unsigned int __pyx_v_N; double __pyx_v_sdp; @@ -78808,7 +78986,7 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rule(__Pyx_memviewslice &__p int __pyx_clineno = 0; /* "cyext_acv.pyx":5138 - * int & max_depth, int & min_node_size, int & classifier, double & t, double[:, :] & partition) nogil: + * int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition) nogil: * * cdef unsigned int n_trees = features.shape[0] # <<<<<<<<<<<<<< * cdef unsigned int N = data.shape[0] @@ -79477,7 +79655,7 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rule(__Pyx_memviewslice &__p * else: * it = in_data.begin() # <<<<<<<<<<<<<< * while(it != in_data.end()): - * sdp += (1./(n_trees*in_data.size())) * ((y_x - y_data[deref(it)])*(y_x - y_data[deref(it)]) <= t) + * sdp += (1./(n_trees*in_data.size())) * (t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1]) */ /*else*/ { __pyx_v_it = __pyx_v_in_data.begin(); @@ -79486,7 +79664,7 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rule(__Pyx_memviewslice &__p * else: * it = in_data.begin() * while(it != in_data.end()): # <<<<<<<<<<<<<< - * sdp += (1./(n_trees*in_data.size())) * ((y_x - y_data[deref(it)])*(y_x - y_data[deref(it)]) <= t) + * sdp += (1./(n_trees*in_data.size())) * (t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1]) * inc(it) */ while (1) { @@ -79496,17 +79674,19 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rule(__Pyx_memviewslice &__p /* "cyext_acv.pyx":5207 * it = in_data.begin() * while(it != in_data.end()): - * sdp += (1./(n_trees*in_data.size())) * ((y_x - y_data[deref(it)])*(y_x - y_data[deref(it)]) <= t) # <<<<<<<<<<<<<< + * sdp += (1./(n_trees*in_data.size())) * (t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1]) # <<<<<<<<<<<<<< * inc(it) * */ - __pyx_t_12 = (*__pyx_v_it); + __pyx_t_12 = 0; __pyx_t_15 = (*__pyx_v_it); - __pyx_v_sdp = (__pyx_v_sdp + ((1. / (__pyx_v_n_trees * __pyx_v_in_data.size())) * (((__pyx_v_y_x - (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_12)) )))) * (__pyx_v_y_x - (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_15)) ))))) <= __pyx_v_t))); + __pyx_t_13 = (*__pyx_v_it); + __pyx_t_14 = 1; + __pyx_v_sdp = (__pyx_v_sdp + (((1. / (__pyx_v_n_trees * __pyx_v_in_data.size())) * ((*((double *) ( /* dim=0 */ (__pyx_v_t.data + __pyx_t_12 * __pyx_v_t.strides[0]) ))) <= (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_15)) ))))) * ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_13)) ))) <= (*((double *) ( /* dim=0 */ (__pyx_v_t.data + __pyx_t_14 * __pyx_v_t.strides[0]) )))))); /* "cyext_acv.pyx":5208 * while(it != in_data.end()): - * sdp += (1./(n_trees*in_data.size())) * ((y_x - y_data[deref(it)])*(y_x - y_data[deref(it)]) <= t) + * sdp += (1./(n_trees*in_data.size())) * (t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1]) * inc(it) # <<<<<<<<<<<<<< * * return sdp @@ -79532,7 +79712,7 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rule(__Pyx_memviewslice &__p * @cython.cdivision(True) * cdef double single_compute_sdp_rule(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, # <<<<<<<<<<<<<< * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, - * int & max_depth, int & min_node_size, int & classifier, double & t, double[:, :] & partition) nogil: + * int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition) nogil: */ /* function exit code */ @@ -79548,11 +79728,11 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rule(__Pyx_memviewslice &__p * @cython.cdivision(True) * cpdef compute_sdp_rule(double[:, :] & X, double[::1] & y_X, double[:, :] & data, double[::1] & y_data, vector[vector[int]] & S, # <<<<<<<<<<<<<< * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, - * int & max_depth, int & min_node_size, int & classifier, double & t): + * int & max_depth, int & min_node_size, int & classifier, double[:, :] & t): */ static PyObject *__pyx_pw_9cyext_acv_77compute_sdp_rule(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_f_9cyext_acv_compute_sdp_rule(__Pyx_memviewslice &__pyx_v_X, __Pyx_memviewslice &__pyx_v_y_X, __Pyx_memviewslice &__pyx_v_data, __Pyx_memviewslice &__pyx_v_y_data, std::vector > &__pyx_v_S, __Pyx_memviewslice &__pyx_v_features, __Pyx_memviewslice &__pyx_v_thresholds, __Pyx_memviewslice &__pyx_v_children_left, __Pyx_memviewslice &__pyx_v_children_right, int &__pyx_v_max_depth, int &__pyx_v_min_node_size, int &__pyx_v_classifier, double &__pyx_v_t, CYTHON_UNUSED int __pyx_skip_dispatch) { +static PyObject *__pyx_f_9cyext_acv_compute_sdp_rule(__Pyx_memviewslice &__pyx_v_X, __Pyx_memviewslice &__pyx_v_y_X, __Pyx_memviewslice &__pyx_v_data, __Pyx_memviewslice &__pyx_v_y_data, std::vector > &__pyx_v_S, __Pyx_memviewslice &__pyx_v_features, __Pyx_memviewslice &__pyx_v_thresholds, __Pyx_memviewslice &__pyx_v_children_left, __Pyx_memviewslice &__pyx_v_children_right, int &__pyx_v_max_depth, int &__pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_v_buffer = NULL; __Pyx_memviewslice __pyx_v_partition_byobs = { 0, 0, { 0 }, { 0 }, { 0 } }; int __pyx_v_N; @@ -79573,14 +79753,15 @@ static PyObject *__pyx_f_9cyext_acv_compute_sdp_rule(__Pyx_memviewslice &__pyx_v __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } }; Py_ssize_t __pyx_t_12; __Pyx_memviewslice __pyx_t_13 = { 0, 0, { 0 }, { 0 }, { 0 } }; - Py_ssize_t __pyx_t_14; + __Pyx_memviewslice __pyx_t_14 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_15; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("compute_sdp_rule", 0); /* "cyext_acv.pyx":5220 - * int & max_depth, int & min_node_size, int & classifier, double & t): + * int & max_depth, int & min_node_size, int & classifier, double[:, :] & t): * * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) # <<<<<<<<<<<<<< * buffer[:, :, 0] = -1e+10 @@ -79713,7 +79894,7 @@ static PyObject *__pyx_f_9cyext_acv_compute_sdp_rule(__Pyx_memviewslice &__pyx_v if (__pyx_t_10 > 0) { #ifdef _OPENMP - #pragma omp parallel private(__pyx_t_12, __pyx_t_14) firstprivate(__pyx_t_11, __pyx_t_13) + #pragma omp parallel private(__pyx_t_12, __pyx_t_15) firstprivate(__pyx_t_11, __pyx_t_13, __pyx_t_14) #endif /* _OPENMP */ { #ifdef _OPENMP @@ -79728,7 +79909,7 @@ static PyObject *__pyx_f_9cyext_acv_compute_sdp_rule(__Pyx_memviewslice &__pyx_v * for i in prange(N, nogil=True, schedule='dynamic'): * sdp[i] = single_compute_sdp_rule(X[i], y_X[i], data, y_data, S[i], # <<<<<<<<<<<<<< * features, thresholds, children_left, children_right, - * max_depth, min_node_size, classifier, t, partition_byobs[i]) + * max_depth, min_node_size, classifier, t[i], partition_byobs[i]) */ __pyx_t_11.data = __pyx_v_X.data; __pyx_t_11.memview = __pyx_v_X.memview; @@ -79748,43 +79929,59 @@ __pyx_t_12 = __pyx_v_i; /* "cyext_acv.pyx":5231 * sdp[i] = single_compute_sdp_rule(X[i], y_X[i], data, y_data, S[i], * features, thresholds, children_left, children_right, - * max_depth, min_node_size, classifier, t, partition_byobs[i]) # <<<<<<<<<<<<<< + * max_depth, min_node_size, classifier, t[i], partition_byobs[i]) # <<<<<<<<<<<<<< * * return np.array(sdp), np.array(partition_byobs) */ - __pyx_t_13.data = __pyx_v_partition_byobs.data; - __pyx_t_13.memview = __pyx_v_partition_byobs.memview; + __pyx_t_13.data = __pyx_v_t.data; + __pyx_t_13.memview = __pyx_v_t.memview; __PYX_INC_MEMVIEW(&__pyx_t_13, 0); { Py_ssize_t __pyx_tmp_idx = __pyx_v_i; - Py_ssize_t __pyx_tmp_stride = __pyx_v_partition_byobs.strides[0]; + Py_ssize_t __pyx_tmp_stride = __pyx_v_t.strides[0]; __pyx_t_13.data += __pyx_tmp_idx * __pyx_tmp_stride; } -__pyx_t_13.shape[0] = __pyx_v_partition_byobs.shape[1]; -__pyx_t_13.strides[0] = __pyx_v_partition_byobs.strides[1]; +__pyx_t_13.shape[0] = __pyx_v_t.shape[1]; +__pyx_t_13.strides[0] = __pyx_v_t.strides[1]; __pyx_t_13.suboffsets[0] = -1; -__pyx_t_13.shape[1] = __pyx_v_partition_byobs.shape[2]; -__pyx_t_13.strides[1] = __pyx_v_partition_byobs.strides[2]; - __pyx_t_13.suboffsets[1] = -1; +__pyx_t_14.data = __pyx_v_partition_byobs.data; + __pyx_t_14.memview = __pyx_v_partition_byobs.memview; + __PYX_INC_MEMVIEW(&__pyx_t_14, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_partition_byobs.strides[0]; + __pyx_t_14.data += __pyx_tmp_idx * __pyx_tmp_stride; +} -__pyx_t_14 = __pyx_v_i; +__pyx_t_14.shape[0] = __pyx_v_partition_byobs.shape[1]; +__pyx_t_14.strides[0] = __pyx_v_partition_byobs.strides[1]; + __pyx_t_14.suboffsets[0] = -1; + +__pyx_t_14.shape[1] = __pyx_v_partition_byobs.shape[2]; +__pyx_t_14.strides[1] = __pyx_v_partition_byobs.strides[2]; + __pyx_t_14.suboffsets[1] = -1; + +__pyx_t_15 = __pyx_v_i; /* "cyext_acv.pyx":5229 * * for i in prange(N, nogil=True, schedule='dynamic'): * sdp[i] = single_compute_sdp_rule(X[i], y_X[i], data, y_data, S[i], # <<<<<<<<<<<<<< * features, thresholds, children_left, children_right, - * max_depth, min_node_size, classifier, t, partition_byobs[i]) + * max_depth, min_node_size, classifier, t[i], partition_byobs[i]) */ - *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_sdp.data) + __pyx_t_14)) )) = __pyx_f_9cyext_acv_single_compute_sdp_rule(__pyx_t_11, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_12)) ))), __pyx_v_data, __pyx_v_y_data, (__pyx_v_S[__pyx_v_i]), __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_t_13); + *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_sdp.data) + __pyx_t_15)) )) = __pyx_f_9cyext_acv_single_compute_sdp_rule(__pyx_t_11, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_12)) ))), __pyx_v_data, __pyx_v_y_data, (__pyx_v_S[__pyx_v_i]), __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_t_13, __pyx_t_14); __PYX_XDEC_MEMVIEW(&__pyx_t_11, 0); __pyx_t_11.memview = NULL; __pyx_t_11.data = NULL; __PYX_XDEC_MEMVIEW(&__pyx_t_13, 0); __pyx_t_13.memview = NULL; __pyx_t_13.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_14, 0); + __pyx_t_14.memview = NULL; + __pyx_t_14.data = NULL; } } } @@ -79818,7 +80015,7 @@ __pyx_t_14 = __pyx_v_i; } /* "cyext_acv.pyx":5233 - * max_depth, min_node_size, classifier, t, partition_byobs[i]) + * max_depth, min_node_size, classifier, t[i], partition_byobs[i]) * * return np.array(sdp), np.array(partition_byobs) # <<<<<<<<<<<<<< * @@ -79888,7 +80085,7 @@ __pyx_t_14 = __pyx_v_i; * @cython.cdivision(True) * cpdef compute_sdp_rule(double[:, :] & X, double[::1] & y_X, double[:, :] & data, double[::1] & y_data, vector[vector[int]] & S, # <<<<<<<<<<<<<< * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, - * int & max_depth, int & min_node_size, int & classifier, double & t): + * int & max_depth, int & min_node_size, int & classifier, double[:, :] & t): */ /* function exit code */ @@ -79902,6 +80099,7 @@ __pyx_t_14 = __pyx_v_i; __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1); __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1); __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1); __Pyx_AddTraceback("cyext_acv.compute_sdp_rule", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; @@ -79928,7 +80126,7 @@ static PyObject *__pyx_pw_9cyext_acv_77compute_sdp_rule(PyObject *__pyx_self, Py int __pyx_v_max_depth; int __pyx_v_min_node_size; int __pyx_v_classifier; - double __pyx_v_t; + __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } }; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -80081,7 +80279,7 @@ static PyObject *__pyx_pw_9cyext_acv_77compute_sdp_rule(PyObject *__pyx_self, Py __pyx_v_max_depth = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5218, __pyx_L3_error) __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5218, __pyx_L3_error) __pyx_v_classifier = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5218, __pyx_L3_error) - __pyx_v_t = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5218, __pyx_L3_error) + __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[12], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 5218, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; @@ -80098,7 +80296,7 @@ static PyObject *__pyx_pw_9cyext_acv_77compute_sdp_rule(PyObject *__pyx_self, Py return __pyx_r; } -static PyObject *__pyx_pf_9cyext_acv_76compute_sdp_rule(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, double __pyx_v_t) { +static PyObject *__pyx_pf_9cyext_acv_76compute_sdp_rule(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -80115,6 +80313,7 @@ static PyObject *__pyx_pf_9cyext_acv_76compute_sdp_rule(CYTHON_UNUSED PyObject * if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 5216, __pyx_L1_error) } if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 5216, __pyx_L1_error) } if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 5216, __pyx_L1_error) } + if (unlikely(!__pyx_v_t.memview)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 5216, __pyx_L1_error) } __pyx_t_1 = __pyx_f_9cyext_acv_compute_sdp_rule(__pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; @@ -80135,6 +80334,7 @@ static PyObject *__pyx_pf_9cyext_acv_76compute_sdp_rule(CYTHON_UNUSED PyObject * __PYX_XDEC_MEMVIEW(&__pyx_v_thresholds, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_children_left, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_children_right, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_t, 1); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -80145,10 +80345,10 @@ static PyObject *__pyx_pf_9cyext_acv_76compute_sdp_rule(CYTHON_UNUSED PyObject * * @cython.cdivision(True) * cdef double single_compute_sdp_rule_weights(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, # <<<<<<<<<<<<<< * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, - * int & max_depth, int & min_node_size, int & classifier, double & t, double[:, :] & partition, + * int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition, */ -static double __pyx_f_9cyext_acv_single_compute_sdp_rule_weights(__Pyx_memviewslice &__pyx_v_x, double &__pyx_v_y_x, __Pyx_memviewslice &__pyx_v_data, __Pyx_memviewslice &__pyx_v_y_data, std::vector &__pyx_v_S, __Pyx_memviewslice &__pyx_v_features, __Pyx_memviewslice &__pyx_v_thresholds, __Pyx_memviewslice &__pyx_v_children_left, __Pyx_memviewslice &__pyx_v_children_right, int &__pyx_v_max_depth, int &__pyx_v_min_node_size, int &__pyx_v_classifier, double &__pyx_v_t, __Pyx_memviewslice &__pyx_v_partition, __Pyx_memviewslice &__pyx_v_w) { +static double __pyx_f_9cyext_acv_single_compute_sdp_rule_weights(__Pyx_memviewslice &__pyx_v_x, double &__pyx_v_y_x, __Pyx_memviewslice &__pyx_v_data, __Pyx_memviewslice &__pyx_v_y_data, std::vector &__pyx_v_S, __Pyx_memviewslice &__pyx_v_features, __Pyx_memviewslice &__pyx_v_thresholds, __Pyx_memviewslice &__pyx_v_children_left, __Pyx_memviewslice &__pyx_v_children_right, int &__pyx_v_max_depth, int &__pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, __Pyx_memviewslice &__pyx_v_partition, __Pyx_memviewslice &__pyx_v_w) { unsigned int __pyx_v_n_trees; unsigned int __pyx_v_N; double __pyx_v_sdp; @@ -80862,7 +81062,7 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rule_weights(__Pyx_memviewsl * else: * it = in_data.begin() # <<<<<<<<<<<<<< * while(it != in_data.end()): - * sdp += (1./(n_trees*in_data.size())) * ((y_x - y_data[deref(it)])*(y_x - y_data[deref(it)]) <= t) + * sdp += (1./(n_trees*in_data.size())) * (t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1]) */ /*else*/ { __pyx_v_it = __pyx_v_in_data.begin(); @@ -80871,7 +81071,7 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rule_weights(__Pyx_memviewsl * else: * it = in_data.begin() * while(it != in_data.end()): # <<<<<<<<<<<<<< - * sdp += (1./(n_trees*in_data.size())) * ((y_x - y_data[deref(it)])*(y_x - y_data[deref(it)]) <= t) + * sdp += (1./(n_trees*in_data.size())) * (t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1]) * w[deref(it)] += (1./(n_trees*in_data.size())) */ while (1) { @@ -80881,26 +81081,28 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rule_weights(__Pyx_memviewsl /* "cyext_acv.pyx":5314 * it = in_data.begin() * while(it != in_data.end()): - * sdp += (1./(n_trees*in_data.size())) * ((y_x - y_data[deref(it)])*(y_x - y_data[deref(it)]) <= t) # <<<<<<<<<<<<<< + * sdp += (1./(n_trees*in_data.size())) * (t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1]) # <<<<<<<<<<<<<< * w[deref(it)] += (1./(n_trees*in_data.size())) * inc(it) */ - __pyx_t_12 = (*__pyx_v_it); + __pyx_t_12 = 0; __pyx_t_15 = (*__pyx_v_it); - __pyx_v_sdp = (__pyx_v_sdp + ((1. / (__pyx_v_n_trees * __pyx_v_in_data.size())) * (((__pyx_v_y_x - (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_12)) )))) * (__pyx_v_y_x - (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_15)) ))))) <= __pyx_v_t))); + __pyx_t_13 = (*__pyx_v_it); + __pyx_t_14 = 1; + __pyx_v_sdp = (__pyx_v_sdp + (((1. / (__pyx_v_n_trees * __pyx_v_in_data.size())) * ((*((double *) ( /* dim=0 */ (__pyx_v_t.data + __pyx_t_12 * __pyx_v_t.strides[0]) ))) <= (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_15)) ))))) * ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_13)) ))) <= (*((double *) ( /* dim=0 */ (__pyx_v_t.data + __pyx_t_14 * __pyx_v_t.strides[0]) )))))); /* "cyext_acv.pyx":5315 * while(it != in_data.end()): - * sdp += (1./(n_trees*in_data.size())) * ((y_x - y_data[deref(it)])*(y_x - y_data[deref(it)]) <= t) + * sdp += (1./(n_trees*in_data.size())) * (t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1]) * w[deref(it)] += (1./(n_trees*in_data.size())) # <<<<<<<<<<<<<< * inc(it) * */ - __pyx_t_15 = (*__pyx_v_it); - *((double *) ( /* dim=0 */ (__pyx_v_w.data + __pyx_t_15 * __pyx_v_w.strides[0]) )) += (1. / (__pyx_v_n_trees * __pyx_v_in_data.size())); + __pyx_t_14 = (*__pyx_v_it); + *((double *) ( /* dim=0 */ (__pyx_v_w.data + __pyx_t_14 * __pyx_v_w.strides[0]) )) += (1. / (__pyx_v_n_trees * __pyx_v_in_data.size())); /* "cyext_acv.pyx":5316 - * sdp += (1./(n_trees*in_data.size())) * ((y_x - y_data[deref(it)])*(y_x - y_data[deref(it)]) <= t) + * sdp += (1./(n_trees*in_data.size())) * (t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1]) * w[deref(it)] += (1./(n_trees*in_data.size())) * inc(it) # <<<<<<<<<<<<<< * @@ -80927,7 +81129,7 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rule_weights(__Pyx_memviewsl * @cython.cdivision(True) * cdef double single_compute_sdp_rule_weights(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, # <<<<<<<<<<<<<< * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, - * int & max_depth, int & min_node_size, int & classifier, double & t, double[:, :] & partition, + * int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition, */ /* function exit code */ @@ -80943,11 +81145,11 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rule_weights(__Pyx_memviewsl * @cython.cdivision(True) * cpdef compute_sdp_maxrule(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, # <<<<<<<<<<<<<< * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, - * int max_depth, int min_node_size, int & classifier, double & t, double & pi): + * int max_depth, int min_node_size, int & classifier, double[:, :] & t, double & pi): */ static PyObject *__pyx_pw_9cyext_acv_79compute_sdp_maxrule(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_f_9cyext_acv_compute_sdp_maxrule(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, double &__pyx_v_t, CYTHON_UNUSED double &__pyx_v_pi, CYTHON_UNUSED int __pyx_skip_dispatch) { +static PyObject *__pyx_f_9cyext_acv_compute_sdp_maxrule(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, CYTHON_UNUSED double &__pyx_v_pi, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_v_buffer = NULL; __Pyx_memviewslice __pyx_v_partition_byobs = { 0, 0, { 0 }, { 0 }, { 0 } }; PyObject *__pyx_v_buffer_data = NULL; @@ -80977,21 +81179,22 @@ static PyObject *__pyx_f_9cyext_acv_compute_sdp_maxrule(__Pyx_memviewslice __pyx __Pyx_memviewslice __pyx_t_14 = { 0, 0, { 0 }, { 0 }, { 0 } }; Py_ssize_t __pyx_t_15; __Pyx_memviewslice __pyx_t_16 = { 0, 0, { 0 }, { 0 }, { 0 } }; - Py_ssize_t __pyx_t_17; + __Pyx_memviewslice __pyx_t_17 = { 0, 0, { 0 }, { 0 }, { 0 } }; Py_ssize_t __pyx_t_18; Py_ssize_t __pyx_t_19; Py_ssize_t __pyx_t_20; - int __pyx_t_21; - Py_ssize_t __pyx_t_22; - PyObject *__pyx_t_23 = NULL; + Py_ssize_t __pyx_t_21; + int __pyx_t_22; + Py_ssize_t __pyx_t_23; PyObject *__pyx_t_24 = NULL; + PyObject *__pyx_t_25 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("compute_sdp_maxrule", 0); /* "cyext_acv.pyx":5329 - * int max_depth, int min_node_size, int & classifier, double & t, double & pi): + * int max_depth, int min_node_size, int & classifier, double[:, :] & t, double & pi): * * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) # <<<<<<<<<<<<<< * buffer[:, :, 0] = -1e+10 @@ -81308,7 +81511,7 @@ static PyObject *__pyx_f_9cyext_acv_compute_sdp_maxrule(__Pyx_memviewslice __pyx * for i in range(N): * sdp[i] = single_compute_sdp_rule_weights(X[i], y_X[i], data, y_data, S[i], # <<<<<<<<<<<<<< * features, thresholds, children_left, children_right, - * max_depth, min_node_size, classifier, t, partition_byobs[i], weights[i]) + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i]) */ __pyx_t_14.data = __pyx_v_X.data; __pyx_t_14.memview = __pyx_v_X.memview; @@ -81328,11 +81531,24 @@ __pyx_t_15 = __pyx_v_i; /* "cyext_acv.pyx":5351 * sdp[i] = single_compute_sdp_rule_weights(X[i], y_X[i], data, y_data, S[i], * features, thresholds, children_left, children_right, - * max_depth, min_node_size, classifier, t, partition_byobs[i], weights[i]) # <<<<<<<<<<<<<< + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i]) # <<<<<<<<<<<<<< * * for j in prange(data.shape[0], nogil=True, schedule='dynamic'): */ - __pyx_t_10.data = __pyx_v_partition_byobs.data; + __pyx_t_16.data = __pyx_v_t.data; + __pyx_t_16.memview = __pyx_v_t.memview; + __PYX_INC_MEMVIEW(&__pyx_t_16, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_t.strides[0]; + __pyx_t_16.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_16.shape[0] = __pyx_v_t.shape[1]; +__pyx_t_16.strides[0] = __pyx_v_t.strides[1]; + __pyx_t_16.suboffsets[0] = -1; + +__pyx_t_10.data = __pyx_v_partition_byobs.data; __pyx_t_10.memview = __pyx_v_partition_byobs.memview; __PYX_INC_MEMVIEW(&__pyx_t_10, 0); { @@ -81349,41 +81565,44 @@ __pyx_t_10.shape[1] = __pyx_v_partition_byobs.shape[2]; __pyx_t_10.strides[1] = __pyx_v_partition_byobs.strides[2]; __pyx_t_10.suboffsets[1] = -1; -__pyx_t_16.data = __pyx_v_weights.data; - __pyx_t_16.memview = __pyx_v_weights.memview; - __PYX_INC_MEMVIEW(&__pyx_t_16, 0); +__pyx_t_17.data = __pyx_v_weights.data; + __pyx_t_17.memview = __pyx_v_weights.memview; + __PYX_INC_MEMVIEW(&__pyx_t_17, 0); { Py_ssize_t __pyx_tmp_idx = __pyx_v_i; Py_ssize_t __pyx_tmp_stride = __pyx_v_weights.strides[0]; - __pyx_t_16.data += __pyx_tmp_idx * __pyx_tmp_stride; + __pyx_t_17.data += __pyx_tmp_idx * __pyx_tmp_stride; } -__pyx_t_16.shape[0] = __pyx_v_weights.shape[1]; -__pyx_t_16.strides[0] = __pyx_v_weights.strides[1]; - __pyx_t_16.suboffsets[0] = -1; +__pyx_t_17.shape[0] = __pyx_v_weights.shape[1]; +__pyx_t_17.strides[0] = __pyx_v_weights.strides[1]; + __pyx_t_17.suboffsets[0] = -1; -__pyx_t_17 = __pyx_v_i; +__pyx_t_18 = __pyx_v_i; /* "cyext_acv.pyx":5349 * * for i in range(N): * sdp[i] = single_compute_sdp_rule_weights(X[i], y_X[i], data, y_data, S[i], # <<<<<<<<<<<<<< * features, thresholds, children_left, children_right, - * max_depth, min_node_size, classifier, t, partition_byobs[i], weights[i]) + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i]) */ - *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_sdp.data) + __pyx_t_17)) )) = __pyx_f_9cyext_acv_single_compute_sdp_rule_weights(__pyx_t_14, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_15)) ))), __pyx_v_data, __pyx_v_y_data, (__pyx_v_S[__pyx_v_i]), __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_t_10, __pyx_t_16); + *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_sdp.data) + __pyx_t_18)) )) = __pyx_f_9cyext_acv_single_compute_sdp_rule_weights(__pyx_t_14, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_15)) ))), __pyx_v_data, __pyx_v_y_data, (__pyx_v_S[__pyx_v_i]), __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_t_16, __pyx_t_10, __pyx_t_17); __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1); __pyx_t_14.memview = NULL; __pyx_t_14.data = NULL; - __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1); - __pyx_t_10.memview = NULL; - __pyx_t_10.data = NULL; __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1); __pyx_t_16.memview = NULL; __pyx_t_16.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1); + __pyx_t_10.memview = NULL; + __pyx_t_10.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1); + __pyx_t_17.memview = NULL; + __pyx_t_17.data = NULL; /* "cyext_acv.pyx":5353 - * max_depth, min_node_size, classifier, t, partition_byobs[i], weights[i]) + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i]) * * for j in prange(data.shape[0], nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< * if weights[i, j] != 0: @@ -81397,7 +81616,7 @@ __pyx_t_17 = __pyx_v_i; #endif /*try:*/ { if (unlikely(!__pyx_v_data.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("data"); __PYX_ERR(0, 5353, __pyx_L8_error) } - __pyx_t_18 = (__pyx_v_data.shape[0]); + __pyx_t_19 = (__pyx_v_data.shape[0]); if ((1 == 0)) abort(); { #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) @@ -81406,19 +81625,19 @@ __pyx_t_17 = __pyx_v_i; #define likely(x) (x) #define unlikely(x) (x) #endif - __pyx_t_20 = (__pyx_t_18 - 0 + 1 - 1/abs(1)) / 1; - if (__pyx_t_20 > 0) + __pyx_t_21 = (__pyx_t_19 - 0 + 1 - 1/abs(1)) / 1; + if (__pyx_t_21 > 0) { #ifdef _OPENMP - #pragma omp parallel private(__pyx_t_15, __pyx_t_17, __pyx_t_21, __pyx_t_22) firstprivate(__pyx_t_10, __pyx_t_16) + #pragma omp parallel private(__pyx_t_15, __pyx_t_18, __pyx_t_22, __pyx_t_23) firstprivate(__pyx_t_10, __pyx_t_16, __pyx_t_17) #endif /* _OPENMP */ { #ifdef _OPENMP #pragma omp for firstprivate(__pyx_v_j) lastprivate(__pyx_v_j) schedule(dynamic) #endif /* _OPENMP */ - for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_20; __pyx_t_19++){ + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_21; __pyx_t_20++){ { - __pyx_v_j = (int)(0 + 1 * __pyx_t_19); + __pyx_v_j = (int)(0 + 1 * __pyx_t_20); /* "cyext_acv.pyx":5354 * @@ -81428,40 +81647,53 @@ __pyx_t_17 = __pyx_v_i; * features, thresholds, children_left, children_right, */ __pyx_t_15 = __pyx_v_i; - __pyx_t_17 = __pyx_v_j; - __pyx_t_21 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_weights.data + __pyx_t_15 * __pyx_v_weights.strides[0]) ) + __pyx_t_17 * __pyx_v_weights.strides[1]) ))) != 0.0) != 0); - if (__pyx_t_21) { + __pyx_t_18 = __pyx_v_j; + __pyx_t_22 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_weights.data + __pyx_t_15 * __pyx_v_weights.strides[0]) ) + __pyx_t_18 * __pyx_v_weights.strides[1]) ))) != 0.0) != 0); + if (__pyx_t_22) { /* "cyext_acv.pyx":5355 * for j in prange(data.shape[0], nogil=True, schedule='dynamic'): * if weights[i, j] != 0: * sdp_data[i, j] = single_compute_sdp_rule(data[j], y_X[i], data, y_data, S[i], # <<<<<<<<<<<<<< * features, thresholds, children_left, children_right, - * max_depth, min_node_size, classifier, t, partition_byobs_data[i, j]) + * max_depth, min_node_size, classifier, t[i], partition_byobs_data[i, j]) */ - __pyx_t_16.data = __pyx_v_data.data; - __pyx_t_16.memview = __pyx_v_data.memview; - __PYX_INC_MEMVIEW(&__pyx_t_16, 0); + __pyx_t_17.data = __pyx_v_data.data; + __pyx_t_17.memview = __pyx_v_data.memview; + __PYX_INC_MEMVIEW(&__pyx_t_17, 0); { Py_ssize_t __pyx_tmp_idx = __pyx_v_j; Py_ssize_t __pyx_tmp_stride = __pyx_v_data.strides[0]; - __pyx_t_16.data += __pyx_tmp_idx * __pyx_tmp_stride; + __pyx_t_17.data += __pyx_tmp_idx * __pyx_tmp_stride; } -__pyx_t_16.shape[0] = __pyx_v_data.shape[1]; -__pyx_t_16.strides[0] = __pyx_v_data.strides[1]; - __pyx_t_16.suboffsets[0] = -1; +__pyx_t_17.shape[0] = __pyx_v_data.shape[1]; +__pyx_t_17.strides[0] = __pyx_v_data.strides[1]; + __pyx_t_17.suboffsets[0] = -1; -__pyx_t_17 = __pyx_v_i; +__pyx_t_18 = __pyx_v_i; /* "cyext_acv.pyx":5357 * sdp_data[i, j] = single_compute_sdp_rule(data[j], y_X[i], data, y_data, S[i], * features, thresholds, children_left, children_right, - * max_depth, min_node_size, classifier, t, partition_byobs_data[i, j]) # <<<<<<<<<<<<<< + * max_depth, min_node_size, classifier, t[i], partition_byobs_data[i, j]) # <<<<<<<<<<<<<< * * return np.array(sdp), np.array(partition_byobs), np.array(sdp_data), np.array(partition_byobs_data), np.array(weights) */ - __pyx_t_10.data = __pyx_v_partition_byobs_data.data; + __pyx_t_16.data = __pyx_v_t.data; + __pyx_t_16.memview = __pyx_v_t.memview; + __PYX_INC_MEMVIEW(&__pyx_t_16, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_t.strides[0]; + __pyx_t_16.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_16.shape[0] = __pyx_v_t.shape[1]; +__pyx_t_16.strides[0] = __pyx_v_t.strides[1]; + __pyx_t_16.suboffsets[0] = -1; + +__pyx_t_10.data = __pyx_v_partition_byobs_data.data; __pyx_t_10.memview = __pyx_v_partition_byobs_data.memview; __PYX_INC_MEMVIEW(&__pyx_t_10, 0); { @@ -81491,10 +81723,13 @@ __pyx_t_15 = __pyx_v_i; * if weights[i, j] != 0: * sdp_data[i, j] = single_compute_sdp_rule(data[j], y_X[i], data, y_data, S[i], # <<<<<<<<<<<<<< * features, thresholds, children_left, children_right, - * max_depth, min_node_size, classifier, t, partition_byobs_data[i, j]) + * max_depth, min_node_size, classifier, t[i], partition_byobs_data[i, j]) */ - __pyx_t_22 = __pyx_v_j; - *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_sdp_data.data + __pyx_t_15 * __pyx_v_sdp_data.strides[0]) ) + __pyx_t_22 * __pyx_v_sdp_data.strides[1]) )) = __pyx_f_9cyext_acv_single_compute_sdp_rule(__pyx_t_16, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_17)) ))), __pyx_v_data, __pyx_v_y_data, (__pyx_v_S[__pyx_v_i]), __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_t_10); + __pyx_t_23 = __pyx_v_j; + *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_sdp_data.data + __pyx_t_15 * __pyx_v_sdp_data.strides[0]) ) + __pyx_t_23 * __pyx_v_sdp_data.strides[1]) )) = __pyx_f_9cyext_acv_single_compute_sdp_rule(__pyx_t_17, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_18)) ))), __pyx_v_data, __pyx_v_y_data, (__pyx_v_S[__pyx_v_i]), __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_t_16, __pyx_t_10); + __PYX_XDEC_MEMVIEW(&__pyx_t_17, 0); + __pyx_t_17.memview = NULL; + __pyx_t_17.data = NULL; __PYX_XDEC_MEMVIEW(&__pyx_t_16, 0); __pyx_t_16.memview = NULL; __pyx_t_16.data = NULL; @@ -81524,7 +81759,7 @@ __pyx_t_15 = __pyx_v_i; } /* "cyext_acv.pyx":5353 - * max_depth, min_node_size, classifier, t, partition_byobs[i], weights[i]) + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i]) * * for j in prange(data.shape[0], nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< * if weights[i, j] != 0: @@ -81551,7 +81786,7 @@ __pyx_t_15 = __pyx_v_i; } /* "cyext_acv.pyx":5359 - * max_depth, min_node_size, classifier, t, partition_byobs_data[i, j]) + * max_depth, min_node_size, classifier, t[i], partition_byobs_data[i, j]) * * return np.array(sdp), np.array(partition_byobs), np.array(sdp_data), np.array(partition_byobs_data), np.array(weights) # <<<<<<<<<<<<<< * @@ -81634,64 +81869,64 @@ __pyx_t_15 = __pyx_v_i; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_partition_byobs_data, 4, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_23 = NULL; + __pyx_t_24 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_23 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_23)) { + __pyx_t_24 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_24)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_23); + __Pyx_INCREF(__pyx_t_24); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } - __pyx_t_3 = (__pyx_t_23) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_23, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); - __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; + __pyx_t_3 = (__pyx_t_24) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_24, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 5359, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_23); + __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 5359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_weights, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_24 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_23))) { - __pyx_t_24 = PyMethod_GET_SELF(__pyx_t_23); - if (likely(__pyx_t_24)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_23); - __Pyx_INCREF(__pyx_t_24); + __pyx_t_25 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_24))) { + __pyx_t_25 = PyMethod_GET_SELF(__pyx_t_24); + if (likely(__pyx_t_25)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_24); + __Pyx_INCREF(__pyx_t_25); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_23, function); + __Pyx_DECREF_SET(__pyx_t_24, function); } } - __pyx_t_5 = (__pyx_t_24) ? __Pyx_PyObject_Call2Args(__pyx_t_23, __pyx_t_24, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_23, __pyx_t_2); - __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_5 = (__pyx_t_25) ? __Pyx_PyObject_Call2Args(__pyx_t_24, __pyx_t_25, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_24, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; - __pyx_t_23 = PyTuple_New(5); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 5359, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_23); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = PyTuple_New(5); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 5359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_23, 2, __pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_24, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_23, 3, __pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_24, 3, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_23, 4, __pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_24, 4, __pyx_t_5); __pyx_t_7 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_5 = 0; - __pyx_r = __pyx_t_23; - __pyx_t_23 = 0; + __pyx_r = __pyx_t_24; + __pyx_t_24 = 0; goto __pyx_L0; /* "cyext_acv.pyx":5325 @@ -81699,7 +81934,7 @@ __pyx_t_15 = __pyx_v_i; * @cython.cdivision(True) * cpdef compute_sdp_maxrule(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, # <<<<<<<<<<<<<< * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, - * int max_depth, int min_node_size, int & classifier, double & t, double & pi): + * int max_depth, int min_node_size, int & classifier, double[:, :] & t, double & pi): */ /* function exit code */ @@ -81716,8 +81951,9 @@ __pyx_t_15 = __pyx_v_i; __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1); __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1); __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1); - __Pyx_XDECREF(__pyx_t_23); + __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1); __Pyx_XDECREF(__pyx_t_24); + __Pyx_XDECREF(__pyx_t_25); __Pyx_AddTraceback("cyext_acv.compute_sdp_maxrule", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; @@ -81749,7 +81985,7 @@ static PyObject *__pyx_pw_9cyext_acv_79compute_sdp_maxrule(PyObject *__pyx_self, int __pyx_v_max_depth; int __pyx_v_min_node_size; int __pyx_v_classifier; - double __pyx_v_t; + __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } }; double __pyx_v_pi; int __pyx_lineno = 0; const char *__pyx_filename = NULL; @@ -81912,7 +82148,7 @@ static PyObject *__pyx_pw_9cyext_acv_79compute_sdp_maxrule(PyObject *__pyx_self, __pyx_v_max_depth = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5327, __pyx_L3_error) __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5327, __pyx_L3_error) __pyx_v_classifier = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5327, __pyx_L3_error) - __pyx_v_t = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5327, __pyx_L3_error) + __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[12], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 5327, __pyx_L3_error) __pyx_v_pi = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_pi == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5327, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; @@ -81930,7 +82166,7 @@ static PyObject *__pyx_pw_9cyext_acv_79compute_sdp_maxrule(PyObject *__pyx_self, return __pyx_r; } -static PyObject *__pyx_pf_9cyext_acv_78compute_sdp_maxrule(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, double __pyx_v_t, double __pyx_v_pi) { +static PyObject *__pyx_pf_9cyext_acv_78compute_sdp_maxrule(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t, double __pyx_v_pi) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -81947,6 +82183,7 @@ static PyObject *__pyx_pf_9cyext_acv_78compute_sdp_maxrule(CYTHON_UNUSED PyObjec if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 5325, __pyx_L1_error) } if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 5325, __pyx_L1_error) } if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 5325, __pyx_L1_error) } + if (unlikely(!__pyx_v_t.memview)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 5325, __pyx_L1_error) } __pyx_t_1 = __pyx_f_9cyext_acv_compute_sdp_maxrule(__pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_v_pi, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; @@ -81967,6 +82204,7 @@ static PyObject *__pyx_pf_9cyext_acv_78compute_sdp_maxrule(CYTHON_UNUSED PyObjec __PYX_XDEC_MEMVIEW(&__pyx_v_thresholds, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_children_left, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_children_right, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_t, 1); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -81977,11 +82215,11 @@ static PyObject *__pyx_pf_9cyext_acv_78compute_sdp_maxrule(CYTHON_UNUSED PyObjec * @cython.cdivision(True) * cpdef compute_sdp_maxrule_verbose(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, # <<<<<<<<<<<<<< * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, - * int max_depth, int min_node_size, int & classifier, double & t, double & pi): + * int max_depth, int min_node_size, int & classifier, double[:, :] & t, double & pi): */ static PyObject *__pyx_pw_9cyext_acv_81compute_sdp_maxrule_verbose(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_f_9cyext_acv_compute_sdp_maxrule_verbose(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, double &__pyx_v_t, CYTHON_UNUSED double &__pyx_v_pi, CYTHON_UNUSED int __pyx_skip_dispatch) { +static PyObject *__pyx_f_9cyext_acv_compute_sdp_maxrule_verbose(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, CYTHON_UNUSED double &__pyx_v_pi, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_v_buffer = NULL; __Pyx_memviewslice __pyx_v_partition_byobs = { 0, 0, { 0 }, { 0 }, { 0 } }; PyObject *__pyx_v_buffer_data = NULL; @@ -82011,21 +82249,22 @@ static PyObject *__pyx_f_9cyext_acv_compute_sdp_maxrule_verbose(__Pyx_memviewsli __Pyx_memviewslice __pyx_t_14 = { 0, 0, { 0 }, { 0 }, { 0 } }; Py_ssize_t __pyx_t_15; __Pyx_memviewslice __pyx_t_16 = { 0, 0, { 0 }, { 0 }, { 0 } }; - Py_ssize_t __pyx_t_17; + __Pyx_memviewslice __pyx_t_17 = { 0, 0, { 0 }, { 0 }, { 0 } }; Py_ssize_t __pyx_t_18; Py_ssize_t __pyx_t_19; Py_ssize_t __pyx_t_20; - int __pyx_t_21; - Py_ssize_t __pyx_t_22; - PyObject *__pyx_t_23 = NULL; + Py_ssize_t __pyx_t_21; + int __pyx_t_22; + Py_ssize_t __pyx_t_23; PyObject *__pyx_t_24 = NULL; + PyObject *__pyx_t_25 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("compute_sdp_maxrule_verbose", 0); /* "cyext_acv.pyx":5369 - * int max_depth, int min_node_size, int & classifier, double & t, double & pi): + * int max_depth, int min_node_size, int & classifier, double[:, :] & t, double & pi): * * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) # <<<<<<<<<<<<<< * buffer[:, :, 0] = -1e+10 @@ -82404,7 +82643,7 @@ static PyObject *__pyx_f_9cyext_acv_compute_sdp_maxrule_verbose(__Pyx_memviewsli * for i in tqdm(range(N)): * sdp[i] = single_compute_sdp_rule_weights(X[i], y_X[i], data, y_data, S[i], # <<<<<<<<<<<<<< * features, thresholds, children_left, children_right, - * max_depth, min_node_size, classifier, t, partition_byobs[i], weights[i]) + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i]) */ __pyx_t_14.data = __pyx_v_X.data; __pyx_t_14.memview = __pyx_v_X.memview; @@ -82424,11 +82663,24 @@ __pyx_t_15 = __pyx_v_i; /* "cyext_acv.pyx":5391 * sdp[i] = single_compute_sdp_rule_weights(X[i], y_X[i], data, y_data, S[i], * features, thresholds, children_left, children_right, - * max_depth, min_node_size, classifier, t, partition_byobs[i], weights[i]) # <<<<<<<<<<<<<< + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i]) # <<<<<<<<<<<<<< * * for j in prange(data.shape[0], nogil=True, schedule='dynamic'): */ - __pyx_t_10.data = __pyx_v_partition_byobs.data; + __pyx_t_16.data = __pyx_v_t.data; + __pyx_t_16.memview = __pyx_v_t.memview; + __PYX_INC_MEMVIEW(&__pyx_t_16, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_t.strides[0]; + __pyx_t_16.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_16.shape[0] = __pyx_v_t.shape[1]; +__pyx_t_16.strides[0] = __pyx_v_t.strides[1]; + __pyx_t_16.suboffsets[0] = -1; + +__pyx_t_10.data = __pyx_v_partition_byobs.data; __pyx_t_10.memview = __pyx_v_partition_byobs.memview; __PYX_INC_MEMVIEW(&__pyx_t_10, 0); { @@ -82445,41 +82697,44 @@ __pyx_t_10.shape[1] = __pyx_v_partition_byobs.shape[2]; __pyx_t_10.strides[1] = __pyx_v_partition_byobs.strides[2]; __pyx_t_10.suboffsets[1] = -1; -__pyx_t_16.data = __pyx_v_weights.data; - __pyx_t_16.memview = __pyx_v_weights.memview; - __PYX_INC_MEMVIEW(&__pyx_t_16, 0); +__pyx_t_17.data = __pyx_v_weights.data; + __pyx_t_17.memview = __pyx_v_weights.memview; + __PYX_INC_MEMVIEW(&__pyx_t_17, 0); { Py_ssize_t __pyx_tmp_idx = __pyx_v_i; Py_ssize_t __pyx_tmp_stride = __pyx_v_weights.strides[0]; - __pyx_t_16.data += __pyx_tmp_idx * __pyx_tmp_stride; + __pyx_t_17.data += __pyx_tmp_idx * __pyx_tmp_stride; } -__pyx_t_16.shape[0] = __pyx_v_weights.shape[1]; -__pyx_t_16.strides[0] = __pyx_v_weights.strides[1]; - __pyx_t_16.suboffsets[0] = -1; +__pyx_t_17.shape[0] = __pyx_v_weights.shape[1]; +__pyx_t_17.strides[0] = __pyx_v_weights.strides[1]; + __pyx_t_17.suboffsets[0] = -1; -__pyx_t_17 = __pyx_v_i; +__pyx_t_18 = __pyx_v_i; /* "cyext_acv.pyx":5389 * * for i in tqdm(range(N)): * sdp[i] = single_compute_sdp_rule_weights(X[i], y_X[i], data, y_data, S[i], # <<<<<<<<<<<<<< * features, thresholds, children_left, children_right, - * max_depth, min_node_size, classifier, t, partition_byobs[i], weights[i]) + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i]) */ - *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_sdp.data) + __pyx_t_17)) )) = __pyx_f_9cyext_acv_single_compute_sdp_rule_weights(__pyx_t_14, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_15)) ))), __pyx_v_data, __pyx_v_y_data, (__pyx_v_S[__pyx_v_i]), __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_t_10, __pyx_t_16); + *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_sdp.data) + __pyx_t_18)) )) = __pyx_f_9cyext_acv_single_compute_sdp_rule_weights(__pyx_t_14, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_15)) ))), __pyx_v_data, __pyx_v_y_data, (__pyx_v_S[__pyx_v_i]), __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_t_16, __pyx_t_10, __pyx_t_17); __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1); __pyx_t_14.memview = NULL; __pyx_t_14.data = NULL; - __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1); - __pyx_t_10.memview = NULL; - __pyx_t_10.data = NULL; __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1); __pyx_t_16.memview = NULL; __pyx_t_16.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1); + __pyx_t_10.memview = NULL; + __pyx_t_10.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1); + __pyx_t_17.memview = NULL; + __pyx_t_17.data = NULL; /* "cyext_acv.pyx":5393 - * max_depth, min_node_size, classifier, t, partition_byobs[i], weights[i]) + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i]) * * for j in prange(data.shape[0], nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< * if weights[i, j] != 0: @@ -82493,7 +82748,7 @@ __pyx_t_17 = __pyx_v_i; #endif /*try:*/ { if (unlikely(!__pyx_v_data.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("data"); __PYX_ERR(0, 5393, __pyx_L8_error) } - __pyx_t_18 = (__pyx_v_data.shape[0]); + __pyx_t_19 = (__pyx_v_data.shape[0]); if ((1 == 0)) abort(); { #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) @@ -82502,19 +82757,19 @@ __pyx_t_17 = __pyx_v_i; #define likely(x) (x) #define unlikely(x) (x) #endif - __pyx_t_20 = (__pyx_t_18 - 0 + 1 - 1/abs(1)) / 1; - if (__pyx_t_20 > 0) + __pyx_t_21 = (__pyx_t_19 - 0 + 1 - 1/abs(1)) / 1; + if (__pyx_t_21 > 0) { #ifdef _OPENMP - #pragma omp parallel private(__pyx_t_15, __pyx_t_17, __pyx_t_21, __pyx_t_22) firstprivate(__pyx_t_10, __pyx_t_16) + #pragma omp parallel private(__pyx_t_15, __pyx_t_18, __pyx_t_22, __pyx_t_23) firstprivate(__pyx_t_10, __pyx_t_16, __pyx_t_17) #endif /* _OPENMP */ { #ifdef _OPENMP #pragma omp for firstprivate(__pyx_v_j) lastprivate(__pyx_v_j) schedule(dynamic) #endif /* _OPENMP */ - for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_20; __pyx_t_19++){ + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_21; __pyx_t_20++){ { - __pyx_v_j = (int)(0 + 1 * __pyx_t_19); + __pyx_v_j = (int)(0 + 1 * __pyx_t_20); /* "cyext_acv.pyx":5394 * @@ -82524,40 +82779,53 @@ __pyx_t_17 = __pyx_v_i; * features, thresholds, children_left, children_right, */ __pyx_t_15 = __pyx_v_i; - __pyx_t_17 = __pyx_v_j; - __pyx_t_21 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_weights.data + __pyx_t_15 * __pyx_v_weights.strides[0]) ) + __pyx_t_17 * __pyx_v_weights.strides[1]) ))) != 0.0) != 0); - if (__pyx_t_21) { + __pyx_t_18 = __pyx_v_j; + __pyx_t_22 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_weights.data + __pyx_t_15 * __pyx_v_weights.strides[0]) ) + __pyx_t_18 * __pyx_v_weights.strides[1]) ))) != 0.0) != 0); + if (__pyx_t_22) { /* "cyext_acv.pyx":5395 * for j in prange(data.shape[0], nogil=True, schedule='dynamic'): * if weights[i, j] != 0: * sdp_data[i, j] = single_compute_sdp_rule(data[j], y_X[i], data, y_data, S[i], # <<<<<<<<<<<<<< * features, thresholds, children_left, children_right, - * max_depth, min_node_size, classifier, t, partition_byobs_data[i, j]) + * max_depth, min_node_size, classifier, t[i], partition_byobs_data[i, j]) */ - __pyx_t_16.data = __pyx_v_data.data; - __pyx_t_16.memview = __pyx_v_data.memview; - __PYX_INC_MEMVIEW(&__pyx_t_16, 0); + __pyx_t_17.data = __pyx_v_data.data; + __pyx_t_17.memview = __pyx_v_data.memview; + __PYX_INC_MEMVIEW(&__pyx_t_17, 0); { Py_ssize_t __pyx_tmp_idx = __pyx_v_j; Py_ssize_t __pyx_tmp_stride = __pyx_v_data.strides[0]; - __pyx_t_16.data += __pyx_tmp_idx * __pyx_tmp_stride; + __pyx_t_17.data += __pyx_tmp_idx * __pyx_tmp_stride; } -__pyx_t_16.shape[0] = __pyx_v_data.shape[1]; -__pyx_t_16.strides[0] = __pyx_v_data.strides[1]; - __pyx_t_16.suboffsets[0] = -1; +__pyx_t_17.shape[0] = __pyx_v_data.shape[1]; +__pyx_t_17.strides[0] = __pyx_v_data.strides[1]; + __pyx_t_17.suboffsets[0] = -1; -__pyx_t_17 = __pyx_v_i; +__pyx_t_18 = __pyx_v_i; /* "cyext_acv.pyx":5397 * sdp_data[i, j] = single_compute_sdp_rule(data[j], y_X[i], data, y_data, S[i], * features, thresholds, children_left, children_right, - * max_depth, min_node_size, classifier, t, partition_byobs_data[i, j]) # <<<<<<<<<<<<<< + * max_depth, min_node_size, classifier, t[i], partition_byobs_data[i, j]) # <<<<<<<<<<<<<< * * return np.array(sdp), np.array(partition_byobs), np.array(sdp_data), np.array(partition_byobs_data), np.array(weights) */ - __pyx_t_10.data = __pyx_v_partition_byobs_data.data; + __pyx_t_16.data = __pyx_v_t.data; + __pyx_t_16.memview = __pyx_v_t.memview; + __PYX_INC_MEMVIEW(&__pyx_t_16, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_t.strides[0]; + __pyx_t_16.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_16.shape[0] = __pyx_v_t.shape[1]; +__pyx_t_16.strides[0] = __pyx_v_t.strides[1]; + __pyx_t_16.suboffsets[0] = -1; + +__pyx_t_10.data = __pyx_v_partition_byobs_data.data; __pyx_t_10.memview = __pyx_v_partition_byobs_data.memview; __PYX_INC_MEMVIEW(&__pyx_t_10, 0); { @@ -82587,10 +82855,13 @@ __pyx_t_15 = __pyx_v_i; * if weights[i, j] != 0: * sdp_data[i, j] = single_compute_sdp_rule(data[j], y_X[i], data, y_data, S[i], # <<<<<<<<<<<<<< * features, thresholds, children_left, children_right, - * max_depth, min_node_size, classifier, t, partition_byobs_data[i, j]) + * max_depth, min_node_size, classifier, t[i], partition_byobs_data[i, j]) */ - __pyx_t_22 = __pyx_v_j; - *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_sdp_data.data + __pyx_t_15 * __pyx_v_sdp_data.strides[0]) ) + __pyx_t_22 * __pyx_v_sdp_data.strides[1]) )) = __pyx_f_9cyext_acv_single_compute_sdp_rule(__pyx_t_16, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_17)) ))), __pyx_v_data, __pyx_v_y_data, (__pyx_v_S[__pyx_v_i]), __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_t_10); + __pyx_t_23 = __pyx_v_j; + *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_sdp_data.data + __pyx_t_15 * __pyx_v_sdp_data.strides[0]) ) + __pyx_t_23 * __pyx_v_sdp_data.strides[1]) )) = __pyx_f_9cyext_acv_single_compute_sdp_rule(__pyx_t_17, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_18)) ))), __pyx_v_data, __pyx_v_y_data, (__pyx_v_S[__pyx_v_i]), __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_t_16, __pyx_t_10); + __PYX_XDEC_MEMVIEW(&__pyx_t_17, 0); + __pyx_t_17.memview = NULL; + __pyx_t_17.data = NULL; __PYX_XDEC_MEMVIEW(&__pyx_t_16, 0); __pyx_t_16.memview = NULL; __pyx_t_16.data = NULL; @@ -82620,7 +82891,7 @@ __pyx_t_15 = __pyx_v_i; } /* "cyext_acv.pyx":5393 - * max_depth, min_node_size, classifier, t, partition_byobs[i], weights[i]) + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i]) * * for j in prange(data.shape[0], nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< * if weights[i, j] != 0: @@ -82656,7 +82927,7 @@ __pyx_t_15 = __pyx_v_i; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cyext_acv.pyx":5399 - * max_depth, min_node_size, classifier, t, partition_byobs_data[i, j]) + * max_depth, min_node_size, classifier, t[i], partition_byobs_data[i, j]) * * return np.array(sdp), np.array(partition_byobs), np.array(sdp_data), np.array(partition_byobs_data), np.array(weights) # <<<<<<<<<<<<<< * @@ -82739,64 +83010,64 @@ __pyx_t_15 = __pyx_v_i; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_partition_byobs_data, 4, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_23 = NULL; + __pyx_t_24 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_23 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_23)) { + __pyx_t_24 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_24)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_23); + __Pyx_INCREF(__pyx_t_24); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } - __pyx_t_3 = (__pyx_t_23) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_23, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); - __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; + __pyx_t_3 = (__pyx_t_24) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_24, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); + __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 5399, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_23); + __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 5399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_weights, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_24 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_23))) { - __pyx_t_24 = PyMethod_GET_SELF(__pyx_t_23); - if (likely(__pyx_t_24)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_23); - __Pyx_INCREF(__pyx_t_24); + __pyx_t_25 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_24))) { + __pyx_t_25 = PyMethod_GET_SELF(__pyx_t_24); + if (likely(__pyx_t_25)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_24); + __Pyx_INCREF(__pyx_t_25); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_23, function); + __Pyx_DECREF_SET(__pyx_t_24, function); } } - __pyx_t_5 = (__pyx_t_24) ? __Pyx_PyObject_Call2Args(__pyx_t_23, __pyx_t_24, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_23, __pyx_t_7); - __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_5 = (__pyx_t_25) ? __Pyx_PyObject_Call2Args(__pyx_t_24, __pyx_t_25, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_24, __pyx_t_7); + __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; - __pyx_t_23 = PyTuple_New(5); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 5399, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_23); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = PyTuple_New(5); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 5399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_23, 2, __pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_24, 2, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_23, 3, __pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_24, 3, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_23, 4, __pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_24, 4, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_5 = 0; - __pyx_r = __pyx_t_23; - __pyx_t_23 = 0; + __pyx_r = __pyx_t_24; + __pyx_t_24 = 0; goto __pyx_L0; /* "cyext_acv.pyx":5365 @@ -82804,7 +83075,7 @@ __pyx_t_15 = __pyx_v_i; * @cython.cdivision(True) * cpdef compute_sdp_maxrule_verbose(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, # <<<<<<<<<<<<<< * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, - * int max_depth, int min_node_size, int & classifier, double & t, double & pi): + * int max_depth, int min_node_size, int & classifier, double[:, :] & t, double & pi): */ /* function exit code */ @@ -82821,8 +83092,9 @@ __pyx_t_15 = __pyx_v_i; __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1); __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1); __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1); - __Pyx_XDECREF(__pyx_t_23); + __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1); __Pyx_XDECREF(__pyx_t_24); + __Pyx_XDECREF(__pyx_t_25); __Pyx_AddTraceback("cyext_acv.compute_sdp_maxrule_verbose", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; @@ -82854,7 +83126,7 @@ static PyObject *__pyx_pw_9cyext_acv_81compute_sdp_maxrule_verbose(PyObject *__p int __pyx_v_max_depth; int __pyx_v_min_node_size; int __pyx_v_classifier; - double __pyx_v_t; + __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } }; double __pyx_v_pi; int __pyx_lineno = 0; const char *__pyx_filename = NULL; @@ -83017,7 +83289,7 @@ static PyObject *__pyx_pw_9cyext_acv_81compute_sdp_maxrule_verbose(PyObject *__p __pyx_v_max_depth = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5367, __pyx_L3_error) __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5367, __pyx_L3_error) __pyx_v_classifier = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5367, __pyx_L3_error) - __pyx_v_t = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5367, __pyx_L3_error) + __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[12], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 5367, __pyx_L3_error) __pyx_v_pi = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_pi == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5367, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; @@ -83035,7 +83307,7 @@ static PyObject *__pyx_pw_9cyext_acv_81compute_sdp_maxrule_verbose(PyObject *__p return __pyx_r; } -static PyObject *__pyx_pf_9cyext_acv_80compute_sdp_maxrule_verbose(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, double __pyx_v_t, double __pyx_v_pi) { +static PyObject *__pyx_pf_9cyext_acv_80compute_sdp_maxrule_verbose(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t, double __pyx_v_pi) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -83052,6 +83324,7 @@ static PyObject *__pyx_pf_9cyext_acv_80compute_sdp_maxrule_verbose(CYTHON_UNUSED if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 5365, __pyx_L1_error) } if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 5365, __pyx_L1_error) } if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 5365, __pyx_L1_error) } + if (unlikely(!__pyx_v_t.memview)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 5365, __pyx_L1_error) } __pyx_t_1 = __pyx_f_9cyext_acv_compute_sdp_maxrule_verbose(__pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_v_pi, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; @@ -83072,6 +83345,7 @@ static PyObject *__pyx_pf_9cyext_acv_80compute_sdp_maxrule_verbose(CYTHON_UNUSED __PYX_XDEC_MEMVIEW(&__pyx_v_thresholds, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_children_left, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_children_right, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_t, 1); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -83080,12 +83354,12 @@ static PyObject *__pyx_pf_9cyext_acv_80compute_sdp_maxrule_verbose(CYTHON_UNUSED /* "cyext_acv.pyx":5406 * @cython.nonecheck(False) * @cython.cdivision(True) - * cdef double single_compute_sdp_rf(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, # <<<<<<<<<<<<<< + * cdef double single_compute_ddp_rule(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, # <<<<<<<<<<<<<< * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, - * int & max_depth, int & min_node_size, int & classifier, double & t) nogil: + * int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition) nogil: */ -static double __pyx_f_9cyext_acv_single_compute_sdp_rf(__Pyx_memviewslice &__pyx_v_x, double &__pyx_v_y_x, __Pyx_memviewslice &__pyx_v_data, __Pyx_memviewslice &__pyx_v_y_data, std::vector &__pyx_v_S, __Pyx_memviewslice &__pyx_v_features, __Pyx_memviewslice &__pyx_v_thresholds, __Pyx_memviewslice &__pyx_v_children_left, __Pyx_memviewslice &__pyx_v_children_right, int &__pyx_v_max_depth, int &__pyx_v_min_node_size, int &__pyx_v_classifier, double &__pyx_v_t) { +static double __pyx_f_9cyext_acv_single_compute_ddp_rule(__Pyx_memviewslice &__pyx_v_x, double &__pyx_v_y_x, __Pyx_memviewslice &__pyx_v_data, __Pyx_memviewslice &__pyx_v_y_data, std::vector &__pyx_v_S, __Pyx_memviewslice &__pyx_v_features, __Pyx_memviewslice &__pyx_v_thresholds, __Pyx_memviewslice &__pyx_v_children_left, __Pyx_memviewslice &__pyx_v_children_right, int &__pyx_v_max_depth, int &__pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, __Pyx_memviewslice &__pyx_v_partition) { unsigned int __pyx_v_n_trees; unsigned int __pyx_v_N; double __pyx_v_sdp; @@ -83120,7 +83394,7 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rf(__Pyx_memviewslice &__pyx int __pyx_clineno = 0; /* "cyext_acv.pyx":5410 - * int & max_depth, int & min_node_size, int & classifier, double & t) nogil: + * int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition) nogil: * * cdef unsigned int n_trees = features.shape[0] # <<<<<<<<<<<<<< * cdef unsigned int N = data.shape[0] @@ -83340,7 +83614,7 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rf(__Pyx_memviewslice &__pyx * if x[features[b, it_node]] <= thresholds[b, it_node]: * nodes_child.insert(children_left[b, it_node]) # <<<<<<<<<<<<<< * - * it = in_data.begin() + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: */ __pyx_t_14 = __pyx_v_b; __pyx_t_13 = __pyx_v_it_node; @@ -83360,13 +83634,53 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rf(__Pyx_memviewslice &__pyx /* "cyext_acv.pyx":5439 * nodes_child.insert(children_left[b, it_node]) * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 1] = thresholds[b, it_node] + * + */ + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + __pyx_t_10 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_13 * __pyx_v_features.strides[0]) ) + __pyx_t_14 * __pyx_v_features.strides[1]) ))); + __pyx_t_11 = 1; + __pyx_t_12 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_10 * __pyx_v_partition.strides[0]) ) + __pyx_t_11 * __pyx_v_partition.strides[1]) ))) >= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_12 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_15 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":5440 + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + * partition[features[b, it_node], 1] = thresholds[b, it_node] # <<<<<<<<<<<<<< + * + * it = in_data.begin() + */ + __pyx_t_15 = __pyx_v_b; + __pyx_t_12 = __pyx_v_it_node; + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_11 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_14 * __pyx_v_features.strides[0]) ) + __pyx_t_13 * __pyx_v_features.strides[1]) ))); + __pyx_t_10 = 1; + *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_11 * __pyx_v_partition.strides[0]) ) + __pyx_t_10 * __pyx_v_partition.strides[1]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_15 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_12 * __pyx_v_thresholds.strides[1]) ))); + + /* "cyext_acv.pyx":5439 + * nodes_child.insert(children_left[b, it_node]) + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 1] = thresholds[b, it_node] + * + */ + } + + /* "cyext_acv.pyx":5442 + * partition[features[b, it_node], 1] = thresholds[b, it_node] + * * it = in_data.begin() # <<<<<<<<<<<<<< * while(it != in_data.end()): * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: */ __pyx_v_it = __pyx_v_in_data.begin(); - /* "cyext_acv.pyx":5440 + /* "cyext_acv.pyx":5443 * * it = in_data.begin() * while(it != in_data.end()): # <<<<<<<<<<<<<< @@ -83377,23 +83691,23 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rf(__Pyx_memviewslice &__pyx __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); if (!__pyx_t_9) break; - /* "cyext_acv.pyx":5441 + /* "cyext_acv.pyx":5444 * it = in_data.begin() * while(it != in_data.end()): * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: # <<<<<<<<<<<<<< * in_data_b.erase(deref(it)) * inc(it) */ - __pyx_t_13 = __pyx_v_b; - __pyx_t_14 = __pyx_v_it_node; - __pyx_t_10 = (*__pyx_v_it); - __pyx_t_11 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_13 * __pyx_v_features.strides[0]) ) + __pyx_t_14 * __pyx_v_features.strides[1]) ))); __pyx_t_12 = __pyx_v_b; __pyx_t_15 = __pyx_v_it_node; - __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_data.data + __pyx_t_10 * __pyx_v_data.strides[0]) ) + __pyx_t_11 * __pyx_v_data.strides[1]) ))) > (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_12 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_15 * __pyx_v_thresholds.strides[1]) )))) != 0); + __pyx_t_13 = (*__pyx_v_it); + __pyx_t_14 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_12 * __pyx_v_features.strides[0]) ) + __pyx_t_15 * __pyx_v_features.strides[1]) ))); + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_data.data + __pyx_t_13 * __pyx_v_data.strides[0]) ) + __pyx_t_14 * __pyx_v_data.strides[1]) ))) > (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_10 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_11 * __pyx_v_thresholds.strides[1]) )))) != 0); if (__pyx_t_9) { - /* "cyext_acv.pyx":5442 + /* "cyext_acv.pyx":5445 * while(it != in_data.end()): * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: * in_data_b.erase(deref(it)) # <<<<<<<<<<<<<< @@ -83402,7 +83716,7 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rf(__Pyx_memviewslice &__pyx */ (void)(__pyx_v_in_data_b.erase((*__pyx_v_it))); - /* "cyext_acv.pyx":5441 + /* "cyext_acv.pyx":5444 * it = in_data.begin() * while(it != in_data.end()): * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: # <<<<<<<<<<<<<< @@ -83411,7 +83725,7 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rf(__Pyx_memviewslice &__pyx */ } - /* "cyext_acv.pyx":5443 + /* "cyext_acv.pyx":5446 * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: * in_data_b.erase(deref(it)) * inc(it) # <<<<<<<<<<<<<< @@ -83421,7 +83735,7 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rf(__Pyx_memviewslice &__pyx (void)((++__pyx_v_it)); } - /* "cyext_acv.pyx":5444 + /* "cyext_acv.pyx":5447 * in_data_b.erase(deref(it)) * inc(it) * in_data = in_data_b # <<<<<<<<<<<<<< @@ -83440,18 +83754,18 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rf(__Pyx_memviewslice &__pyx goto __pyx_L12; } - /* "cyext_acv.pyx":5447 + /* "cyext_acv.pyx":5450 * * else: * nodes_child.insert(children_right[b, it_node]) # <<<<<<<<<<<<<< * - * it = in_data.begin() + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: */ /*else*/ { - __pyx_t_15 = __pyx_v_b; - __pyx_t_12 = __pyx_v_it_node; + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; try { - __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_right.data + __pyx_t_15 * __pyx_v_children_right.strides[0]) ) + __pyx_t_12 * __pyx_v_children_right.strides[1]) )))); + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_right.data + __pyx_t_11 * __pyx_v_children_right.strides[0]) ) + __pyx_t_10 * __pyx_v_children_right.strides[1]) )))); } catch(...) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); @@ -83460,19 +83774,59 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rf(__Pyx_memviewslice &__pyx #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 5447, __pyx_L1_error) + __PYX_ERR(0, 5450, __pyx_L1_error) } - /* "cyext_acv.pyx":5449 + /* "cyext_acv.pyx":5452 * nodes_child.insert(children_right[b, it_node]) * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 0] = thresholds[b, it_node] + * + */ + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_15 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_10 * __pyx_v_features.strides[0]) ) + __pyx_t_11 * __pyx_v_features.strides[1]) ))); + __pyx_t_12 = 0; + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_15 * __pyx_v_partition.strides[0]) ) + __pyx_t_12 * __pyx_v_partition.strides[1]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_14 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_13 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":5453 + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: + * partition[features[b, it_node], 0] = thresholds[b, it_node] # <<<<<<<<<<<<<< + * + * it = in_data.begin() + */ + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_12 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_11 * __pyx_v_features.strides[0]) ) + __pyx_t_10 * __pyx_v_features.strides[1]) ))); + __pyx_t_15 = 0; + *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_12 * __pyx_v_partition.strides[0]) ) + __pyx_t_15 * __pyx_v_partition.strides[1]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_13 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_14 * __pyx_v_thresholds.strides[1]) ))); + + /* "cyext_acv.pyx":5452 + * nodes_child.insert(children_right[b, it_node]) + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 0] = thresholds[b, it_node] + * + */ + } + + /* "cyext_acv.pyx":5455 + * partition[features[b, it_node], 0] = thresholds[b, it_node] + * * it = in_data.begin() # <<<<<<<<<<<<<< * while(it != in_data.end()): * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: */ __pyx_v_it = __pyx_v_in_data.begin(); - /* "cyext_acv.pyx":5450 + /* "cyext_acv.pyx":5456 * * it = in_data.begin() * while(it != in_data.end()): # <<<<<<<<<<<<<< @@ -83483,23 +83837,23 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rf(__Pyx_memviewslice &__pyx __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); if (!__pyx_t_9) break; - /* "cyext_acv.pyx":5451 + /* "cyext_acv.pyx":5457 * it = in_data.begin() * while(it != in_data.end()): * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< * in_data_b.erase(deref(it)) * inc(it) */ - __pyx_t_12 = __pyx_v_b; - __pyx_t_15 = __pyx_v_it_node; - __pyx_t_14 = (*__pyx_v_it); - __pyx_t_13 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_12 * __pyx_v_features.strides[0]) ) + __pyx_t_15 * __pyx_v_features.strides[1]) ))); - __pyx_t_11 = __pyx_v_b; - __pyx_t_10 = __pyx_v_it_node; - __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_data.data + __pyx_t_14 * __pyx_v_data.strides[0]) ) + __pyx_t_13 * __pyx_v_data.strides[1]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_11 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_10 * __pyx_v_thresholds.strides[1]) )))) != 0); + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_10 = (*__pyx_v_it); + __pyx_t_11 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_14 * __pyx_v_features.strides[0]) ) + __pyx_t_13 * __pyx_v_features.strides[1]) ))); + __pyx_t_15 = __pyx_v_b; + __pyx_t_12 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_data.data + __pyx_t_10 * __pyx_v_data.strides[0]) ) + __pyx_t_11 * __pyx_v_data.strides[1]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_15 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_12 * __pyx_v_thresholds.strides[1]) )))) != 0); if (__pyx_t_9) { - /* "cyext_acv.pyx":5452 + /* "cyext_acv.pyx":5458 * while(it != in_data.end()): * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: * in_data_b.erase(deref(it)) # <<<<<<<<<<<<<< @@ -83508,7 +83862,7 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rf(__Pyx_memviewslice &__pyx */ (void)(__pyx_v_in_data_b.erase((*__pyx_v_it))); - /* "cyext_acv.pyx":5451 + /* "cyext_acv.pyx":5457 * it = in_data.begin() * while(it != in_data.end()): * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< @@ -83517,7 +83871,7 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rf(__Pyx_memviewslice &__pyx */ } - /* "cyext_acv.pyx":5453 + /* "cyext_acv.pyx":5459 * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: * in_data_b.erase(deref(it)) * inc(it) # <<<<<<<<<<<<<< @@ -83527,7 +83881,7 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rf(__Pyx_memviewslice &__pyx (void)((++__pyx_v_it)); } - /* "cyext_acv.pyx":5454 + /* "cyext_acv.pyx":5460 * in_data_b.erase(deref(it)) * inc(it) * in_data = in_data_b # <<<<<<<<<<<<<< @@ -83548,7 +83902,7 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rf(__Pyx_memviewslice &__pyx goto __pyx_L11; } - /* "cyext_acv.pyx":5456 + /* "cyext_acv.pyx":5462 * in_data = in_data_b * else: * nodes_child.insert(children_left[b, it_node]) # <<<<<<<<<<<<<< @@ -83556,10 +83910,10 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rf(__Pyx_memviewslice &__pyx * */ /*else*/ { - __pyx_t_10 = __pyx_v_b; - __pyx_t_11 = __pyx_v_it_node; + __pyx_t_12 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; try { - __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_left.data + __pyx_t_10 * __pyx_v_children_left.strides[0]) ) + __pyx_t_11 * __pyx_v_children_left.strides[1]) )))); + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_left.data + __pyx_t_12 * __pyx_v_children_left.strides[0]) ) + __pyx_t_15 * __pyx_v_children_left.strides[1]) )))); } catch(...) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); @@ -83568,20 +83922,20 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rf(__Pyx_memviewslice &__pyx #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 5456, __pyx_L1_error) + __PYX_ERR(0, 5462, __pyx_L1_error) } - /* "cyext_acv.pyx":5457 + /* "cyext_acv.pyx":5463 * else: * nodes_child.insert(children_left[b, it_node]) * nodes_child.insert(children_right[b, it_node]) # <<<<<<<<<<<<<< * * if in_data.size() < min_node_size: */ - __pyx_t_11 = __pyx_v_b; - __pyx_t_10 = __pyx_v_it_node; + __pyx_t_15 = __pyx_v_b; + __pyx_t_12 = __pyx_v_it_node; try { - __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_right.data + __pyx_t_11 * __pyx_v_children_right.strides[0]) ) + __pyx_t_10 * __pyx_v_children_right.strides[1]) )))); + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_right.data + __pyx_t_15 * __pyx_v_children_right.strides[0]) ) + __pyx_t_12 * __pyx_v_children_right.strides[1]) )))); } catch(...) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); @@ -83590,12 +83944,12 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rf(__Pyx_memviewslice &__pyx #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif - __PYX_ERR(0, 5457, __pyx_L1_error) + __PYX_ERR(0, 5463, __pyx_L1_error) } } __pyx_L11:; - /* "cyext_acv.pyx":5459 + /* "cyext_acv.pyx":5465 * nodes_child.insert(children_right[b, it_node]) * * if in_data.size() < min_node_size: # <<<<<<<<<<<<<< @@ -83605,7 +83959,7 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rf(__Pyx_memviewslice &__pyx __pyx_t_9 = ((__pyx_v_in_data.size() < __pyx_v_min_node_size) != 0); if (__pyx_t_9) { - /* "cyext_acv.pyx":5460 + /* "cyext_acv.pyx":5466 * * if in_data.size() < min_node_size: * break # <<<<<<<<<<<<<< @@ -83614,7 +83968,7 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rf(__Pyx_memviewslice &__pyx */ goto __pyx_L10_break; - /* "cyext_acv.pyx":5459 + /* "cyext_acv.pyx":5465 * nodes_child.insert(children_right[b, it_node]) * * if in_data.size() < min_node_size: # <<<<<<<<<<<<<< @@ -83623,7 +83977,7 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rf(__Pyx_memviewslice &__pyx */ } - /* "cyext_acv.pyx":5461 + /* "cyext_acv.pyx":5467 * if in_data.size() < min_node_size: * break * inc(it_point) # <<<<<<<<<<<<<< @@ -83634,7 +83988,7 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rf(__Pyx_memviewslice &__pyx } __pyx_L10_break:; - /* "cyext_acv.pyx":5463 + /* "cyext_acv.pyx":5469 * inc(it_point) * * nodes_level = nodes_child # <<<<<<<<<<<<<< @@ -83644,7 +83998,7 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rf(__Pyx_memviewslice &__pyx __pyx_v_nodes_level = __pyx_v_nodes_child; } - /* "cyext_acv.pyx":5465 + /* "cyext_acv.pyx":5471 * nodes_level = nodes_child * * if classifier == 1: # <<<<<<<<<<<<<< @@ -83654,39 +84008,39 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rf(__Pyx_memviewslice &__pyx __pyx_t_9 = ((__pyx_v_classifier == 1) != 0); if (__pyx_t_9) { - /* "cyext_acv.pyx":5466 + /* "cyext_acv.pyx":5472 * * if classifier == 1: * it = in_data.begin() # <<<<<<<<<<<<<< * while(it != in_data.end()): - * sdp += (1./(n_trees*in_data.size())) * (y_x == y_data[deref(it)]) + * sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) */ __pyx_v_it = __pyx_v_in_data.begin(); - /* "cyext_acv.pyx":5467 + /* "cyext_acv.pyx":5473 * if classifier == 1: * it = in_data.begin() * while(it != in_data.end()): # <<<<<<<<<<<<<< - * sdp += (1./(n_trees*in_data.size())) * (y_x == y_data[deref(it)]) + * sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) * inc(it) */ while (1) { __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); if (!__pyx_t_9) break; - /* "cyext_acv.pyx":5468 + /* "cyext_acv.pyx":5474 * it = in_data.begin() * while(it != in_data.end()): - * sdp += (1./(n_trees*in_data.size())) * (y_x == y_data[deref(it)]) # <<<<<<<<<<<<<< + * sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) # <<<<<<<<<<<<<< * inc(it) * else: */ - __pyx_t_10 = (*__pyx_v_it); - __pyx_v_sdp = (__pyx_v_sdp + ((1. / (__pyx_v_n_trees * __pyx_v_in_data.size())) * (__pyx_v_y_x == (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_10)) )))))); + __pyx_t_12 = (*__pyx_v_it); + __pyx_v_sdp = (__pyx_v_sdp + ((1. / (__pyx_v_n_trees * __pyx_v_in_data.size())) * (__pyx_v_y_x != (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_12)) )))))); - /* "cyext_acv.pyx":5469 + /* "cyext_acv.pyx":5475 * while(it != in_data.end()): - * sdp += (1./(n_trees*in_data.size())) * (y_x == y_data[deref(it)]) + * sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) * inc(it) # <<<<<<<<<<<<<< * else: * it = in_data.begin() @@ -83694,51 +84048,53 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rf(__Pyx_memviewslice &__pyx (void)((++__pyx_v_it)); } - /* "cyext_acv.pyx":5465 + /* "cyext_acv.pyx":5471 * nodes_level = nodes_child * * if classifier == 1: # <<<<<<<<<<<<<< * it = in_data.begin() * while(it != in_data.end()): */ - goto __pyx_L20; + goto __pyx_L22; } - /* "cyext_acv.pyx":5471 + /* "cyext_acv.pyx":5477 * inc(it) * else: * it = in_data.begin() # <<<<<<<<<<<<<< * while(it != in_data.end()): - * sdp += (1./(n_trees*in_data.size())) * ((y_x - y_data[deref(it)])*(y_x - y_data[deref(it)]) <= t) + * sdp += (1./(n_trees*in_data.size())) * (1-(t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) */ /*else*/ { __pyx_v_it = __pyx_v_in_data.begin(); - /* "cyext_acv.pyx":5472 + /* "cyext_acv.pyx":5478 * else: * it = in_data.begin() * while(it != in_data.end()): # <<<<<<<<<<<<<< - * sdp += (1./(n_trees*in_data.size())) * ((y_x - y_data[deref(it)])*(y_x - y_data[deref(it)]) <= t) + * sdp += (1./(n_trees*in_data.size())) * (1-(t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) * inc(it) */ while (1) { __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); if (!__pyx_t_9) break; - /* "cyext_acv.pyx":5473 + /* "cyext_acv.pyx":5479 * it = in_data.begin() * while(it != in_data.end()): - * sdp += (1./(n_trees*in_data.size())) * ((y_x - y_data[deref(it)])*(y_x - y_data[deref(it)]) <= t) # <<<<<<<<<<<<<< + * sdp += (1./(n_trees*in_data.size())) * (1-(t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) # <<<<<<<<<<<<<< * inc(it) * */ - __pyx_t_10 = (*__pyx_v_it); - __pyx_t_11 = (*__pyx_v_it); - __pyx_v_sdp = (__pyx_v_sdp + ((1. / (__pyx_v_n_trees * __pyx_v_in_data.size())) * (((__pyx_v_y_x - (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_10)) )))) * (__pyx_v_y_x - (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_11)) ))))) <= __pyx_v_t))); + __pyx_t_12 = 0; + __pyx_t_15 = (*__pyx_v_it); + __pyx_t_13 = (*__pyx_v_it); + __pyx_t_14 = 1; + __pyx_v_sdp = (__pyx_v_sdp + ((1. / (__pyx_v_n_trees * __pyx_v_in_data.size())) * (1 - (((*((double *) ( /* dim=0 */ (__pyx_v_t.data + __pyx_t_12 * __pyx_v_t.strides[0]) ))) <= (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_15)) )))) * ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_13)) ))) <= (*((double *) ( /* dim=0 */ (__pyx_v_t.data + __pyx_t_14 * __pyx_v_t.strides[0]) )))))))); - /* "cyext_acv.pyx":5474 + /* "cyext_acv.pyx":5480 * while(it != in_data.end()): - * sdp += (1./(n_trees*in_data.size())) * ((y_x - y_data[deref(it)])*(y_x - y_data[deref(it)]) <= t) + * sdp += (1./(n_trees*in_data.size())) * (1-(t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) * inc(it) # <<<<<<<<<<<<<< * * return sdp @@ -83746,10 +84102,10 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rf(__Pyx_memviewslice &__pyx (void)((++__pyx_v_it)); } } - __pyx_L20:; + __pyx_L22:; } - /* "cyext_acv.pyx":5476 + /* "cyext_acv.pyx":5482 * inc(it) * * return sdp # <<<<<<<<<<<<<< @@ -83762,29 +84118,31 @@ static double __pyx_f_9cyext_acv_single_compute_sdp_rf(__Pyx_memviewslice &__pyx /* "cyext_acv.pyx":5406 * @cython.nonecheck(False) * @cython.cdivision(True) - * cdef double single_compute_sdp_rf(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, # <<<<<<<<<<<<<< + * cdef double single_compute_ddp_rule(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, # <<<<<<<<<<<<<< * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, - * int & max_depth, int & min_node_size, int & classifier, double & t) nogil: + * int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition) nogil: */ /* function exit code */ __pyx_L1_error:; - __Pyx_WriteUnraisable("cyext_acv.single_compute_sdp_rf", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __Pyx_WriteUnraisable("cyext_acv.single_compute_ddp_rule", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); __pyx_r = 0; __pyx_L0:; return __pyx_r; } -/* "cyext_acv.pyx":5482 +/* "cyext_acv.pyx":5488 * @cython.nonecheck(False) * @cython.cdivision(True) - * cpdef compute_sdp_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, # <<<<<<<<<<<<<< - * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, - * int max_depth, int min_node_size, int & classifier, double & t): + * cpdef compute_ddp_rule(double[:, :] & X, double[::1] & y_X, double[:, :] & data, double[::1] & y_data, vector[vector[int]] & S, # <<<<<<<<<<<<<< + * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + * int & max_depth, int & min_node_size, int & classifier, double[:, :] & t): */ -static PyObject *__pyx_pw_9cyext_acv_83compute_sdp_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_f_9cyext_acv_compute_sdp_rf(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, double &__pyx_v_t, CYTHON_UNUSED int __pyx_skip_dispatch) { +static PyObject *__pyx_pw_9cyext_acv_83compute_ddp_rule(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_ddp_rule(__Pyx_memviewslice &__pyx_v_X, __Pyx_memviewslice &__pyx_v_y_X, __Pyx_memviewslice &__pyx_v_data, __Pyx_memviewslice &__pyx_v_y_data, std::vector > &__pyx_v_S, __Pyx_memviewslice &__pyx_v_features, __Pyx_memviewslice &__pyx_v_thresholds, __Pyx_memviewslice &__pyx_v_children_left, __Pyx_memviewslice &__pyx_v_children_right, int &__pyx_v_max_depth, int &__pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_buffer = NULL; + __Pyx_memviewslice __pyx_v_partition_byobs = { 0, 0, { 0 }, { 0 }, { 0 } }; int __pyx_v_N; __Pyx_memviewslice __pyx_v_sdp = { 0, 0, { 0 }, { 0 }, { 0 } }; int __pyx_v_i; @@ -83794,20 +84152,86 @@ static PyObject *__pyx_f_9cyext_acv_compute_sdp_rf(__Pyx_memviewslice __pyx_v_X, PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } }; - int __pyx_t_6; - int __pyx_t_7; + PyObject *__pyx_t_5 = NULL; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } }; int __pyx_t_8; - __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } }; - Py_ssize_t __pyx_t_10; - Py_ssize_t __pyx_t_11; + int __pyx_t_9; + int __pyx_t_10; + __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_12; + __Pyx_memviewslice __pyx_t_13 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_14 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_15; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("compute_sdp_rf", 0); + __Pyx_RefNannySetupContext("compute_ddp_rule", 0); - /* "cyext_acv.pyx":5486 - * int max_depth, int min_node_size, int & classifier, double & t): + /* "cyext_acv.pyx":5492 + * int & max_depth, int & min_node_size, int & classifier, double[:, :] & t): + * + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) # <<<<<<<<<<<<<< + * buffer[:, :, 0] = -1e+10 + * cdef double [:, :, :] partition_byobs = buffer + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5492, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ones); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5492, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5492, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_X.shape[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5492, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_X.shape[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5492, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5492, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_INCREF(__pyx_int_2); + __Pyx_GIVEREF(__pyx_int_2); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_2); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 5492, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5492, __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 = PyNumber_Multiply(__pyx_float_1e_10, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5492, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_buffer = __pyx_t_1; + __pyx_t_1 = 0; + + /* "cyext_acv.pyx":5493 + * + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + * buffer[:, :, 0] = -1e+10 # <<<<<<<<<<<<<< + * cdef double [:, :, :] partition_byobs = buffer + * + */ + if (unlikely(PyObject_SetItem(__pyx_v_buffer, __pyx_tuple__3, __pyx_float_neg_1e_10) < 0)) __PYX_ERR(0, 5493, __pyx_L1_error) + + /* "cyext_acv.pyx":5494 + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + * buffer[:, :, 0] = -1e+10 + * cdef double [:, :, :] partition_byobs = buffer # <<<<<<<<<<<<<< + * + * cdef int N = X.shape[0] + */ + __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_v_buffer, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 5494, __pyx_L1_error) + __pyx_v_partition_byobs = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "cyext_acv.pyx":5496 + * cdef double [:, :, :] partition_byobs = buffer * * cdef int N = X.shape[0] # <<<<<<<<<<<<<< * cdef double[::1] sdp = np.zeros(N) @@ -83815,47 +84239,47 @@ static PyObject *__pyx_f_9cyext_acv_compute_sdp_rf(__Pyx_memviewslice __pyx_v_X, */ __pyx_v_N = (__pyx_v_X.shape[0]); - /* "cyext_acv.pyx":5487 + /* "cyext_acv.pyx":5497 * * cdef int N = X.shape[0] * cdef double[::1] sdp = np.zeros(N) # <<<<<<<<<<<<<< * cdef int i - * for i in prange(N, nogil=True, schedule='dynamic'): + * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5487, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5487, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5487, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5497, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5497, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_2, function); } } - __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5487, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 5487, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 5497, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_sdp = __pyx_t_5; - __pyx_t_5.memview = NULL; - __pyx_t_5.data = NULL; + __pyx_v_sdp = __pyx_t_7; + __pyx_t_7.memview = NULL; + __pyx_t_7.data = NULL; - /* "cyext_acv.pyx":5489 - * cdef double[::1] sdp = np.zeros(N) + /* "cyext_acv.pyx":5500 * cdef int i + * * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< - * sdp[i] = single_compute_sdp_rf(X[i], y_X[i], data, y_data, S[i], + * sdp[i] = single_compute_ddp_rule(X[i], y_X[i], data, y_data, S[i], * features, thresholds, children_left, children_right, */ { @@ -83865,7 +84289,7 @@ static PyObject *__pyx_f_9cyext_acv_compute_sdp_rf(__Pyx_memviewslice __pyx_v_X, __Pyx_FastGIL_Remember(); #endif /*try:*/ { - __pyx_t_6 = __pyx_v_N; + __pyx_t_8 = __pyx_v_N; if ((1 == 0)) abort(); { #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) @@ -83874,54 +84298,98 @@ static PyObject *__pyx_f_9cyext_acv_compute_sdp_rf(__Pyx_memviewslice __pyx_v_X, #define likely(x) (x) #define unlikely(x) (x) #endif - __pyx_t_8 = (__pyx_t_6 - 0 + 1 - 1/abs(1)) / 1; - if (__pyx_t_8 > 0) + __pyx_t_10 = (__pyx_t_8 - 0 + 1 - 1/abs(1)) / 1; + if (__pyx_t_10 > 0) { #ifdef _OPENMP - #pragma omp parallel private(__pyx_t_10, __pyx_t_11) firstprivate(__pyx_t_9) + #pragma omp parallel private(__pyx_t_12, __pyx_t_15) firstprivate(__pyx_t_11, __pyx_t_13, __pyx_t_14) #endif /* _OPENMP */ { #ifdef _OPENMP #pragma omp for firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) schedule(dynamic) #endif /* _OPENMP */ - for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7++){ + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_10; __pyx_t_9++){ { - __pyx_v_i = (int)(0 + 1 * __pyx_t_7); + __pyx_v_i = (int)(0 + 1 * __pyx_t_9); - /* "cyext_acv.pyx":5490 - * cdef int i + /* "cyext_acv.pyx":5501 + * * for i in prange(N, nogil=True, schedule='dynamic'): - * sdp[i] = single_compute_sdp_rf(X[i], y_X[i], data, y_data, S[i], # <<<<<<<<<<<<<< + * sdp[i] = single_compute_ddp_rule(X[i], y_X[i], data, y_data, S[i], # <<<<<<<<<<<<<< * features, thresholds, children_left, children_right, - * max_depth, min_node_size, classifier, t) + * max_depth, min_node_size, classifier, t[i], partition_byobs[i]) */ - __pyx_t_9.data = __pyx_v_X.data; - __pyx_t_9.memview = __pyx_v_X.memview; - __PYX_INC_MEMVIEW(&__pyx_t_9, 0); + __pyx_t_11.data = __pyx_v_X.data; + __pyx_t_11.memview = __pyx_v_X.memview; + __PYX_INC_MEMVIEW(&__pyx_t_11, 0); { Py_ssize_t __pyx_tmp_idx = __pyx_v_i; Py_ssize_t __pyx_tmp_stride = __pyx_v_X.strides[0]; - __pyx_t_9.data += __pyx_tmp_idx * __pyx_tmp_stride; + __pyx_t_11.data += __pyx_tmp_idx * __pyx_tmp_stride; } -__pyx_t_9.shape[0] = __pyx_v_X.shape[1]; -__pyx_t_9.strides[0] = __pyx_v_X.strides[1]; - __pyx_t_9.suboffsets[0] = -1; +__pyx_t_11.shape[0] = __pyx_v_X.shape[1]; +__pyx_t_11.strides[0] = __pyx_v_X.strides[1]; + __pyx_t_11.suboffsets[0] = -1; -__pyx_t_10 = __pyx_v_i; +__pyx_t_12 = __pyx_v_i; - /* "cyext_acv.pyx":5492 - * sdp[i] = single_compute_sdp_rf(X[i], y_X[i], data, y_data, S[i], + /* "cyext_acv.pyx":5503 + * sdp[i] = single_compute_ddp_rule(X[i], y_X[i], data, y_data, S[i], * features, thresholds, children_left, children_right, - * max_depth, min_node_size, classifier, t) # <<<<<<<<<<<<<< - * return np.array(sdp) + * max_depth, min_node_size, classifier, t[i], partition_byobs[i]) # <<<<<<<<<<<<<< * + * return np.array(sdp), np.array(partition_byobs) */ - __pyx_t_11 = __pyx_v_i; - *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_sdp.data) + __pyx_t_11)) )) = __pyx_f_9cyext_acv_single_compute_sdp_rf(__pyx_t_9, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_10)) ))), __pyx_v_data, __pyx_v_y_data, (__pyx_v_S[__pyx_v_i]), __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t); - __PYX_XDEC_MEMVIEW(&__pyx_t_9, 0); - __pyx_t_9.memview = NULL; - __pyx_t_9.data = NULL; + __pyx_t_13.data = __pyx_v_t.data; + __pyx_t_13.memview = __pyx_v_t.memview; + __PYX_INC_MEMVIEW(&__pyx_t_13, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_t.strides[0]; + __pyx_t_13.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_13.shape[0] = __pyx_v_t.shape[1]; +__pyx_t_13.strides[0] = __pyx_v_t.strides[1]; + __pyx_t_13.suboffsets[0] = -1; + +__pyx_t_14.data = __pyx_v_partition_byobs.data; + __pyx_t_14.memview = __pyx_v_partition_byobs.memview; + __PYX_INC_MEMVIEW(&__pyx_t_14, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_partition_byobs.strides[0]; + __pyx_t_14.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_14.shape[0] = __pyx_v_partition_byobs.shape[1]; +__pyx_t_14.strides[0] = __pyx_v_partition_byobs.strides[1]; + __pyx_t_14.suboffsets[0] = -1; + +__pyx_t_14.shape[1] = __pyx_v_partition_byobs.shape[2]; +__pyx_t_14.strides[1] = __pyx_v_partition_byobs.strides[2]; + __pyx_t_14.suboffsets[1] = -1; + +__pyx_t_15 = __pyx_v_i; + + /* "cyext_acv.pyx":5501 + * + * for i in prange(N, nogil=True, schedule='dynamic'): + * sdp[i] = single_compute_ddp_rule(X[i], y_X[i], data, y_data, S[i], # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i]) + */ + *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_sdp.data) + __pyx_t_15)) )) = __pyx_f_9cyext_acv_single_compute_ddp_rule(__pyx_t_11, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_12)) ))), __pyx_v_data, __pyx_v_y_data, (__pyx_v_S[__pyx_v_i]), __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_t_13, __pyx_t_14); + __PYX_XDEC_MEMVIEW(&__pyx_t_11, 0); + __pyx_t_11.memview = NULL; + __pyx_t_11.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_13, 0); + __pyx_t_13.memview = NULL; + __pyx_t_13.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_14, 0); + __pyx_t_14.memview = NULL; + __pyx_t_14.data = NULL; } } } @@ -83935,11 +84403,11 @@ __pyx_t_10 = __pyx_v_i; #endif } - /* "cyext_acv.pyx":5489 - * cdef double[::1] sdp = np.zeros(N) + /* "cyext_acv.pyx":5500 * cdef int i + * * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< - * sdp[i] = single_compute_sdp_rf(X[i], y_X[i], data, y_data, S[i], + * sdp[i] = single_compute_ddp_rule(X[i], y_X[i], data, y_data, S[i], * features, thresholds, children_left, children_right, */ /*finally:*/ { @@ -83954,47 +84422,78 @@ __pyx_t_10 = __pyx_v_i; } } - /* "cyext_acv.pyx":5493 - * features, thresholds, children_left, children_right, - * max_depth, min_node_size, classifier, t) - * return np.array(sdp) # <<<<<<<<<<<<<< + /* "cyext_acv.pyx":5505 + * max_depth, min_node_size, classifier, t[i], partition_byobs[i]) + * + * return np.array(sdp), np.array(partition_byobs) # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5493, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5493, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_sdp, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_sdp, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5493, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); + __Pyx_DECREF_SET(__pyx_t_5, function); } } - __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5493, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_1; + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_partition_byobs, 3, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); __pyx_t_1 = 0; + __pyx_t_5 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; - /* "cyext_acv.pyx":5482 + /* "cyext_acv.pyx":5488 * @cython.nonecheck(False) * @cython.cdivision(True) - * cpdef compute_sdp_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, # <<<<<<<<<<<<<< - * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, - * int max_depth, int min_node_size, int & classifier, double & t): + * cpdef compute_ddp_rule(double[:, :] & X, double[::1] & y_X, double[:, :] & data, double[::1] & y_data, vector[vector[int]] & S, # <<<<<<<<<<<<<< + * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + * int & max_depth, int & min_node_size, int & classifier, double[:, :] & t): */ /* function exit code */ @@ -84003,11 +84502,17 @@ __pyx_t_10 = __pyx_v_i; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); - __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1); - __Pyx_AddTraceback("cyext_acv.compute_sdp_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_5); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1); + __Pyx_AddTraceback("cyext_acv.compute_ddp_rule", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_buffer); + __PYX_XDEC_MEMVIEW(&__pyx_v_partition_byobs, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_sdp, 1); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); @@ -84015,8 +84520,8 @@ __pyx_t_10 = __pyx_v_i; } /* Python wrapper */ -static PyObject *__pyx_pw_9cyext_acv_83compute_sdp_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_9cyext_acv_83compute_sdp_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_9cyext_acv_83compute_ddp_rule(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_9cyext_acv_83compute_ddp_rule(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { __Pyx_memviewslice __pyx_v_X = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_y_X = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } }; @@ -84029,13 +84534,13 @@ static PyObject *__pyx_pw_9cyext_acv_83compute_sdp_rf(PyObject *__pyx_self, PyOb int __pyx_v_max_depth; int __pyx_v_min_node_size; int __pyx_v_classifier; - double __pyx_v_t; + __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } }; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("compute_sdp_rf (wrapper)", 0); + __Pyx_RefNannySetupContext("compute_ddp_rule (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_y_X,&__pyx_n_s_data,&__pyx_n_s_y_data,&__pyx_n_s_S,&__pyx_n_s_features,&__pyx_n_s_thresholds,&__pyx_n_s_children_left,&__pyx_n_s_children_right,&__pyx_n_s_max_depth,&__pyx_n_s_min_node_size,&__pyx_n_s_classifier,&__pyx_n_s_t,0}; PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0}; @@ -84081,77 +84586,77 @@ static PyObject *__pyx_pw_9cyext_acv_83compute_sdp_rf(PyObject *__pyx_self, PyOb case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_X)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compute_sdp_rf", 1, 13, 13, 1); __PYX_ERR(0, 5482, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_ddp_rule", 1, 13, 13, 1); __PYX_ERR(0, 5488, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compute_sdp_rf", 1, 13, 13, 2); __PYX_ERR(0, 5482, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_ddp_rule", 1, 13, 13, 2); __PYX_ERR(0, 5488, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_data)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compute_sdp_rf", 1, 13, 13, 3); __PYX_ERR(0, 5482, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_ddp_rule", 1, 13, 13, 3); __PYX_ERR(0, 5488, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_S)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compute_sdp_rf", 1, 13, 13, 4); __PYX_ERR(0, 5482, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_ddp_rule", 1, 13, 13, 4); __PYX_ERR(0, 5488, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_features)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compute_sdp_rf", 1, 13, 13, 5); __PYX_ERR(0, 5482, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_ddp_rule", 1, 13, 13, 5); __PYX_ERR(0, 5488, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thresholds)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compute_sdp_rf", 1, 13, 13, 6); __PYX_ERR(0, 5482, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_ddp_rule", 1, 13, 13, 6); __PYX_ERR(0, 5488, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_left)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compute_sdp_rf", 1, 13, 13, 7); __PYX_ERR(0, 5482, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_ddp_rule", 1, 13, 13, 7); __PYX_ERR(0, 5488, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 8: if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_right)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compute_sdp_rf", 1, 13, 13, 8); __PYX_ERR(0, 5482, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_ddp_rule", 1, 13, 13, 8); __PYX_ERR(0, 5488, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 9: if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compute_sdp_rf", 1, 13, 13, 9); __PYX_ERR(0, 5482, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_ddp_rule", 1, 13, 13, 9); __PYX_ERR(0, 5488, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 10: if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_node_size)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compute_sdp_rf", 1, 13, 13, 10); __PYX_ERR(0, 5482, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_ddp_rule", 1, 13, 13, 10); __PYX_ERR(0, 5488, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 11: if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classifier)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compute_sdp_rf", 1, 13, 13, 11); __PYX_ERR(0, 5482, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_ddp_rule", 1, 13, 13, 11); __PYX_ERR(0, 5488, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 12: if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("compute_sdp_rf", 1, 13, 13, 12); __PYX_ERR(0, 5482, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_ddp_rule", 1, 13, 13, 12); __PYX_ERR(0, 5488, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_sdp_rf") < 0)) __PYX_ERR(0, 5482, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_ddp_rule") < 0)) __PYX_ERR(0, 5488, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 13) { goto __pyx_L5_argtuple_error; @@ -84170,53 +84675,54 @@ static PyObject *__pyx_pw_9cyext_acv_83compute_sdp_rf(PyObject *__pyx_self, PyOb values[11] = PyTuple_GET_ITEM(__pyx_args, 11); values[12] = PyTuple_GET_ITEM(__pyx_args, 12); } - __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 5482, __pyx_L3_error) - __pyx_v_y_X = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_X.memview)) __PYX_ERR(0, 5482, __pyx_L3_error) - __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 5482, __pyx_L3_error) - __pyx_v_y_data = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_data.memview)) __PYX_ERR(0, 5482, __pyx_L3_error) - __pyx_v_S = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_int_3e___(values[4]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5482, __pyx_L3_error) - __pyx_v_features = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_features.memview)) __PYX_ERR(0, 5483, __pyx_L3_error) - __pyx_v_thresholds = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_thresholds.memview)) __PYX_ERR(0, 5483, __pyx_L3_error) - __pyx_v_children_left = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_left.memview)) __PYX_ERR(0, 5483, __pyx_L3_error) - __pyx_v_children_right = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_right.memview)) __PYX_ERR(0, 5483, __pyx_L3_error) - __pyx_v_max_depth = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5484, __pyx_L3_error) - __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5484, __pyx_L3_error) - __pyx_v_classifier = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5484, __pyx_L3_error) - __pyx_v_t = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5484, __pyx_L3_error) + __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 5488, __pyx_L3_error) + __pyx_v_y_X = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_X.memview)) __PYX_ERR(0, 5488, __pyx_L3_error) + __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 5488, __pyx_L3_error) + __pyx_v_y_data = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_data.memview)) __PYX_ERR(0, 5488, __pyx_L3_error) + __pyx_v_S = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_int_3e___(values[4]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5488, __pyx_L3_error) + __pyx_v_features = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_features.memview)) __PYX_ERR(0, 5489, __pyx_L3_error) + __pyx_v_thresholds = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_thresholds.memview)) __PYX_ERR(0, 5489, __pyx_L3_error) + __pyx_v_children_left = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_left.memview)) __PYX_ERR(0, 5489, __pyx_L3_error) + __pyx_v_children_right = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_right.memview)) __PYX_ERR(0, 5489, __pyx_L3_error) + __pyx_v_max_depth = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5490, __pyx_L3_error) + __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5490, __pyx_L3_error) + __pyx_v_classifier = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5490, __pyx_L3_error) + __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[12], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 5490, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("compute_sdp_rf", 1, 13, 13, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5482, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_ddp_rule", 1, 13, 13, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5488, __pyx_L3_error) __pyx_L3_error:; - __Pyx_AddTraceback("cyext_acv.compute_sdp_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("cyext_acv.compute_ddp_rule", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_9cyext_acv_82compute_sdp_rf(__pyx_self, __pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t); + __pyx_r = __pyx_pf_9cyext_acv_82compute_ddp_rule(__pyx_self, __pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_9cyext_acv_82compute_sdp_rf(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, double __pyx_v_t) { +static PyObject *__pyx_pf_9cyext_acv_82compute_ddp_rule(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("compute_sdp_rf", 0); + __Pyx_RefNannySetupContext("compute_ddp_rule", 0); __Pyx_XDECREF(__pyx_r); - if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundLocalError("X"); __PYX_ERR(0, 5482, __pyx_L1_error) } - if (unlikely(!__pyx_v_y_X.memview)) { __Pyx_RaiseUnboundLocalError("y_X"); __PYX_ERR(0, 5482, __pyx_L1_error) } - if (unlikely(!__pyx_v_data.memview)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 5482, __pyx_L1_error) } - if (unlikely(!__pyx_v_y_data.memview)) { __Pyx_RaiseUnboundLocalError("y_data"); __PYX_ERR(0, 5482, __pyx_L1_error) } - if (unlikely(!__pyx_v_features.memview)) { __Pyx_RaiseUnboundLocalError("features"); __PYX_ERR(0, 5482, __pyx_L1_error) } - if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 5482, __pyx_L1_error) } - if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 5482, __pyx_L1_error) } - if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 5482, __pyx_L1_error) } - __pyx_t_1 = __pyx_f_9cyext_acv_compute_sdp_rf(__pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5482, __pyx_L1_error) + if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundLocalError("X"); __PYX_ERR(0, 5488, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_X.memview)) { __Pyx_RaiseUnboundLocalError("y_X"); __PYX_ERR(0, 5488, __pyx_L1_error) } + if (unlikely(!__pyx_v_data.memview)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 5488, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_data.memview)) { __Pyx_RaiseUnboundLocalError("y_data"); __PYX_ERR(0, 5488, __pyx_L1_error) } + if (unlikely(!__pyx_v_features.memview)) { __Pyx_RaiseUnboundLocalError("features"); __PYX_ERR(0, 5488, __pyx_L1_error) } + if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 5488, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 5488, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 5488, __pyx_L1_error) } + if (unlikely(!__pyx_v_t.memview)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 5488, __pyx_L1_error) } + __pyx_t_1 = __pyx_f_9cyext_acv_compute_ddp_rule(__pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -84225,7 +84731,7 @@ static PyObject *__pyx_pf_9cyext_acv_82compute_sdp_rf(CYTHON_UNUSED PyObject *__ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cyext_acv.compute_sdp_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("cyext_acv.compute_ddp_rule", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __PYX_XDEC_MEMVIEW(&__pyx_v_X, 1); @@ -84236,2390 +84742,32521 @@ static PyObject *__pyx_pf_9cyext_acv_82compute_sdp_rf(CYTHON_UNUSED PyObject *__ __PYX_XDEC_MEMVIEW(&__pyx_v_thresholds, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_children_left, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_children_right, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_t, 1); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "cyext_acv.pyx":5499 +/* "cyext_acv.pyx":5511 * @cython.nonecheck(False) * @cython.cdivision(True) - * cpdef compute_sdp_rf_same_set(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[int] S, # <<<<<<<<<<<<<< - * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, - * int max_depth, int min_node_size, int & classifier, double & t): + * cdef double single_compute_ddp_rule_weights(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, # <<<<<<<<<<<<<< + * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + * int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition, */ -static PyObject *__pyx_pw_9cyext_acv_85compute_sdp_rf_same_set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_f_9cyext_acv_compute_sdp_rf_same_set(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, double &__pyx_v_t, CYTHON_UNUSED int __pyx_skip_dispatch) { - int __pyx_v_N; - __Pyx_memviewslice __pyx_v_sdp = { 0, 0, { 0 }, { 0 }, { 0 } }; +static double __pyx_f_9cyext_acv_single_compute_ddp_rule_weights(__Pyx_memviewslice &__pyx_v_x, double &__pyx_v_y_x, __Pyx_memviewslice &__pyx_v_data, __Pyx_memviewslice &__pyx_v_y_data, std::vector &__pyx_v_S, __Pyx_memviewslice &__pyx_v_features, __Pyx_memviewslice &__pyx_v_thresholds, __Pyx_memviewslice &__pyx_v_children_left, __Pyx_memviewslice &__pyx_v_children_right, int &__pyx_v_max_depth, int &__pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, __Pyx_memviewslice &__pyx_v_partition, __Pyx_memviewslice &__pyx_v_w) { + unsigned int __pyx_v_n_trees; + unsigned int __pyx_v_N; + double __pyx_v_sdp; + int __pyx_v_b; + CYTHON_UNUSED int __pyx_v_level; int __pyx_v_i; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_it_node; + std::set __pyx_v_nodes_level; + std::set __pyx_v_nodes_child; + std::set __pyx_v_in_data; + std::set __pyx_v_in_data_b; + std::set ::iterator __pyx_v_it; + std::set ::iterator __pyx_v_it_point; + double __pyx_r; + unsigned int __pyx_t_1; + unsigned int __pyx_t_2; + int __pyx_t_3; + unsigned int __pyx_t_4; + unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; - __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_t_9; Py_ssize_t __pyx_t_10; Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("compute_sdp_rf_same_set", 0); - /* "cyext_acv.pyx":5503 - * int max_depth, int min_node_size, int & classifier, double & t): + /* "cyext_acv.pyx":5516 + * double[:] & w) nogil: * - * cdef int N = X.shape[0] # <<<<<<<<<<<<<< - * cdef double[::1] sdp = np.zeros(N) - * cdef int i + * cdef unsigned int n_trees = features.shape[0] # <<<<<<<<<<<<<< + * cdef unsigned int N = data.shape[0] + * cdef double s, sdp */ - __pyx_v_N = (__pyx_v_X.shape[0]); + __pyx_v_n_trees = (__pyx_v_features.shape[0]); - /* "cyext_acv.pyx":5504 + /* "cyext_acv.pyx":5517 * - * cdef int N = X.shape[0] - * cdef double[::1] sdp = np.zeros(N) # <<<<<<<<<<<<<< - * cdef int i - * for i in prange(N, nogil=True, schedule='dynamic'): + * cdef unsigned int n_trees = features.shape[0] + * cdef unsigned int N = data.shape[0] # <<<<<<<<<<<<<< + * cdef double s, sdp + * cdef int o */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - } - } - __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 5504, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_sdp = __pyx_t_5; - __pyx_t_5.memview = NULL; - __pyx_t_5.data = NULL; + __pyx_v_N = (__pyx_v_data.shape[0]); - /* "cyext_acv.pyx":5506 - * cdef double[::1] sdp = np.zeros(N) - * cdef int i - * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< - * sdp[i] = single_compute_sdp_rf(X[i], y_X[i], data, y_data, S, - * features, thresholds, children_left, children_right, + /* "cyext_acv.pyx":5520 + * cdef double s, sdp + * cdef int o + * sdp = 0 # <<<<<<<<<<<<<< + * + * cdef int b, level, i, it_node */ - { + __pyx_v_sdp = 0.0; + + /* "cyext_acv.pyx":5526 + * cdef set[int].iterator it, it_point + * + * for b in range(n_trees): # <<<<<<<<<<<<<< + * nodes_child.clear() + * nodes_level.clear() + */ + __pyx_t_1 = __pyx_v_n_trees; + __pyx_t_2 = __pyx_t_1; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_b = __pyx_t_3; + + /* "cyext_acv.pyx":5527 + * + * for b in range(n_trees): + * nodes_child.clear() # <<<<<<<<<<<<<< + * nodes_level.clear() + * nodes_level.insert(0) + */ + __pyx_v_nodes_child.clear(); + + /* "cyext_acv.pyx":5528 + * for b in range(n_trees): + * nodes_child.clear() + * nodes_level.clear() # <<<<<<<<<<<<<< + * nodes_level.insert(0) + * + */ + __pyx_v_nodes_level.clear(); + + /* "cyext_acv.pyx":5529 + * nodes_child.clear() + * nodes_level.clear() + * nodes_level.insert(0) # <<<<<<<<<<<<<< + * + * in_data.clear() + */ + try { + __pyx_v_nodes_level.insert(0); + } catch(...) { #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - __Pyx_FastGIL_Remember(); + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif - /*try:*/ { - __pyx_t_6 = __pyx_v_N; - if ((1 == 0)) abort(); - { - #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) - #undef likely - #undef unlikely - #define likely(x) (x) - #define unlikely(x) (x) - #endif - __pyx_t_8 = (__pyx_t_6 - 0 + 1 - 1/abs(1)) / 1; - if (__pyx_t_8 > 0) - { - #ifdef _OPENMP - #pragma omp parallel private(__pyx_t_10, __pyx_t_11) firstprivate(__pyx_t_9) - #endif /* _OPENMP */ - { - #ifdef _OPENMP - #pragma omp for firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) schedule(dynamic) - #endif /* _OPENMP */ - for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7++){ - { - __pyx_v_i = (int)(0 + 1 * __pyx_t_7); + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 5529, __pyx_L1_error) + } - /* "cyext_acv.pyx":5507 - * cdef int i - * for i in prange(N, nogil=True, schedule='dynamic'): - * sdp[i] = single_compute_sdp_rf(X[i], y_X[i], data, y_data, S, # <<<<<<<<<<<<<< - * features, thresholds, children_left, children_right, - * max_depth, min_node_size, classifier, t) + /* "cyext_acv.pyx":5531 + * nodes_level.insert(0) + * + * in_data.clear() # <<<<<<<<<<<<<< + * in_data_b.clear() + * for i in range(N): */ - __pyx_t_9.data = __pyx_v_X.data; - __pyx_t_9.memview = __pyx_v_X.memview; - __PYX_INC_MEMVIEW(&__pyx_t_9, 0); - { - Py_ssize_t __pyx_tmp_idx = __pyx_v_i; - Py_ssize_t __pyx_tmp_stride = __pyx_v_X.strides[0]; - __pyx_t_9.data += __pyx_tmp_idx * __pyx_tmp_stride; -} + __pyx_v_in_data.clear(); -__pyx_t_9.shape[0] = __pyx_v_X.shape[1]; -__pyx_t_9.strides[0] = __pyx_v_X.strides[1]; - __pyx_t_9.suboffsets[0] = -1; + /* "cyext_acv.pyx":5532 + * + * in_data.clear() + * in_data_b.clear() # <<<<<<<<<<<<<< + * for i in range(N): + * in_data.insert(i) + */ + __pyx_v_in_data_b.clear(); -__pyx_t_10 = __pyx_v_i; + /* "cyext_acv.pyx":5533 + * in_data.clear() + * in_data_b.clear() + * for i in range(N): # <<<<<<<<<<<<<< + * in_data.insert(i) + * in_data_b.insert(i) + */ + __pyx_t_4 = __pyx_v_N; + __pyx_t_5 = __pyx_t_4; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; - /* "cyext_acv.pyx":5509 - * sdp[i] = single_compute_sdp_rf(X[i], y_X[i], data, y_data, S, - * features, thresholds, children_left, children_right, - * max_depth, min_node_size, classifier, t) # <<<<<<<<<<<<<< - * return np.array(sdp) + /* "cyext_acv.pyx":5534 + * in_data_b.clear() + * for i in range(N): + * in_data.insert(i) # <<<<<<<<<<<<<< + * in_data_b.insert(i) * */ - __pyx_t_11 = __pyx_v_i; - *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_sdp.data) + __pyx_t_11)) )) = __pyx_f_9cyext_acv_single_compute_sdp_rf(__pyx_t_9, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_10)) ))), __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t); - __PYX_XDEC_MEMVIEW(&__pyx_t_9, 0); - __pyx_t_9.memview = NULL; - __pyx_t_9.data = NULL; - } - } - } - } - } - #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) - #undef likely - #undef unlikely - #define likely(x) __builtin_expect(!!(x), 1) - #define unlikely(x) __builtin_expect(!!(x), 0) + try { + __pyx_v_in_data.insert(__pyx_v_i); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 5534, __pyx_L1_error) } - /* "cyext_acv.pyx":5506 - * cdef double[::1] sdp = np.zeros(N) - * cdef int i - * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< - * sdp[i] = single_compute_sdp_rf(X[i], y_X[i], data, y_data, S, - * features, thresholds, children_left, children_right, + /* "cyext_acv.pyx":5535 + * for i in range(N): + * in_data.insert(i) + * in_data_b.insert(i) # <<<<<<<<<<<<<< + * + * for level in range(max_depth): */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - __Pyx_FastGIL_Forget(); - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; + try { + __pyx_v_in_data_b.insert(__pyx_v_i); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 5535, __pyx_L1_error) } - } + } - /* "cyext_acv.pyx":5510 - * features, thresholds, children_left, children_right, - * max_depth, min_node_size, classifier, t) - * return np.array(sdp) # <<<<<<<<<<<<<< - * + /* "cyext_acv.pyx":5537 + * in_data_b.insert(i) * + * for level in range(max_depth): # <<<<<<<<<<<<<< + * it_point = nodes_level.begin() + * while(it_point != nodes_level.end()): */ - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5510, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5510, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_sdp, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5510, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5510, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_6 = __pyx_v_max_depth; + __pyx_t_7 = __pyx_t_6; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_level = __pyx_t_8; - /* "cyext_acv.pyx":5499 - * @cython.nonecheck(False) - * @cython.cdivision(True) - * cpdef compute_sdp_rf_same_set(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[int] S, # <<<<<<<<<<<<<< - * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, - * int max_depth, int min_node_size, int & classifier, double & t): + /* "cyext_acv.pyx":5538 + * + * for level in range(max_depth): + * it_point = nodes_level.begin() # <<<<<<<<<<<<<< + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) */ + __pyx_v_it_point = __pyx_v_nodes_level.begin(); - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); - __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1); - __Pyx_AddTraceback("cyext_acv.compute_sdp_rf_same_set", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __PYX_XDEC_MEMVIEW(&__pyx_v_sdp, 1); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "cyext_acv.pyx":5539 + * for level in range(max_depth): + * it_point = nodes_level.begin() + * while(it_point != nodes_level.end()): # <<<<<<<<<<<<<< + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it_point != __pyx_v_nodes_level.end()) != 0); + if (!__pyx_t_9) break; -/* Python wrapper */ -static PyObject *__pyx_pw_9cyext_acv_85compute_sdp_rf_same_set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_9cyext_acv_85compute_sdp_rf_same_set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - __Pyx_memviewslice __pyx_v_X = { 0, 0, { 0 }, { 0 }, { 0 } }; - __Pyx_memviewslice __pyx_v_y_X = { 0, 0, { 0 }, { 0 }, { 0 } }; - __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } }; - __Pyx_memviewslice __pyx_v_y_data = { 0, 0, { 0 }, { 0 }, { 0 } }; - std::vector __pyx_v_S; - __Pyx_memviewslice __pyx_v_features = { 0, 0, { 0 }, { 0 }, { 0 } }; - __Pyx_memviewslice __pyx_v_thresholds = { 0, 0, { 0 }, { 0 }, { 0 } }; - __Pyx_memviewslice __pyx_v_children_left = { 0, 0, { 0 }, { 0 }, { 0 } }; - __Pyx_memviewslice __pyx_v_children_right = { 0, 0, { 0 }, { 0 }, { 0 } }; - int __pyx_v_max_depth; - int __pyx_v_min_node_size; - int __pyx_v_classifier; - double __pyx_v_t; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("compute_sdp_rf_same_set (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_y_X,&__pyx_n_s_data,&__pyx_n_s_y_data,&__pyx_n_s_S,&__pyx_n_s_features,&__pyx_n_s_thresholds,&__pyx_n_s_children_left,&__pyx_n_s_children_right,&__pyx_n_s_max_depth,&__pyx_n_s_min_node_size,&__pyx_n_s_classifier,&__pyx_n_s_t,0}; - PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); - CYTHON_FALLTHROUGH; - case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); - CYTHON_FALLTHROUGH; - case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); - CYTHON_FALLTHROUGH; - case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); - CYTHON_FALLTHROUGH; - case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); - CYTHON_FALLTHROUGH; - case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); - CYTHON_FALLTHROUGH; - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - CYTHON_FALLTHROUGH; - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - CYTHON_FALLTHROUGH; - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_X)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("compute_sdp_rf_same_set", 1, 13, 13, 1); __PYX_ERR(0, 5499, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("compute_sdp_rf_same_set", 1, 13, 13, 2); __PYX_ERR(0, 5499, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_data)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("compute_sdp_rf_same_set", 1, 13, 13, 3); __PYX_ERR(0, 5499, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_S)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("compute_sdp_rf_same_set", 1, 13, 13, 4); __PYX_ERR(0, 5499, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 5: - if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_features)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("compute_sdp_rf_same_set", 1, 13, 13, 5); __PYX_ERR(0, 5499, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 6: - if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thresholds)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("compute_sdp_rf_same_set", 1, 13, 13, 6); __PYX_ERR(0, 5499, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 7: - if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_left)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("compute_sdp_rf_same_set", 1, 13, 13, 7); __PYX_ERR(0, 5499, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 8: - if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_right)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("compute_sdp_rf_same_set", 1, 13, 13, 8); __PYX_ERR(0, 5499, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 9: - if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("compute_sdp_rf_same_set", 1, 13, 13, 9); __PYX_ERR(0, 5499, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 10: - if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_node_size)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("compute_sdp_rf_same_set", 1, 13, 13, 10); __PYX_ERR(0, 5499, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 11: - if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classifier)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("compute_sdp_rf_same_set", 1, 13, 13, 11); __PYX_ERR(0, 5499, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 12: - if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("compute_sdp_rf_same_set", 1, 13, 13, 12); __PYX_ERR(0, 5499, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_sdp_rf_same_set") < 0)) __PYX_ERR(0, 5499, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 13) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - values[7] = PyTuple_GET_ITEM(__pyx_args, 7); - values[8] = PyTuple_GET_ITEM(__pyx_args, 8); - values[9] = PyTuple_GET_ITEM(__pyx_args, 9); - values[10] = PyTuple_GET_ITEM(__pyx_args, 10); - values[11] = PyTuple_GET_ITEM(__pyx_args, 11); - values[12] = PyTuple_GET_ITEM(__pyx_args, 12); - } - __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 5499, __pyx_L3_error) - __pyx_v_y_X = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_X.memview)) __PYX_ERR(0, 5499, __pyx_L3_error) - __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 5499, __pyx_L3_error) - __pyx_v_y_data = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_data.memview)) __PYX_ERR(0, 5499, __pyx_L3_error) - __pyx_v_S = __pyx_convert_vector_from_py_int(values[4]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5499, __pyx_L3_error) - __pyx_v_features = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_features.memview)) __PYX_ERR(0, 5500, __pyx_L3_error) - __pyx_v_thresholds = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_thresholds.memview)) __PYX_ERR(0, 5500, __pyx_L3_error) - __pyx_v_children_left = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_left.memview)) __PYX_ERR(0, 5500, __pyx_L3_error) - __pyx_v_children_right = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_right.memview)) __PYX_ERR(0, 5500, __pyx_L3_error) - __pyx_v_max_depth = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5501, __pyx_L3_error) - __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5501, __pyx_L3_error) - __pyx_v_classifier = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5501, __pyx_L3_error) - __pyx_v_t = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5501, __pyx_L3_error) - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("compute_sdp_rf_same_set", 1, 13, 13, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5499, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("cyext_acv.compute_sdp_rf_same_set", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_9cyext_acv_84compute_sdp_rf_same_set(__pyx_self, __pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t); + /* "cyext_acv.pyx":5540 + * it_point = nodes_level.begin() + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) # <<<<<<<<<<<<<< + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * if x[features[b, it_node]] <= thresholds[b, it_node]: + */ + __pyx_v_it_node = (*__pyx_v_it_point); - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "cyext_acv.pyx":5541 + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): # <<<<<<<<<<<<<< + * if x[features[b, it_node]] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) + */ + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_9 = ((std::find ::iterator,int>(__pyx_v_S.begin(), __pyx_v_S.end(), (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_10 * __pyx_v_features.strides[0]) ) + __pyx_t_11 * __pyx_v_features.strides[1]) )))) != __pyx_v_S.end()) != 0); + if (__pyx_t_9) { -static PyObject *__pyx_pf_9cyext_acv_84compute_sdp_rf_same_set(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, double __pyx_v_t) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("compute_sdp_rf_same_set", 0); - __Pyx_XDECREF(__pyx_r); - if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundLocalError("X"); __PYX_ERR(0, 5499, __pyx_L1_error) } - if (unlikely(!__pyx_v_y_X.memview)) { __Pyx_RaiseUnboundLocalError("y_X"); __PYX_ERR(0, 5499, __pyx_L1_error) } - if (unlikely(!__pyx_v_data.memview)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 5499, __pyx_L1_error) } - if (unlikely(!__pyx_v_y_data.memview)) { __Pyx_RaiseUnboundLocalError("y_data"); __PYX_ERR(0, 5499, __pyx_L1_error) } - if (unlikely(!__pyx_v_features.memview)) { __Pyx_RaiseUnboundLocalError("features"); __PYX_ERR(0, 5499, __pyx_L1_error) } - if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 5499, __pyx_L1_error) } - if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 5499, __pyx_L1_error) } - if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 5499, __pyx_L1_error) } - __pyx_t_1 = __pyx_f_9cyext_acv_compute_sdp_rf_same_set(__pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cyext_acv.compute_sdp_rf_same_set", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __PYX_XDEC_MEMVIEW(&__pyx_v_X, 1); - __PYX_XDEC_MEMVIEW(&__pyx_v_y_X, 1); - __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1); - __PYX_XDEC_MEMVIEW(&__pyx_v_y_data, 1); - __PYX_XDEC_MEMVIEW(&__pyx_v_features, 1); - __PYX_XDEC_MEMVIEW(&__pyx_v_thresholds, 1); - __PYX_XDEC_MEMVIEW(&__pyx_v_children_left, 1); - __PYX_XDEC_MEMVIEW(&__pyx_v_children_right, 1); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "cyext_acv.pyx":5517 - * @cython.nonecheck(False) - * @cython.cdivision(True) - * cpdef global_sdp_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, # <<<<<<<<<<<<<< - * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, - * int max_depth, int min_node_size, int & classifier, double & t, list C, double pi_level, + /* "cyext_acv.pyx":5542 + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * if x[features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * */ + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_12 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_11 * __pyx_v_features.strides[0]) ) + __pyx_t_10 * __pyx_v_features.strides[1]) ))); + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_12 * __pyx_v_x.strides[0]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_13 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_14 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { -static PyObject *__pyx_pw_9cyext_acv_87global_sdp_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_f_9cyext_acv_global_sdp_rf(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, double &__pyx_v_t, PyObject *__pyx_v_C, double __pyx_v_pi_level, int __pyx_v_minimal, int __pyx_v_stop, PyObject *__pyx_v_search_space, CYTHON_UNUSED int __pyx_skip_dispatch) { - unsigned int __pyx_v_N; - unsigned int __pyx_v_m; - __Pyx_memviewslice __pyx_v_sdp = { 0, 0, { 0 }, { 0 }, { 0 } }; - __Pyx_memviewslice __pyx_v_sdp_b = { 0, 0, { 0 }, { 0 }, { 0 } }; - __Pyx_memviewslice __pyx_v_sdp_ba = { 0, 0, { 0 }, { 0 }, { 0 } }; - __Pyx_memviewslice __pyx_v_sdp_global = { 0, 0, { 0 }, { 0 }, { 0 } }; - __Pyx_memviewslice __pyx_v_in_data = { 0, 0, { 0 }, { 0 }, { 0 } }; - int __pyx_v_i; - int __pyx_v_s; - int __pyx_v_s_0; - int __pyx_v_s_1; - int __pyx_v_S_size; - int __pyx_v_max_size; - int __pyx_v_size; - std::vector __pyx_v_S; - std::vector __pyx_v_len_s_star; - PyObject *__pyx_v_power = 0; - PyObject *__pyx_v_va_id = 0; - std::vector __pyx_v_R; - std::vector __pyx_v_r; - __Pyx_memviewslice __pyx_v_R_buf = { 0, 0, { 0 }, { 0 }, { 0 } }; - PyObject *__pyx_v_X_arr = NULL; - PyObject *__pyx_v_y_X_arr = NULL; - PyObject *__pyx_v_remove_va = NULL; - Py_ssize_t __pyx_v_ci; - Py_ssize_t __pyx_v_cj; - PyObject *__pyx_v_power_b = NULL; - PyObject *__pyx_v_co = NULL; - std::vector > > __pyx_v_power_cpp; - __Pyx_memviewslice __pyx_v_s_star = { 0, 0, { 0 }, { 0 }, { 0 } }; - CYTHON_UNUSED long __pyx_v_power_set_size; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } }; - PyObject *__pyx_t_6 = NULL; - std::vector __pyx_t_7; - unsigned int __pyx_t_8; - unsigned int __pyx_t_9; - int __pyx_t_10; - __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } }; - int __pyx_t_12; - Py_ssize_t __pyx_t_13; - Py_ssize_t __pyx_t_14; - Py_ssize_t __pyx_t_15; - Py_ssize_t __pyx_t_16; - Py_ssize_t __pyx_t_17; - Py_ssize_t __pyx_t_18; - int __pyx_t_19; - long __pyx_t_20; - long __pyx_t_21; - int __pyx_t_22; - PyObject *(*__pyx_t_23)(PyObject *); - PyObject *__pyx_t_24 = NULL; - int __pyx_t_25; - std::vector > > __pyx_t_26; - __Pyx_memviewslice __pyx_t_27 = { 0, 0, { 0 }, { 0 }, { 0 } }; - std::vector > ::size_type __pyx_t_28; - std::vector > ::size_type __pyx_t_29; - std::vector ::size_type __pyx_t_30; - std::vector ::size_type __pyx_t_31; - Py_ssize_t __pyx_t_32; - Py_ssize_t __pyx_t_33; - __Pyx_memviewslice __pyx_t_34 = { 0, 0, { 0 }, { 0 }, { 0 } }; - __Pyx_memviewslice __pyx_t_35 = { 0, 0, { 0 }, { 0 }, { 0 } }; - Py_ssize_t __pyx_t_36; - Py_ssize_t __pyx_t_37; - int __pyx_t_38; - int __pyx_t_39; - int __pyx_t_40; - PyObject *__pyx_t_41 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("global_sdp_rf", 0); + /* "cyext_acv.pyx":5543 + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * if x[features[b, it_node]] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) # <<<<<<<<<<<<<< + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + */ + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_left.data + __pyx_t_14 * __pyx_v_children_left.strides[0]) ) + __pyx_t_13 * __pyx_v_children_left.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 5543, __pyx_L1_error) + } - /* "cyext_acv.pyx":5522 - * int minimal, bint stop, list search_space): + /* "cyext_acv.pyx":5545 + * nodes_child.insert(children_left[b, it_node]) * - * cdef unsigned int N = X.shape[0] # <<<<<<<<<<<<<< - * cdef unsigned int m = X.shape[1] + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 1] = thresholds[b, it_node] * */ - __pyx_v_N = (__pyx_v_X.shape[0]); + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + __pyx_t_10 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_13 * __pyx_v_features.strides[0]) ) + __pyx_t_14 * __pyx_v_features.strides[1]) ))); + __pyx_t_11 = 1; + __pyx_t_12 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_10 * __pyx_v_partition.strides[0]) ) + __pyx_t_11 * __pyx_v_partition.strides[1]) ))) >= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_12 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_15 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { - /* "cyext_acv.pyx":5523 + /* "cyext_acv.pyx":5546 * - * cdef unsigned int N = X.shape[0] - * cdef unsigned int m = X.shape[1] # <<<<<<<<<<<<<< + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + * partition[features[b, it_node], 1] = thresholds[b, it_node] # <<<<<<<<<<<<<< * - * cdef double[:] sdp, sdp_b, sdp_ba + * it = in_data.begin() */ - __pyx_v_m = (__pyx_v_X.shape[1]); + __pyx_t_15 = __pyx_v_b; + __pyx_t_12 = __pyx_v_it_node; + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_11 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_14 * __pyx_v_features.strides[0]) ) + __pyx_t_13 * __pyx_v_features.strides[1]) ))); + __pyx_t_10 = 1; + *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_11 * __pyx_v_partition.strides[0]) ) + __pyx_t_10 * __pyx_v_partition.strides[1]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_15 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_12 * __pyx_v_thresholds.strides[1]) ))); - /* "cyext_acv.pyx":5528 - * cdef double[:] sdp_global - * cdef double[:] in_data - * sdp = np.zeros((N)) # <<<<<<<<<<<<<< - * sdp_b = np.zeros((N)) - * sdp_global = np.zeros((m)) + /* "cyext_acv.pyx":5545 + * nodes_child.insert(children_left[b, it_node]) + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 1] = thresholds[b, it_node] + * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5528, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5528, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5528, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - } - } - __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5528, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 5528, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_sdp = __pyx_t_5; - __pyx_t_5.memview = NULL; - __pyx_t_5.data = NULL; + } - /* "cyext_acv.pyx":5529 - * cdef double[:] in_data - * sdp = np.zeros((N)) - * sdp_b = np.zeros((N)) # <<<<<<<<<<<<<< - * sdp_global = np.zeros((m)) - * in_data = np.zeros(N) + /* "cyext_acv.pyx":5548 + * partition[features[b, it_node], 1] = thresholds[b, it_node] + * + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5529, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5529, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5529, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5529, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 5529, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_sdp_b = __pyx_t_5; - __pyx_t_5.memview = NULL; - __pyx_t_5.data = NULL; + __pyx_v_it = __pyx_v_in_data.begin(); - /* "cyext_acv.pyx":5530 - * sdp = np.zeros((N)) - * sdp_b = np.zeros((N)) - * sdp_global = np.zeros((m)) # <<<<<<<<<<<<<< - * in_data = np.zeros(N) + /* "cyext_acv.pyx":5549 * + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5530, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5530, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_m); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5530, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - } - } - __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5530, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 5530, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_sdp_global = __pyx_t_5; - __pyx_t_5.memview = NULL; - __pyx_t_5.data = NULL; + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; - /* "cyext_acv.pyx":5531 - * sdp_b = np.zeros((N)) - * sdp_global = np.zeros((m)) - * in_data = np.zeros(N) # <<<<<<<<<<<<<< - * - * cdef unsigned int it, it_s, a_it, b_it, o_all, p, p_s, nb_leaf, p_u, p_d, p_su, p_sd, down, up + /* "cyext_acv.pyx":5550 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5531, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5531, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5531, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5531, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 5531, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_in_data = __pyx_t_5; - __pyx_t_5.memview = NULL; - __pyx_t_5.data = NULL; + __pyx_t_12 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_13 = (*__pyx_v_it); + __pyx_t_14 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_12 * __pyx_v_features.strides[0]) ) + __pyx_t_15 * __pyx_v_features.strides[1]) ))); + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_data.data + __pyx_t_13 * __pyx_v_data.strides[0]) ) + __pyx_t_14 * __pyx_v_data.strides[1]) ))) > (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_10 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_11 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { - /* "cyext_acv.pyx":5538 - * - * cdef vector[int] S, len_s_star - * len_s_star = np.zeros((N), dtype=np.int) # <<<<<<<<<<<<<< - * - * cdef list power, va_id + /* "cyext_acv.pyx":5551 + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) # <<<<<<<<<<<<<< + * inc(it) + * in_data = in_data_b */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5538, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5538, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5538, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5538, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5538, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5538, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5538, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 5538, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5538, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __pyx_convert_vector_from_py_int(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5538, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_v_len_s_star = __pyx_t_7; + (void)(__pyx_v_in_data_b.erase((*__pyx_v_it))); - /* "cyext_acv.pyx":5543 - * - * cdef vector[long] R, r - * R.resize(N) # <<<<<<<<<<<<<< - * for i in range(N): - * R[i] = i + /* "cyext_acv.pyx":5550 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) */ - try { - __pyx_v_R.resize(__pyx_v_N); - } catch(...) { - __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 5543, __pyx_L1_error) - } + } - /* "cyext_acv.pyx":5544 - * cdef vector[long] R, r - * R.resize(N) - * for i in range(N): # <<<<<<<<<<<<<< - * R[i] = i - * r.resize(N) + /* "cyext_acv.pyx":5552 + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + * inc(it) # <<<<<<<<<<<<<< + * in_data = in_data_b + * */ - __pyx_t_8 = __pyx_v_N; - __pyx_t_9 = __pyx_t_8; - for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { - __pyx_v_i = __pyx_t_10; + (void)((++__pyx_v_it)); + } - /* "cyext_acv.pyx":5545 - * R.resize(N) - * for i in range(N): - * R[i] = i # <<<<<<<<<<<<<< - * r.resize(N) + /* "cyext_acv.pyx":5553 + * in_data_b.erase(deref(it)) + * inc(it) + * in_data = in_data_b # <<<<<<<<<<<<<< * + * else: */ - (__pyx_v_R[__pyx_v_i]) = __pyx_v_i; - } + __pyx_v_in_data = __pyx_v_in_data_b; - /* "cyext_acv.pyx":5546 - * for i in range(N): - * R[i] = i - * r.resize(N) # <<<<<<<<<<<<<< + /* "cyext_acv.pyx":5542 + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * if x[features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) * - * cdef long[:] R_buf */ - try { - __pyx_v_r.resize(__pyx_v_N); - } catch(...) { - __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 5546, __pyx_L1_error) - } + goto __pyx_L12; + } - /* "cyext_acv.pyx":5549 + /* "cyext_acv.pyx":5556 * - * cdef long[:] R_buf - * R_buf = np.zeros((N), dtype=np.int) # <<<<<<<<<<<<<< + * else: + * nodes_child.insert(children_right[b, it_node]) # <<<<<<<<<<<<<< * - * X_arr = np.array(X, dtype=np.double) + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5549, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5549, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5549, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5549, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5549, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5549, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5549, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 5549, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5549, __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(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_long(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 5549, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_R_buf = __pyx_t_11; - __pyx_t_11.memview = NULL; - __pyx_t_11.data = NULL; + /*else*/ { + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_right.data + __pyx_t_11 * __pyx_v_children_right.strides[0]) ) + __pyx_t_10 * __pyx_v_children_right.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 5556, __pyx_L1_error) + } - /* "cyext_acv.pyx":5551 - * R_buf = np.zeros((N), dtype=np.int) + /* "cyext_acv.pyx":5558 + * nodes_child.insert(children_right[b, it_node]) * - * X_arr = np.array(X, dtype=np.double) # <<<<<<<<<<<<<< - * y_X_arr = np.array(y_X, dtype=np.double) + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 0] = thresholds[b, it_node] * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_X, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_double); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 5551, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_X_arr = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_15 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_10 * __pyx_v_features.strides[0]) ) + __pyx_t_11 * __pyx_v_features.strides[1]) ))); + __pyx_t_12 = 0; + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_15 * __pyx_v_partition.strides[0]) ) + __pyx_t_12 * __pyx_v_partition.strides[1]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_14 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_13 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { - /* "cyext_acv.pyx":5552 + /* "cyext_acv.pyx":5559 * - * X_arr = np.array(X, dtype=np.double) - * y_X_arr = np.array(y_X, dtype=np.double) # <<<<<<<<<<<<<< + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: + * partition[features[b, it_node], 0] = thresholds[b, it_node] # <<<<<<<<<<<<<< * - * if C[0] != []: + * it = in_data.begin() */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5552, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5552, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_y_X, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5552, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5552, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5552, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5552, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_double); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5552, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 5552, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5552, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_y_X_arr = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_12 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_11 * __pyx_v_features.strides[0]) ) + __pyx_t_10 * __pyx_v_features.strides[1]) ))); + __pyx_t_15 = 0; + *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_12 * __pyx_v_partition.strides[0]) ) + __pyx_t_15 * __pyx_v_partition.strides[1]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_13 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_14 * __pyx_v_thresholds.strides[1]) ))); - /* "cyext_acv.pyx":5554 - * y_X_arr = np.array(y_X, dtype=np.double) + /* "cyext_acv.pyx":5558 + * nodes_child.insert(children_right[b, it_node]) + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 0] = thresholds[b, it_node] * - * if C[0] != []: # <<<<<<<<<<<<<< - * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] - * va_id = [[i] for i in search_space if i not in remove_va] */ - if (unlikely(__pyx_v_C == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 5554, __pyx_L1_error) - } - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5554, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(PyList_GET_ITEM(__pyx_v_C, 0), __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5554, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 5554, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_12) { + } - /* "cyext_acv.pyx":5555 + /* "cyext_acv.pyx":5561 + * partition[features[b, it_node], 0] = thresholds[b, it_node] * - * if C[0] != []: - * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] # <<<<<<<<<<<<<< - * va_id = [[i] for i in search_space if i not in remove_va] - * for ci in range(len(C)): + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5555, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__pyx_v_C == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 5555, __pyx_L1_error) - } - __pyx_t_13 = PyList_GET_SIZE(__pyx_v_C); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5555, __pyx_L1_error) - __pyx_t_14 = __pyx_t_13; - for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { - __pyx_v_ci = __pyx_t_15; - if (unlikely(__pyx_v_C == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 5555, __pyx_L1_error) - } - __pyx_t_1 = PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci); - __Pyx_INCREF(__pyx_t_1); - __pyx_t_16 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5555, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_17 = __pyx_t_16; - for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { - __pyx_v_cj = __pyx_t_18; - if (unlikely(__pyx_v_C == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 5555, __pyx_L1_error) - } - __pyx_t_1 = __Pyx_GetItemInt(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci), __pyx_v_cj, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5555, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 5555, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - } - __pyx_v_remove_va = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; + __pyx_v_it = __pyx_v_in_data.begin(); - /* "cyext_acv.pyx":5556 - * if C[0] != []: - * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] - * va_id = [[i] for i in search_space if i not in remove_va] # <<<<<<<<<<<<<< - * for ci in range(len(C)): - * i = 0 + /* "cyext_acv.pyx":5562 + * + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__pyx_v_search_space == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 5556, __pyx_L1_error) - } - __pyx_t_1 = __pyx_v_search_space; __Pyx_INCREF(__pyx_t_1); __pyx_t_13 = 0; - for (;;) { - if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 5556, __pyx_L1_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5556, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_i = __pyx_t_10; - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_t_3, __pyx_v_remove_va, Py_NE)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 5556, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_19 = (__pyx_t_12 != 0); - if (__pyx_t_19) { - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_3); - PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); - __pyx_t_3 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 5556, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_va_id = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; - /* "cyext_acv.pyx":5557 - * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] - * va_id = [[i] for i in search_space if i not in remove_va] - * for ci in range(len(C)): # <<<<<<<<<<<<<< - * i = 0 - * for cj in range(len(C[ci])): + /* "cyext_acv.pyx":5563 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) */ - if (unlikely(__pyx_v_C == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 5557, __pyx_L1_error) - } - __pyx_t_13 = PyList_GET_SIZE(__pyx_v_C); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5557, __pyx_L1_error) - __pyx_t_14 = __pyx_t_13; - for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { - __pyx_v_ci = __pyx_t_15; + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_10 = (*__pyx_v_it); + __pyx_t_11 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_14 * __pyx_v_features.strides[0]) ) + __pyx_t_13 * __pyx_v_features.strides[1]) ))); + __pyx_t_15 = __pyx_v_b; + __pyx_t_12 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_data.data + __pyx_t_10 * __pyx_v_data.strides[0]) ) + __pyx_t_11 * __pyx_v_data.strides[1]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_15 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_12 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { - /* "cyext_acv.pyx":5558 - * va_id = [[i] for i in search_space if i not in remove_va] - * for ci in range(len(C)): - * i = 0 # <<<<<<<<<<<<<< - * for cj in range(len(C[ci])): - * if C[ci][cj] in search_space: + /* "cyext_acv.pyx":5564 + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) # <<<<<<<<<<<<<< + * inc(it) + * in_data = in_data_b */ - __pyx_v_i = 0; + (void)(__pyx_v_in_data_b.erase((*__pyx_v_it))); - /* "cyext_acv.pyx":5559 - * for ci in range(len(C)): - * i = 0 - * for cj in range(len(C[ci])): # <<<<<<<<<<<<<< - * if C[ci][cj] in search_space: - * i += 1 + /* "cyext_acv.pyx":5563 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) */ - if (unlikely(__pyx_v_C == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 5559, __pyx_L1_error) - } - __pyx_t_2 = PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci); - __Pyx_INCREF(__pyx_t_2); - __pyx_t_16 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5559, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_17 = __pyx_t_16; - for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { - __pyx_v_cj = __pyx_t_18; + } - /* "cyext_acv.pyx":5560 - * i = 0 - * for cj in range(len(C[ci])): - * if C[ci][cj] in search_space: # <<<<<<<<<<<<<< - * i += 1 - * break + /* "cyext_acv.pyx":5565 + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + * inc(it) # <<<<<<<<<<<<<< + * in_data = in_data_b + * else: */ - if (unlikely(__pyx_v_C == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 5560, __pyx_L1_error) - } - __pyx_t_2 = __Pyx_GetItemInt(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci), __pyx_v_cj, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5560, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_19 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_v_search_space, Py_EQ)); if (unlikely(__pyx_t_19 < 0)) __PYX_ERR(0, 5560, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_12 = (__pyx_t_19 != 0); - if (__pyx_t_12) { + (void)((++__pyx_v_it)); + } - /* "cyext_acv.pyx":5561 - * for cj in range(len(C[ci])): - * if C[ci][cj] in search_space: - * i += 1 # <<<<<<<<<<<<<< - * break - * if i != 0: + /* "cyext_acv.pyx":5566 + * in_data_b.erase(deref(it)) + * inc(it) + * in_data = in_data_b # <<<<<<<<<<<<<< + * else: + * nodes_child.insert(children_left[b, it_node]) */ - __pyx_v_i = (__pyx_v_i + 1); + __pyx_v_in_data = __pyx_v_in_data_b; + } + __pyx_L12:; - /* "cyext_acv.pyx":5562 - * if C[ci][cj] in search_space: - * i += 1 - * break # <<<<<<<<<<<<<< - * if i != 0: - * va_id += [C[ci]] + /* "cyext_acv.pyx":5541 + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): # <<<<<<<<<<<<<< + * if x[features[b, it_node]] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) */ - goto __pyx_L16_break; + goto __pyx_L11; + } - /* "cyext_acv.pyx":5560 - * i = 0 - * for cj in range(len(C[ci])): - * if C[ci][cj] in search_space: # <<<<<<<<<<<<<< - * i += 1 - * break + /* "cyext_acv.pyx":5568 + * in_data = in_data_b + * else: + * nodes_child.insert(children_left[b, it_node]) # <<<<<<<<<<<<<< + * nodes_child.insert(children_right[b, it_node]) + * + */ + /*else*/ { + __pyx_t_12 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_left.data + __pyx_t_12 * __pyx_v_children_left.strides[0]) ) + __pyx_t_15 * __pyx_v_children_left.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 5568, __pyx_L1_error) + } + + /* "cyext_acv.pyx":5569 + * else: + * nodes_child.insert(children_left[b, it_node]) + * nodes_child.insert(children_right[b, it_node]) # <<<<<<<<<<<<<< + * + * if in_data.size() < min_node_size: */ + __pyx_t_15 = __pyx_v_b; + __pyx_t_12 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_right.data + __pyx_t_15 * __pyx_v_children_right.strides[0]) ) + __pyx_t_12 * __pyx_v_children_right.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 5569, __pyx_L1_error) + } } - } - __pyx_L16_break:; + __pyx_L11:; - /* "cyext_acv.pyx":5563 - * i += 1 + /* "cyext_acv.pyx":5571 + * nodes_child.insert(children_right[b, it_node]) + * + * if in_data.size() < min_node_size: # <<<<<<<<<<<<<< * break - * if i != 0: # <<<<<<<<<<<<<< - * va_id += [C[ci]] - * else: + * inc(it_point) */ - __pyx_t_12 = ((__pyx_v_i != 0) != 0); - if (__pyx_t_12) { + __pyx_t_9 = ((__pyx_v_in_data.size() < __pyx_v_min_node_size) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":5572 + * + * if in_data.size() < min_node_size: + * break # <<<<<<<<<<<<<< + * inc(it_point) + * + */ + goto __pyx_L10_break; - /* "cyext_acv.pyx":5564 + /* "cyext_acv.pyx":5571 + * nodes_child.insert(children_right[b, it_node]) + * + * if in_data.size() < min_node_size: # <<<<<<<<<<<<<< * break - * if i != 0: - * va_id += [C[ci]] # <<<<<<<<<<<<<< - * else: - * va_id = [[i] for i in search_space] + * inc(it_point) */ - if (unlikely(__pyx_v_C == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 5564, __pyx_L1_error) } - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5564, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci)); - __Pyx_GIVEREF(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci)); - PyList_SET_ITEM(__pyx_t_2, 0, PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci)); - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_va_id, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5564, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_va_id, ((PyObject*)__pyx_t_1)); - __pyx_t_1 = 0; - /* "cyext_acv.pyx":5563 - * i += 1 + /* "cyext_acv.pyx":5573 + * if in_data.size() < min_node_size: * break - * if i != 0: # <<<<<<<<<<<<<< - * va_id += [C[ci]] - * else: + * inc(it_point) # <<<<<<<<<<<<<< + * + * nodes_level = nodes_child */ + (void)((++__pyx_v_it_point)); } - } + __pyx_L10_break:; - /* "cyext_acv.pyx":5554 - * y_X_arr = np.array(y_X, dtype=np.double) + /* "cyext_acv.pyx":5575 + * inc(it_point) * - * if C[0] != []: # <<<<<<<<<<<<<< - * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] - * va_id = [[i] for i in search_space if i not in remove_va] - */ - goto __pyx_L5; - } - - /* "cyext_acv.pyx":5566 - * va_id += [C[ci]] - * else: - * va_id = [[i] for i in search_space] # <<<<<<<<<<<<<< + * nodes_level = nodes_child # <<<<<<<<<<<<<< * - * m = len(va_id) + * if classifier == 1: */ - /*else*/ { - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5566, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (unlikely(__pyx_v_search_space == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 5566, __pyx_L1_error) - } - __pyx_t_2 = __pyx_v_search_space; __Pyx_INCREF(__pyx_t_2); __pyx_t_13 = 0; - for (;;) { - if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_4); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 5566, __pyx_L1_error) - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5566, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5566, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_i = __pyx_t_10; - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5566, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5566, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_4); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); - __pyx_t_4 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 5566, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_nodes_level = __pyx_v_nodes_child; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_va_id = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - } - __pyx_L5:; - /* "cyext_acv.pyx":5568 - * va_id = [[i] for i in search_space] + /* "cyext_acv.pyx":5577 + * nodes_level = nodes_child * - * m = len(va_id) # <<<<<<<<<<<<<< - * power = [] - * max_size = 0 + * if classifier == 1: # <<<<<<<<<<<<<< + * it = in_data.begin() + * while(it != in_data.end()): */ - __pyx_t_13 = PyList_GET_SIZE(__pyx_v_va_id); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5568, __pyx_L1_error) - __pyx_v_m = __pyx_t_13; + __pyx_t_9 = ((__pyx_v_classifier == 1) != 0); + if (__pyx_t_9) { - /* "cyext_acv.pyx":5569 + /* "cyext_acv.pyx":5578 * - * m = len(va_id) - * power = [] # <<<<<<<<<<<<<< - * max_size = 0 - * for size in range(m + 1): + * if classifier == 1: + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5569, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_power = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_v_it = __pyx_v_in_data.begin(); - /* "cyext_acv.pyx":5570 - * m = len(va_id) - * power = [] - * max_size = 0 # <<<<<<<<<<<<<< - * for size in range(m + 1): - * power_b = [] + /* "cyext_acv.pyx":5579 + * if classifier == 1: + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) + * w[deref(it)] += (1./(n_trees*in_data.size())) */ - __pyx_v_max_size = 0; + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; - /* "cyext_acv.pyx":5571 - * power = [] - * max_size = 0 - * for size in range(m + 1): # <<<<<<<<<<<<<< - * power_b = [] - * for co in itertools.combinations(va_id, size): + /* "cyext_acv.pyx":5580 + * it = in_data.begin() + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) # <<<<<<<<<<<<<< + * w[deref(it)] += (1./(n_trees*in_data.size())) + * inc(it) */ - __pyx_t_20 = (__pyx_v_m + 1); - __pyx_t_21 = __pyx_t_20; - for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_21; __pyx_t_10+=1) { - __pyx_v_size = __pyx_t_10; + __pyx_t_12 = (*__pyx_v_it); + __pyx_v_sdp = (__pyx_v_sdp + ((1. / (__pyx_v_n_trees * __pyx_v_in_data.size())) * (__pyx_v_y_x != (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_12)) )))))); - /* "cyext_acv.pyx":5572 - * max_size = 0 - * for size in range(m + 1): - * power_b = [] # <<<<<<<<<<<<<< - * for co in itertools.combinations(va_id, size): - * power_b.append(np.array(sum(list(co),[]))) + /* "cyext_acv.pyx":5581 + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) + * w[deref(it)] += (1./(n_trees*in_data.size())) # <<<<<<<<<<<<<< + * inc(it) + * else: */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5572, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_power_b, ((PyObject*)__pyx_t_1)); - __pyx_t_1 = 0; + __pyx_t_12 = (*__pyx_v_it); + *((double *) ( /* dim=0 */ (__pyx_v_w.data + __pyx_t_12 * __pyx_v_w.strides[0]) )) += (1. / (__pyx_v_n_trees * __pyx_v_in_data.size())); - /* "cyext_acv.pyx":5573 - * for size in range(m + 1): - * power_b = [] - * for co in itertools.combinations(va_id, size): # <<<<<<<<<<<<<< - * power_b.append(np.array(sum(list(co),[]))) - * max_size += 1 + /* "cyext_acv.pyx":5582 + * sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) + * w[deref(it)] += (1./(n_trees*in_data.size())) + * inc(it) # <<<<<<<<<<<<<< + * else: + * it = in_data.begin() */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_itertools); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_combinations); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; - __pyx_t_22 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_22 = 1; - } - } - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_3)) { - PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_va_id, __pyx_t_2}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5573, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { - PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_va_id, __pyx_t_2}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5573, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else - #endif - { - __pyx_t_6 = PyTuple_New(2+__pyx_t_22); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (__pyx_t_4) { - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + (void)((++__pyx_v_it)); } - __Pyx_INCREF(__pyx_v_va_id); - __Pyx_GIVEREF(__pyx_v_va_id); - PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_22, __pyx_v_va_id); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_22, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_13 = 0; - __pyx_t_23 = NULL; - } else { - __pyx_t_13 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_23 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 5573, __pyx_L1_error) + + /* "cyext_acv.pyx":5577 + * nodes_level = nodes_child + * + * if classifier == 1: # <<<<<<<<<<<<<< + * it = in_data.begin() + * while(it != in_data.end()): + */ + goto __pyx_L22; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_23)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { - if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_3)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 5573, __pyx_L1_error) - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } else { - if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_3)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 5573, __pyx_L1_error) - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } - } else { - __pyx_t_1 = __pyx_t_23(__pyx_t_3); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 5573, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - __Pyx_XDECREF_SET(__pyx_v_co, __pyx_t_1); - __pyx_t_1 = 0; - /* "cyext_acv.pyx":5574 - * power_b = [] - * for co in itertools.combinations(va_id, size): - * power_b.append(np.array(sum(list(co),[]))) # <<<<<<<<<<<<<< - * max_size += 1 - * power.append(power_b) + /* "cyext_acv.pyx":5584 + * inc(it) + * else: + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (1-(t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5574, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5574, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PySequence_List(__pyx_v_co); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5574, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5574, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_24 = PyTuple_New(2); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 5574, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_24); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_4); - __pyx_t_6 = 0; - __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_24, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5574, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; - __pyx_t_24 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_24 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_24)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_24); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - __pyx_t_1 = (__pyx_t_24) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_24, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); - __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5574, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_25 = __Pyx_PyList_Append(__pyx_v_power_b, __pyx_t_1); if (unlikely(__pyx_t_25 == ((int)-1))) __PYX_ERR(0, 5574, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /*else*/ { + __pyx_v_it = __pyx_v_in_data.begin(); - /* "cyext_acv.pyx":5575 - * for co in itertools.combinations(va_id, size): - * power_b.append(np.array(sum(list(co),[]))) - * max_size += 1 # <<<<<<<<<<<<<< - * power.append(power_b) - * if max_size >= 2**15: + /* "cyext_acv.pyx":5585 + * else: + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * sdp += (1./(n_trees*in_data.size())) * (1-(t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) + * w[deref(it)] += (1./(n_trees*in_data.size())) */ - __pyx_v_max_size = (__pyx_v_max_size + 1); + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; - /* "cyext_acv.pyx":5573 - * for size in range(m + 1): - * power_b = [] - * for co in itertools.combinations(va_id, size): # <<<<<<<<<<<<<< - * power_b.append(np.array(sum(list(co),[]))) - * max_size += 1 + /* "cyext_acv.pyx":5586 + * it = in_data.begin() + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (1-(t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) # <<<<<<<<<<<<<< + * w[deref(it)] += (1./(n_trees*in_data.size())) + * inc(it) */ - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_12 = 0; + __pyx_t_15 = (*__pyx_v_it); + __pyx_t_13 = (*__pyx_v_it); + __pyx_t_14 = 1; + __pyx_v_sdp = (__pyx_v_sdp + ((1. / (__pyx_v_n_trees * __pyx_v_in_data.size())) * (1 - (((*((double *) ( /* dim=0 */ (__pyx_v_t.data + __pyx_t_12 * __pyx_v_t.strides[0]) ))) <= (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_15)) )))) * ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_13)) ))) <= (*((double *) ( /* dim=0 */ (__pyx_v_t.data + __pyx_t_14 * __pyx_v_t.strides[0]) )))))))); - /* "cyext_acv.pyx":5576 - * power_b.append(np.array(sum(list(co),[]))) - * max_size += 1 - * power.append(power_b) # <<<<<<<<<<<<<< - * if max_size >= 2**15: - * break + /* "cyext_acv.pyx":5587 + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (1-(t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) + * w[deref(it)] += (1./(n_trees*in_data.size())) # <<<<<<<<<<<<<< + * inc(it) + * */ - __pyx_t_25 = __Pyx_PyList_Append(__pyx_v_power, __pyx_v_power_b); if (unlikely(__pyx_t_25 == ((int)-1))) __PYX_ERR(0, 5576, __pyx_L1_error) + __pyx_t_14 = (*__pyx_v_it); + *((double *) ( /* dim=0 */ (__pyx_v_w.data + __pyx_t_14 * __pyx_v_w.strides[0]) )) += (1. / (__pyx_v_n_trees * __pyx_v_in_data.size())); - /* "cyext_acv.pyx":5577 - * max_size += 1 - * power.append(power_b) - * if max_size >= 2**15: # <<<<<<<<<<<<<< - * break + /* "cyext_acv.pyx":5588 + * sdp += (1./(n_trees*in_data.size())) * (1-(t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) + * w[deref(it)] += (1./(n_trees*in_data.size())) + * inc(it) # <<<<<<<<<<<<<< * + * return sdp */ - __pyx_t_12 = ((__pyx_v_max_size >= 0x8000) != 0); - if (__pyx_t_12) { + (void)((++__pyx_v_it)); + } + } + __pyx_L22:; + } - /* "cyext_acv.pyx":5578 - * power.append(power_b) - * if max_size >= 2**15: - * break # <<<<<<<<<<<<<< + /* "cyext_acv.pyx":5590 + * inc(it) + * + * return sdp # <<<<<<<<<<<<<< + * * - * cdef vector[vector[vector[long]]] power_cpp = power */ - goto __pyx_L22_break; + __pyx_r = __pyx_v_sdp; + goto __pyx_L0; - /* "cyext_acv.pyx":5577 - * max_size += 1 - * power.append(power_b) - * if max_size >= 2**15: # <<<<<<<<<<<<<< - * break - * + /* "cyext_acv.pyx":5511 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cdef double single_compute_ddp_rule_weights(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, # <<<<<<<<<<<<<< + * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + * int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition, */ - } - } - __pyx_L22_break:; - /* "cyext_acv.pyx":5580 - * break - * - * cdef vector[vector[vector[long]]] power_cpp = power # <<<<<<<<<<<<<< - * cdef long[:, :] s_star - * s_star = -1*np.ones((N, X.shape[1]), dtype=np.int) + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("cyext_acv.single_compute_ddp_rule_weights", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_r = 0; + __pyx_L0:; + return __pyx_r; +} + +/* "cyext_acv.pyx":5597 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_ddp_weights(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * int max_depth, int min_node_size, int & classifier, double[:, :] & t, double & pi): */ - __pyx_t_26 = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_std_3a__3a_vector_3c_long_3e____3e___(__pyx_v_power); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5580, __pyx_L1_error) - __pyx_v_power_cpp = __pyx_t_26; - /* "cyext_acv.pyx":5582 - * cdef vector[vector[vector[long]]] power_cpp = power - * cdef long[:, :] s_star - * s_star = -1*np.ones((N, X.shape[1]), dtype=np.int) # <<<<<<<<<<<<<< - * +static PyObject *__pyx_pw_9cyext_acv_85compute_ddp_weights(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_ddp_weights(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, CYTHON_UNUSED double &__pyx_v_pi, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_buffer = NULL; + __Pyx_memviewslice __pyx_v_partition_byobs = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_N; + __Pyx_memviewslice __pyx_v_sdp = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_weights = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_13; + __Pyx_memviewslice __pyx_t_14 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_15 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_ddp_weights", 0); + + /* "cyext_acv.pyx":5601 + * int max_depth, int min_node_size, int & classifier, double[:, :] & t, double & pi): * + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) # <<<<<<<<<<<<<< + * buffer[:, :, 0] = -1e+10 + * cdef double [:, :, :] partition_byobs = buffer */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5582, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ones); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5582, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5582, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_X.shape[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5582, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ones); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5582, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5601, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_X.shape[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5601, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_X.shape[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5601, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); - __pyx_t_3 = 0; - __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5582, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_INCREF(__pyx_int_2); + __Pyx_GIVEREF(__pyx_int_2); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_2); + __pyx_t_3 = 0; __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5582, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5582, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 5582, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_24); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_24) < 0) __PYX_ERR(0, 5582, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; - __pyx_t_24 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 5582, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_24); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 5601, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5601, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Multiply(__pyx_int_neg_1, __pyx_t_24); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5582, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; - __pyx_t_27 = __Pyx_PyObject_to_MemoryviewSlice_dsds_long(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_27.memview)) __PYX_ERR(0, 5582, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_s_star = __pyx_t_27; - __pyx_t_27.memview = NULL; - __pyx_t_27.data = NULL; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Multiply(__pyx_float_1e_10, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5601, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_buffer = __pyx_t_1; + __pyx_t_1 = 0; - /* "cyext_acv.pyx":5585 + /* "cyext_acv.pyx":5602 * + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + * buffer[:, :, 0] = -1e+10 # <<<<<<<<<<<<<< + * cdef double [:, :, :] partition_byobs = buffer * - * cdef long power_set_size = 2**m # <<<<<<<<<<<<<< - * S = np.zeros((data.shape[1]), dtype=np.int) + */ + if (unlikely(PyObject_SetItem(__pyx_v_buffer, __pyx_tuple__3, __pyx_float_neg_1e_10) < 0)) __PYX_ERR(0, 5602, __pyx_L1_error) + + /* "cyext_acv.pyx":5603 + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + * buffer[:, :, 0] = -1e+10 + * cdef double [:, :, :] partition_byobs = buffer # <<<<<<<<<<<<<< * + * cdef int N = X.shape[0] */ - __pyx_v_power_set_size = __Pyx_pow_long(2, ((long)__pyx_v_m)); + __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_v_buffer, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 5603, __pyx_L1_error) + __pyx_v_partition_byobs = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; - /* "cyext_acv.pyx":5586 + /* "cyext_acv.pyx":5605 + * cdef double [:, :, :] partition_byobs = buffer * - * cdef long power_set_size = 2**m - * S = np.zeros((data.shape[1]), dtype=np.int) # <<<<<<<<<<<<<< + * cdef int N = X.shape[0] # <<<<<<<<<<<<<< + * cdef double[::1] sdp = np.zeros(N) + * cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + */ + __pyx_v_N = (__pyx_v_X.shape[0]); + + /* "cyext_acv.pyx":5606 * - * for s_0 in tqdm(range(minimal, m + 1)): + * cdef int N = X.shape[0] + * cdef double[::1] sdp = np.zeros(N) # <<<<<<<<<<<<<< + * cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + * cdef int i, j */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5586, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 5586, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_24); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_data.shape[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5586, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5586, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5606, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5586, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5586, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5606, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5586, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 5586, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_24, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5586, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_7 = __pyx_convert_vector_from_py_int(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5586, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_S = __pyx_t_7; + __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 5606, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp = __pyx_t_7; + __pyx_t_7.memview = NULL; + __pyx_t_7.data = NULL; - /* "cyext_acv.pyx":5588 - * S = np.zeros((data.shape[1]), dtype=np.int) + /* "cyext_acv.pyx":5607 + * cdef int N = X.shape[0] + * cdef double[::1] sdp = np.zeros(N) + * cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) # <<<<<<<<<<<<<< + * cdef int i, j * - * for s_0 in tqdm(range(minimal, m + 1)): # <<<<<<<<<<<<<< - * for s_1 in range(0, power_cpp[s_0].size()): - * for i in range(power_cpp[s_0][s_1].size()): */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_tqdm); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5588, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_minimal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5588, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_24 = __Pyx_PyInt_From_long((__pyx_v_m + 1)); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 5588, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_24); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5588, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_24); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_24); - __pyx_t_2 = 0; - __pyx_t_24 = 0; - __pyx_t_24 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 5588, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_24); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5607, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - } - } - __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_1, __pyx_t_24) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_24); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5588, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5607, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5607, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_data.shape[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5607, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_13 = 0; - __pyx_t_23 = NULL; - } else { - __pyx_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5588, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_23 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 5588, __pyx_L1_error) - } + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __pyx_t_5 = 0; + __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_3) < 0) __PYX_ERR(0, 5607, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - for (;;) { - if (likely(!__pyx_t_23)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { - if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 5588, __pyx_L1_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5588, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - } else { - if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 5588, __pyx_L1_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5588, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - } - } else { - __pyx_t_3 = __pyx_t_23(__pyx_t_4); - if (unlikely(!__pyx_t_3)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 5588, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_3); - } - __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5588, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_s_0 = __pyx_t_10; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5607, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 5607, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_weights = __pyx_t_8; + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; - /* "cyext_acv.pyx":5589 + /* "cyext_acv.pyx":5610 + * cdef int i, j * - * for s_0 in tqdm(range(minimal, m + 1)): - * for s_1 in range(0, power_cpp[s_0].size()): # <<<<<<<<<<<<<< - * for i in range(power_cpp[s_0][s_1].size()): - * S[i] = power_cpp[s_0][s_1][i] + * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_ddp_rule_weights(X[i], y_X[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, */ - __pyx_t_28 = (__pyx_v_power_cpp[__pyx_v_s_0]).size(); - __pyx_t_29 = __pyx_t_28; - for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_29; __pyx_t_10+=1) { - __pyx_v_s_1 = __pyx_t_10; + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + __pyx_t_9 = __pyx_v_N; + if ((1 == 0)) abort(); + { + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) (x) + #define unlikely(x) (x) + #endif + __pyx_t_11 = (__pyx_t_9 - 0 + 1 - 1/abs(1)) / 1; + if (__pyx_t_11 > 0) + { + #ifdef _OPENMP + #pragma omp parallel private(__pyx_t_13, __pyx_t_16) firstprivate(__pyx_t_12, __pyx_t_14, __pyx_t_15, __pyx_t_8) + #endif /* _OPENMP */ + { + #ifdef _OPENMP + #pragma omp for firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) schedule(dynamic) + #endif /* _OPENMP */ + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_11; __pyx_t_10++){ + { + __pyx_v_i = (int)(0 + 1 * __pyx_t_10); - /* "cyext_acv.pyx":5590 - * for s_0 in tqdm(range(minimal, m + 1)): - * for s_1 in range(0, power_cpp[s_0].size()): - * for i in range(power_cpp[s_0][s_1].size()): # <<<<<<<<<<<<<< - * S[i] = power_cpp[s_0][s_1][i] + /* "cyext_acv.pyx":5611 * + * for i in prange(N, nogil=True, schedule='dynamic'): + * sdp[i] = single_compute_ddp_rule_weights(X[i], y_X[i], data, y_data, S[i], # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i]) */ - __pyx_t_30 = ((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1]).size(); - __pyx_t_31 = __pyx_t_30; - for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_31; __pyx_t_22+=1) { - __pyx_v_i = __pyx_t_22; + __pyx_t_12.data = __pyx_v_X.data; + __pyx_t_12.memview = __pyx_v_X.memview; + __PYX_INC_MEMVIEW(&__pyx_t_12, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_X.strides[0]; + __pyx_t_12.data += __pyx_tmp_idx * __pyx_tmp_stride; +} - /* "cyext_acv.pyx":5591 - * for s_1 in range(0, power_cpp[s_0].size()): - * for i in range(power_cpp[s_0][s_1].size()): - * S[i] = power_cpp[s_0][s_1][i] # <<<<<<<<<<<<<< - * - * S_size = power_cpp[s_0][s_1].size() - */ - (__pyx_v_S[__pyx_v_i]) = (((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1])[__pyx_v_i]); - } +__pyx_t_12.shape[0] = __pyx_v_X.shape[1]; +__pyx_t_12.strides[0] = __pyx_v_X.strides[1]; + __pyx_t_12.suboffsets[0] = -1; - /* "cyext_acv.pyx":5593 - * S[i] = power_cpp[s_0][s_1][i] - * - * S_size = power_cpp[s_0][s_1].size() # <<<<<<<<<<<<<< - * r.clear() - * N = R.size() - */ - __pyx_v_S_size = ((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1]).size(); +__pyx_t_13 = __pyx_v_i; - /* "cyext_acv.pyx":5594 + /* "cyext_acv.pyx":5613 + * sdp[i] = single_compute_ddp_rule_weights(X[i], y_X[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i]) # <<<<<<<<<<<<<< * - * S_size = power_cpp[s_0][s_1].size() - * r.clear() # <<<<<<<<<<<<<< - * N = R.size() - * in_data = np.zeros(X.shape[0]) + * return np.array(sdp), np.array(weights) */ - __pyx_v_r.clear(); + __pyx_t_14.data = __pyx_v_t.data; + __pyx_t_14.memview = __pyx_v_t.memview; + __PYX_INC_MEMVIEW(&__pyx_t_14, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_t.strides[0]; + __pyx_t_14.data += __pyx_tmp_idx * __pyx_tmp_stride; +} - /* "cyext_acv.pyx":5595 - * S_size = power_cpp[s_0][s_1].size() - * r.clear() - * N = R.size() # <<<<<<<<<<<<<< - * in_data = np.zeros(X.shape[0]) - * - */ - __pyx_v_N = __pyx_v_R.size(); +__pyx_t_14.shape[0] = __pyx_v_t.shape[1]; +__pyx_t_14.strides[0] = __pyx_v_t.strides[1]; + __pyx_t_14.suboffsets[0] = -1; - /* "cyext_acv.pyx":5596 - * r.clear() - * N = R.size() - * in_data = np.zeros(X.shape[0]) # <<<<<<<<<<<<<< +__pyx_t_8.data = __pyx_v_partition_byobs.data; + __pyx_t_8.memview = __pyx_v_partition_byobs.memview; + __PYX_INC_MEMVIEW(&__pyx_t_8, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_partition_byobs.strides[0]; + __pyx_t_8.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_8.shape[0] = __pyx_v_partition_byobs.shape[1]; +__pyx_t_8.strides[0] = __pyx_v_partition_byobs.strides[1]; + __pyx_t_8.suboffsets[0] = -1; + +__pyx_t_8.shape[1] = __pyx_v_partition_byobs.shape[2]; +__pyx_t_8.strides[1] = __pyx_v_partition_byobs.strides[2]; + __pyx_t_8.suboffsets[1] = -1; + +__pyx_t_15.data = __pyx_v_weights.data; + __pyx_t_15.memview = __pyx_v_weights.memview; + __PYX_INC_MEMVIEW(&__pyx_t_15, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_weights.strides[0]; + __pyx_t_15.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_15.shape[0] = __pyx_v_weights.shape[1]; +__pyx_t_15.strides[0] = __pyx_v_weights.strides[1]; + __pyx_t_15.suboffsets[0] = -1; + +__pyx_t_16 = __pyx_v_i; + + /* "cyext_acv.pyx":5611 * - * for i in range(N): - */ - __Pyx_GetModuleGlobalName(__pyx_t_24, __pyx_n_s_np); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 5596, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_24); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_24, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5596, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; - __pyx_t_24 = PyInt_FromSsize_t((__pyx_v_X.shape[0])); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 5596, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_24); - __pyx_t_2 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); + * for i in prange(N, nogil=True, schedule='dynamic'): + * sdp[i] = single_compute_ddp_rule_weights(X[i], y_X[i], data, y_data, S[i], # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i]) + */ + *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_sdp.data) + __pyx_t_16)) )) = __pyx_f_9cyext_acv_single_compute_ddp_rule_weights(__pyx_t_12, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_13)) ))), __pyx_v_data, __pyx_v_y_data, (__pyx_v_S[__pyx_v_i]), __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_t_14, __pyx_t_8, __pyx_t_15); + __PYX_XDEC_MEMVIEW(&__pyx_t_12, 0); + __pyx_t_12.memview = NULL; + __pyx_t_12.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_14, 0); + __pyx_t_14.memview = NULL; + __pyx_t_14.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_8, 0); + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_15, 0); + __pyx_t_15.memview = NULL; + __pyx_t_15.data = NULL; + } + } + } + } } + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #endif } - __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_t_24) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_24); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5596, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 5596, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_XDEC_MEMVIEW(&__pyx_v_in_data, 1); - __pyx_v_in_data = __pyx_t_5; - __pyx_t_5.memview = NULL; - __pyx_t_5.data = NULL; - /* "cyext_acv.pyx":5598 - * in_data = np.zeros(X.shape[0]) + /* "cyext_acv.pyx":5610 + * cdef int i, j * - * for i in range(N): # <<<<<<<<<<<<<< - * R_buf[i] = R[i] - * in_data[R_buf[i]] = 1 + * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_ddp_rule_weights(X[i], y_X[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, */ - __pyx_t_8 = __pyx_v_N; - __pyx_t_9 = __pyx_t_8; - for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_9; __pyx_t_22+=1) { - __pyx_v_i = __pyx_t_22; + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } - /* "cyext_acv.pyx":5599 - * - * for i in range(N): - * R_buf[i] = R[i] # <<<<<<<<<<<<<< - * in_data[R_buf[i]] = 1 + /* "cyext_acv.pyx":5615 + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i]) * - */ - __pyx_t_32 = __pyx_v_i; - *((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_32 * __pyx_v_R_buf.strides[0]) )) = (__pyx_v_R[__pyx_v_i]); - - /* "cyext_acv.pyx":5600 - * for i in range(N): - * R_buf[i] = R[i] - * in_data[R_buf[i]] = 1 # <<<<<<<<<<<<<< + * return np.array(sdp), np.array(weights) # <<<<<<<<<<<<<< * - * # sdp_b[R_buf[i]] = single_compute_sdp_rf(X[R_buf[i]], y_X[R_buf[i]], data, y_data, S[:S_size], features, thresholds, children_left, children_right, + * @cython.boundscheck(False) */ - __pyx_t_32 = __pyx_v_i; - __pyx_t_33 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_32 * __pyx_v_R_buf.strides[0]) ))); - *((double *) ( /* dim=0 */ (__pyx_v_in_data.data + __pyx_t_33 * __pyx_v_in_data.strides[0]) )) = 1.0; - } + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_sdp, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_weights, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __pyx_t_3 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; - /* "cyext_acv.pyx":5605 - * # max_depth, min_node_size, classifier, t) + /* "cyext_acv.pyx":5597 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_ddp_weights(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * int max_depth, int min_node_size, int & classifier, double[:, :] & t, double & pi): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_15, 1); + __Pyx_AddTraceback("cyext_acv.compute_ddp_weights", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_buffer); + __PYX_XDEC_MEMVIEW(&__pyx_v_partition_byobs, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_weights, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_9cyext_acv_85compute_ddp_weights(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_9cyext_acv_85compute_ddp_weights(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + std::vector > __pyx_v_S; + __Pyx_memviewslice __pyx_v_features = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_thresholds = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_left = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_right = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_max_depth; + int __pyx_v_min_node_size; + int __pyx_v_classifier; + __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } }; + double __pyx_v_pi; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("compute_ddp_weights (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_y_X,&__pyx_n_s_data,&__pyx_n_s_y_data,&__pyx_n_s_S,&__pyx_n_s_features,&__pyx_n_s_thresholds,&__pyx_n_s_children_left,&__pyx_n_s_children_right,&__pyx_n_s_max_depth,&__pyx_n_s_min_node_size,&__pyx_n_s_classifier,&__pyx_n_s_t,&__pyx_n_s_pi,0}; + PyObject* values[14] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_X)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_weights", 1, 14, 14, 1); __PYX_ERR(0, 5597, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_weights", 1, 14, 14, 2); __PYX_ERR(0, 5597, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_weights", 1, 14, 14, 3); __PYX_ERR(0, 5597, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_S)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_weights", 1, 14, 14, 4); __PYX_ERR(0, 5597, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_features)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_weights", 1, 14, 14, 5); __PYX_ERR(0, 5597, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thresholds)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_weights", 1, 14, 14, 6); __PYX_ERR(0, 5597, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_left)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_weights", 1, 14, 14, 7); __PYX_ERR(0, 5597, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_weights", 1, 14, 14, 8); __PYX_ERR(0, 5597, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_weights", 1, 14, 14, 9); __PYX_ERR(0, 5597, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_node_size)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_weights", 1, 14, 14, 10); __PYX_ERR(0, 5597, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classifier)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_weights", 1, 14, 14, 11); __PYX_ERR(0, 5597, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_weights", 1, 14, 14, 12); __PYX_ERR(0, 5597, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 13: + if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pi)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_weights", 1, 14, 14, 13); __PYX_ERR(0, 5597, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_ddp_weights") < 0)) __PYX_ERR(0, 5597, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 14) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + } + __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 5597, __pyx_L3_error) + __pyx_v_y_X = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_X.memview)) __PYX_ERR(0, 5597, __pyx_L3_error) + __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 5597, __pyx_L3_error) + __pyx_v_y_data = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_data.memview)) __PYX_ERR(0, 5597, __pyx_L3_error) + __pyx_v_S = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_int_3e___(values[4]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5597, __pyx_L3_error) + __pyx_v_features = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_features.memview)) __PYX_ERR(0, 5598, __pyx_L3_error) + __pyx_v_thresholds = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_thresholds.memview)) __PYX_ERR(0, 5598, __pyx_L3_error) + __pyx_v_children_left = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_left.memview)) __PYX_ERR(0, 5598, __pyx_L3_error) + __pyx_v_children_right = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_right.memview)) __PYX_ERR(0, 5598, __pyx_L3_error) + __pyx_v_max_depth = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5599, __pyx_L3_error) + __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5599, __pyx_L3_error) + __pyx_v_classifier = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5599, __pyx_L3_error) + __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[12], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 5599, __pyx_L3_error) + __pyx_v_pi = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_pi == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5599, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("compute_ddp_weights", 1, 14, 14, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5597, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cyext_acv.compute_ddp_weights", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_9cyext_acv_84compute_ddp_weights(__pyx_self, __pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_v_pi); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9cyext_acv_84compute_ddp_weights(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t, double __pyx_v_pi) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_ddp_weights", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundLocalError("X"); __PYX_ERR(0, 5597, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_X.memview)) { __Pyx_RaiseUnboundLocalError("y_X"); __PYX_ERR(0, 5597, __pyx_L1_error) } + if (unlikely(!__pyx_v_data.memview)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 5597, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_data.memview)) { __Pyx_RaiseUnboundLocalError("y_data"); __PYX_ERR(0, 5597, __pyx_L1_error) } + if (unlikely(!__pyx_v_features.memview)) { __Pyx_RaiseUnboundLocalError("features"); __PYX_ERR(0, 5597, __pyx_L1_error) } + if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 5597, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 5597, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 5597, __pyx_L1_error) } + if (unlikely(!__pyx_v_t.memview)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 5597, __pyx_L1_error) } + __pyx_t_1 = __pyx_f_9cyext_acv_compute_ddp_weights(__pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_v_pi, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5597, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cyext_acv.compute_ddp_weights", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_features, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_thresholds, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_left, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_right, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_t, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cyext_acv.pyx":5621 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_ddp_weights_verbose(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * int max_depth, int min_node_size, int & classifier, double[:, :] & t, double & pi): + */ + +static PyObject *__pyx_pw_9cyext_acv_87compute_ddp_weights_verbose(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_ddp_weights_verbose(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, CYTHON_UNUSED double &__pyx_v_pi, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_buffer = NULL; + __Pyx_memviewslice __pyx_v_partition_byobs = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_N; + __Pyx_memviewslice __pyx_v_sdp = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_weights = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_9; + PyObject *(*__pyx_t_10)(PyObject *); + int __pyx_t_11; + __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_13; + __Pyx_memviewslice __pyx_t_14 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_15 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_ddp_weights_verbose", 0); + + /* "cyext_acv.pyx":5625 + * int max_depth, int min_node_size, int & classifier, double[:, :] & t, double & pi): * - * sdp_ba = compute_sdp_rf_same_set(X_arr[np.array(in_data, dtype=bool)], # <<<<<<<<<<<<<< - * y_X_arr[np.array(in_data, dtype=bool)], - * data, y_data, S[:S_size], features, thresholds, children_left, + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) # <<<<<<<<<<<<<< + * buffer[:, :, 0] = -1e+10 + * cdef double [:, :, :] partition_byobs = buffer */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5605, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5605, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_in_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5605, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_24 = PyTuple_New(1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 5605, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_24); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5605, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 5605, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_24, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5605, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_X_arr, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5605, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_34 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_34.memview)) __PYX_ERR(0, 5605, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5625, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ones); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5625, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5625, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_X.shape[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5625, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_X.shape[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5625, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5625, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_INCREF(__pyx_int_2); + __Pyx_GIVEREF(__pyx_int_2); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_2); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 5625, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5625, __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 = PyNumber_Multiply(__pyx_float_1e_10, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5625, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_buffer = __pyx_t_1; + __pyx_t_1 = 0; - /* "cyext_acv.pyx":5606 + /* "cyext_acv.pyx":5626 + * + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + * buffer[:, :, 0] = -1e+10 # <<<<<<<<<<<<<< + * cdef double [:, :, :] partition_byobs = buffer * - * sdp_ba = compute_sdp_rf_same_set(X_arr[np.array(in_data, dtype=bool)], - * y_X_arr[np.array(in_data, dtype=bool)], # <<<<<<<<<<<<<< - * data, y_data, S[:S_size], features, thresholds, children_left, - * children_right, max_depth, min_node_size, classifier, t) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5606, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5606, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_in_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5606, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_24 = PyTuple_New(1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 5606, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_24); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5606, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 5606, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_24, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5606, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_y_X_arr, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5606, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_v_buffer, __pyx_tuple__3, __pyx_float_neg_1e_10) < 0)) __PYX_ERR(0, 5626, __pyx_L1_error) + + /* "cyext_acv.pyx":5627 + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + * buffer[:, :, 0] = -1e+10 + * cdef double [:, :, :] partition_byobs = buffer # <<<<<<<<<<<<<< + * + * cdef int N = X.shape[0] + */ + __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_v_buffer, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 5627, __pyx_L1_error) + __pyx_v_partition_byobs = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "cyext_acv.pyx":5629 + * cdef double [:, :, :] partition_byobs = buffer + * + * cdef int N = X.shape[0] # <<<<<<<<<<<<<< + * cdef double[::1] sdp = np.zeros(N) + * cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + */ + __pyx_v_N = (__pyx_v_X.shape[0]); + + /* "cyext_acv.pyx":5630 + * + * cdef int N = X.shape[0] + * cdef double[::1] sdp = np.zeros(N) # <<<<<<<<<<<<<< + * cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + * cdef int i, j + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5630, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5630, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5630, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5630, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 5630, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp = __pyx_t_7; + __pyx_t_7.memview = NULL; + __pyx_t_7.data = NULL; + + /* "cyext_acv.pyx":5631 + * cdef int N = X.shape[0] + * cdef double[::1] sdp = np.zeros(N) + * cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) # <<<<<<<<<<<<<< + * cdef int i, j + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5631, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5631, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5631, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5631, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_data.shape[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5631, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5631, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __pyx_t_5 = 0; + __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_3) < 0) __PYX_ERR(0, 5631, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5631, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 5631, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_weights = __pyx_t_8; + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; + + /* "cyext_acv.pyx":5634 + * cdef int i, j + * + * for i in tqdm(range(N)): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_ddp_rule_weights(X[i], y_X[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_tqdm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0; + __pyx_t_10 = NULL; + } else { + __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5634, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (likely(!__pyx_t_10)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 5634, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } else { + if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 5634, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } + } else { + __pyx_t_3 = __pyx_t_10(__pyx_t_1); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 5634, __pyx_L1_error) + } + break; + } __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_35 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_35.memview)) __PYX_ERR(0, 5606, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5634, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_i = __pyx_t_11; + + /* "cyext_acv.pyx":5635 + * + * for i in tqdm(range(N)): + * sdp[i] = single_compute_ddp_rule_weights(X[i], y_X[i], data, y_data, S[i], # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i]) + */ + __pyx_t_12.data = __pyx_v_X.data; + __pyx_t_12.memview = __pyx_v_X.memview; + __PYX_INC_MEMVIEW(&__pyx_t_12, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_X.strides[0]; + __pyx_t_12.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_12.shape[0] = __pyx_v_X.shape[1]; +__pyx_t_12.strides[0] = __pyx_v_X.strides[1]; + __pyx_t_12.suboffsets[0] = -1; + +__pyx_t_13 = __pyx_v_i; + + /* "cyext_acv.pyx":5637 + * sdp[i] = single_compute_ddp_rule_weights(X[i], y_X[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i]) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_14.data = __pyx_v_t.data; + __pyx_t_14.memview = __pyx_v_t.memview; + __PYX_INC_MEMVIEW(&__pyx_t_14, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_t.strides[0]; + __pyx_t_14.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_14.shape[0] = __pyx_v_t.shape[1]; +__pyx_t_14.strides[0] = __pyx_v_t.strides[1]; + __pyx_t_14.suboffsets[0] = -1; + +__pyx_t_8.data = __pyx_v_partition_byobs.data; + __pyx_t_8.memview = __pyx_v_partition_byobs.memview; + __PYX_INC_MEMVIEW(&__pyx_t_8, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_partition_byobs.strides[0]; + __pyx_t_8.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_8.shape[0] = __pyx_v_partition_byobs.shape[1]; +__pyx_t_8.strides[0] = __pyx_v_partition_byobs.strides[1]; + __pyx_t_8.suboffsets[0] = -1; + +__pyx_t_8.shape[1] = __pyx_v_partition_byobs.shape[2]; +__pyx_t_8.strides[1] = __pyx_v_partition_byobs.strides[2]; + __pyx_t_8.suboffsets[1] = -1; + +__pyx_t_15.data = __pyx_v_weights.data; + __pyx_t_15.memview = __pyx_v_weights.memview; + __PYX_INC_MEMVIEW(&__pyx_t_15, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_weights.strides[0]; + __pyx_t_15.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_15.shape[0] = __pyx_v_weights.shape[1]; +__pyx_t_15.strides[0] = __pyx_v_weights.strides[1]; + __pyx_t_15.suboffsets[0] = -1; + +__pyx_t_16 = __pyx_v_i; + + /* "cyext_acv.pyx":5635 + * + * for i in tqdm(range(N)): + * sdp[i] = single_compute_ddp_rule_weights(X[i], y_X[i], data, y_data, S[i], # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i]) + */ + *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_sdp.data) + __pyx_t_16)) )) = __pyx_f_9cyext_acv_single_compute_ddp_rule_weights(__pyx_t_12, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_13)) ))), __pyx_v_data, __pyx_v_y_data, (__pyx_v_S[__pyx_v_i]), __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_t_14, __pyx_t_8, __pyx_t_15); + __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1); + __pyx_t_12.memview = NULL; + __pyx_t_12.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1); + __pyx_t_14.memview = NULL; + __pyx_t_14.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_15, 1); + __pyx_t_15.memview = NULL; + __pyx_t_15.data = NULL; + + /* "cyext_acv.pyx":5634 + * cdef int i, j + * + * for i in tqdm(range(N)): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_ddp_rule_weights(X[i], y_X[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "cyext_acv.pyx":5640 + * + * + * return np.array(sdp), np.array(weights) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_sdp, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_weights, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __pyx_t_1 = 0; + __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "cyext_acv.pyx":5621 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_ddp_weights_verbose(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * int max_depth, int min_node_size, int & classifier, double[:, :] & t, double & pi): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_15, 1); + __Pyx_AddTraceback("cyext_acv.compute_ddp_weights_verbose", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_buffer); + __PYX_XDEC_MEMVIEW(&__pyx_v_partition_byobs, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_weights, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_9cyext_acv_87compute_ddp_weights_verbose(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_9cyext_acv_87compute_ddp_weights_verbose(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + std::vector > __pyx_v_S; + __Pyx_memviewslice __pyx_v_features = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_thresholds = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_left = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_right = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_max_depth; + int __pyx_v_min_node_size; + int __pyx_v_classifier; + __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } }; + double __pyx_v_pi; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("compute_ddp_weights_verbose (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_y_X,&__pyx_n_s_data,&__pyx_n_s_y_data,&__pyx_n_s_S,&__pyx_n_s_features,&__pyx_n_s_thresholds,&__pyx_n_s_children_left,&__pyx_n_s_children_right,&__pyx_n_s_max_depth,&__pyx_n_s_min_node_size,&__pyx_n_s_classifier,&__pyx_n_s_t,&__pyx_n_s_pi,0}; + PyObject* values[14] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_X)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_weights_verbose", 1, 14, 14, 1); __PYX_ERR(0, 5621, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_weights_verbose", 1, 14, 14, 2); __PYX_ERR(0, 5621, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_weights_verbose", 1, 14, 14, 3); __PYX_ERR(0, 5621, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_S)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_weights_verbose", 1, 14, 14, 4); __PYX_ERR(0, 5621, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_features)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_weights_verbose", 1, 14, 14, 5); __PYX_ERR(0, 5621, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thresholds)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_weights_verbose", 1, 14, 14, 6); __PYX_ERR(0, 5621, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_left)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_weights_verbose", 1, 14, 14, 7); __PYX_ERR(0, 5621, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_weights_verbose", 1, 14, 14, 8); __PYX_ERR(0, 5621, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_weights_verbose", 1, 14, 14, 9); __PYX_ERR(0, 5621, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_node_size)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_weights_verbose", 1, 14, 14, 10); __PYX_ERR(0, 5621, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classifier)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_weights_verbose", 1, 14, 14, 11); __PYX_ERR(0, 5621, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_weights_verbose", 1, 14, 14, 12); __PYX_ERR(0, 5621, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 13: + if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pi)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_weights_verbose", 1, 14, 14, 13); __PYX_ERR(0, 5621, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_ddp_weights_verbose") < 0)) __PYX_ERR(0, 5621, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 14) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + } + __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 5621, __pyx_L3_error) + __pyx_v_y_X = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_X.memview)) __PYX_ERR(0, 5621, __pyx_L3_error) + __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 5621, __pyx_L3_error) + __pyx_v_y_data = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_data.memview)) __PYX_ERR(0, 5621, __pyx_L3_error) + __pyx_v_S = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_int_3e___(values[4]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5621, __pyx_L3_error) + __pyx_v_features = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_features.memview)) __PYX_ERR(0, 5622, __pyx_L3_error) + __pyx_v_thresholds = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_thresholds.memview)) __PYX_ERR(0, 5622, __pyx_L3_error) + __pyx_v_children_left = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_left.memview)) __PYX_ERR(0, 5622, __pyx_L3_error) + __pyx_v_children_right = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_right.memview)) __PYX_ERR(0, 5622, __pyx_L3_error) + __pyx_v_max_depth = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5623, __pyx_L3_error) + __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5623, __pyx_L3_error) + __pyx_v_classifier = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5623, __pyx_L3_error) + __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[12], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 5623, __pyx_L3_error) + __pyx_v_pi = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_pi == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5623, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("compute_ddp_weights_verbose", 1, 14, 14, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5621, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cyext_acv.compute_ddp_weights_verbose", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_9cyext_acv_86compute_ddp_weights_verbose(__pyx_self, __pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_v_pi); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9cyext_acv_86compute_ddp_weights_verbose(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t, double __pyx_v_pi) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_ddp_weights_verbose", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundLocalError("X"); __PYX_ERR(0, 5621, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_X.memview)) { __Pyx_RaiseUnboundLocalError("y_X"); __PYX_ERR(0, 5621, __pyx_L1_error) } + if (unlikely(!__pyx_v_data.memview)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 5621, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_data.memview)) { __Pyx_RaiseUnboundLocalError("y_data"); __PYX_ERR(0, 5621, __pyx_L1_error) } + if (unlikely(!__pyx_v_features.memview)) { __Pyx_RaiseUnboundLocalError("features"); __PYX_ERR(0, 5621, __pyx_L1_error) } + if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 5621, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 5621, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 5621, __pyx_L1_error) } + if (unlikely(!__pyx_v_t.memview)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 5621, __pyx_L1_error) } + __pyx_t_1 = __pyx_f_9cyext_acv_compute_ddp_weights_verbose(__pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_v_pi, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5621, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cyext_acv.compute_ddp_weights_verbose", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_features, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_thresholds, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_left, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_right, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_t, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cyext_acv.pyx":5647 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cdef double single_compute_ddp_cond_rule_weights(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, # <<<<<<<<<<<<<< + * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + * int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition, + */ + +static double __pyx_f_9cyext_acv_single_compute_ddp_cond_rule_weights(__Pyx_memviewslice &__pyx_v_x, double &__pyx_v_y_x, __Pyx_memviewslice &__pyx_v_data, __Pyx_memviewslice &__pyx_v_y_data, std::vector &__pyx_v_S, __Pyx_memviewslice &__pyx_v_features, __Pyx_memviewslice &__pyx_v_thresholds, __Pyx_memviewslice &__pyx_v_children_left, __Pyx_memviewslice &__pyx_v_children_right, int &__pyx_v_max_depth, int &__pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, __Pyx_memviewslice &__pyx_v_partition, __Pyx_memviewslice &__pyx_v_w, __Pyx_memviewslice &__pyx_v_cond) { + unsigned int __pyx_v_n_trees; + unsigned int __pyx_v_N; + double __pyx_v_sdp; + int __pyx_v_b; + CYTHON_UNUSED int __pyx_v_level; + int __pyx_v_i; + int __pyx_v_it_node; + std::set __pyx_v_nodes_level; + std::set __pyx_v_nodes_child; + std::set __pyx_v_in_data; + std::set __pyx_v_in_data_b; + std::set ::iterator __pyx_v_it; + std::set ::iterator __pyx_v_it_point; + double __pyx_r; + unsigned int __pyx_t_1; + unsigned int __pyx_t_2; + int __pyx_t_3; + unsigned int __pyx_t_4; + unsigned int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "cyext_acv.pyx":5652 + * double[:] & w, const double[:, :] & cond) nogil: + * + * cdef unsigned int n_trees = features.shape[0] # <<<<<<<<<<<<<< + * cdef unsigned int N = data.shape[0] + * cdef double s, sdp + */ + __pyx_v_n_trees = (__pyx_v_features.shape[0]); + + /* "cyext_acv.pyx":5653 + * + * cdef unsigned int n_trees = features.shape[0] + * cdef unsigned int N = data.shape[0] # <<<<<<<<<<<<<< + * cdef double s, sdp + * cdef int o + */ + __pyx_v_N = (__pyx_v_data.shape[0]); + + /* "cyext_acv.pyx":5656 + * cdef double s, sdp + * cdef int o + * sdp = 0 # <<<<<<<<<<<<<< + * + * cdef int b, level, i, it_node + */ + __pyx_v_sdp = 0.0; + + /* "cyext_acv.pyx":5662 + * cdef set[int].iterator it, it_point + * + * for b in range(n_trees): # <<<<<<<<<<<<<< + * nodes_child.clear() + * nodes_level.clear() + */ + __pyx_t_1 = __pyx_v_n_trees; + __pyx_t_2 = __pyx_t_1; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_b = __pyx_t_3; + + /* "cyext_acv.pyx":5663 + * + * for b in range(n_trees): + * nodes_child.clear() # <<<<<<<<<<<<<< + * nodes_level.clear() + * nodes_level.insert(0) + */ + __pyx_v_nodes_child.clear(); + + /* "cyext_acv.pyx":5664 + * for b in range(n_trees): + * nodes_child.clear() + * nodes_level.clear() # <<<<<<<<<<<<<< + * nodes_level.insert(0) + * + */ + __pyx_v_nodes_level.clear(); + + /* "cyext_acv.pyx":5665 + * nodes_child.clear() + * nodes_level.clear() + * nodes_level.insert(0) # <<<<<<<<<<<<<< + * + * in_data.clear() + */ + try { + __pyx_v_nodes_level.insert(0); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 5665, __pyx_L1_error) + } + + /* "cyext_acv.pyx":5667 + * nodes_level.insert(0) + * + * in_data.clear() # <<<<<<<<<<<<<< + * in_data_b.clear() + * for i in range(N): + */ + __pyx_v_in_data.clear(); + + /* "cyext_acv.pyx":5668 + * + * in_data.clear() + * in_data_b.clear() # <<<<<<<<<<<<<< + * for i in range(N): + * in_data.insert(i) + */ + __pyx_v_in_data_b.clear(); + + /* "cyext_acv.pyx":5669 + * in_data.clear() + * in_data_b.clear() + * for i in range(N): # <<<<<<<<<<<<<< + * in_data.insert(i) + * in_data_b.insert(i) + */ + __pyx_t_4 = __pyx_v_N; + __pyx_t_5 = __pyx_t_4; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "cyext_acv.pyx":5670 + * in_data_b.clear() + * for i in range(N): + * in_data.insert(i) # <<<<<<<<<<<<<< + * in_data_b.insert(i) + * + */ + try { + __pyx_v_in_data.insert(__pyx_v_i); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 5670, __pyx_L1_error) + } + + /* "cyext_acv.pyx":5671 + * for i in range(N): + * in_data.insert(i) + * in_data_b.insert(i) # <<<<<<<<<<<<<< + * + * for level in range(max_depth): + */ + try { + __pyx_v_in_data_b.insert(__pyx_v_i); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 5671, __pyx_L1_error) + } + } + + /* "cyext_acv.pyx":5673 + * in_data_b.insert(i) + * + * for level in range(max_depth): # <<<<<<<<<<<<<< + * it_point = nodes_level.begin() + * while(it_point != nodes_level.end()): + */ + __pyx_t_6 = __pyx_v_max_depth; + __pyx_t_7 = __pyx_t_6; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_level = __pyx_t_8; + + /* "cyext_acv.pyx":5674 + * + * for level in range(max_depth): + * it_point = nodes_level.begin() # <<<<<<<<<<<<<< + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) + */ + __pyx_v_it_point = __pyx_v_nodes_level.begin(); + + /* "cyext_acv.pyx":5675 + * for level in range(max_depth): + * it_point = nodes_level.begin() + * while(it_point != nodes_level.end()): # <<<<<<<<<<<<<< + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it_point != __pyx_v_nodes_level.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":5676 + * it_point = nodes_level.begin() + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) # <<<<<<<<<<<<<< + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * if x[features[b, it_node]] <= thresholds[b, it_node]: + */ + __pyx_v_it_node = (*__pyx_v_it_point); + + /* "cyext_acv.pyx":5677 + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): # <<<<<<<<<<<<<< + * if x[features[b, it_node]] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) + */ + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_9 = ((std::find ::iterator,int>(__pyx_v_S.begin(), __pyx_v_S.end(), (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_10 * __pyx_v_features.strides[0]) ) + __pyx_t_11 * __pyx_v_features.strides[1]) )))) != __pyx_v_S.end()) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":5678 + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * if x[features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * + */ + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_12 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_11 * __pyx_v_features.strides[0]) ) + __pyx_t_10 * __pyx_v_features.strides[1]) ))); + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_12 * __pyx_v_x.strides[0]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_13 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_14 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":5679 + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * if x[features[b, it_node]] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) # <<<<<<<<<<<<<< + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + */ + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_left.data + __pyx_t_14 * __pyx_v_children_left.strides[0]) ) + __pyx_t_13 * __pyx_v_children_left.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 5679, __pyx_L1_error) + } + + /* "cyext_acv.pyx":5681 + * nodes_child.insert(children_left[b, it_node]) + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 1] = thresholds[b, it_node] + * + */ + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + __pyx_t_10 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_13 * __pyx_v_features.strides[0]) ) + __pyx_t_14 * __pyx_v_features.strides[1]) ))); + __pyx_t_11 = 1; + __pyx_t_12 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_10 * __pyx_v_partition.strides[0]) ) + __pyx_t_11 * __pyx_v_partition.strides[1]) ))) >= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_12 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_15 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":5682 + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + * partition[features[b, it_node], 1] = thresholds[b, it_node] # <<<<<<<<<<<<<< + * + * it = in_data.begin() + */ + __pyx_t_15 = __pyx_v_b; + __pyx_t_12 = __pyx_v_it_node; + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_11 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_14 * __pyx_v_features.strides[0]) ) + __pyx_t_13 * __pyx_v_features.strides[1]) ))); + __pyx_t_10 = 1; + *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_11 * __pyx_v_partition.strides[0]) ) + __pyx_t_10 * __pyx_v_partition.strides[1]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_15 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_12 * __pyx_v_thresholds.strides[1]) ))); + + /* "cyext_acv.pyx":5681 + * nodes_child.insert(children_left[b, it_node]) + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 1] = thresholds[b, it_node] + * + */ + } + + /* "cyext_acv.pyx":5684 + * partition[features[b, it_node], 1] = thresholds[b, it_node] + * + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + */ + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":5685 + * + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":5686 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + __pyx_t_12 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_13 = (*__pyx_v_it); + __pyx_t_14 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_12 * __pyx_v_features.strides[0]) ) + __pyx_t_15 * __pyx_v_features.strides[1]) ))); + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_data.data + __pyx_t_13 * __pyx_v_data.strides[0]) ) + __pyx_t_14 * __pyx_v_data.strides[1]) ))) > (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_10 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_11 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":5687 + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) # <<<<<<<<<<<<<< + * inc(it) + * in_data = in_data_b + */ + (void)(__pyx_v_in_data_b.erase((*__pyx_v_it))); + + /* "cyext_acv.pyx":5686 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + } + + /* "cyext_acv.pyx":5688 + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + * inc(it) # <<<<<<<<<<<<<< + * in_data = in_data_b + * + */ + (void)((++__pyx_v_it)); + } + + /* "cyext_acv.pyx":5689 + * in_data_b.erase(deref(it)) + * inc(it) + * in_data = in_data_b # <<<<<<<<<<<<<< + * + * else: + */ + __pyx_v_in_data = __pyx_v_in_data_b; + + /* "cyext_acv.pyx":5678 + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * if x[features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * + */ + goto __pyx_L12; + } + + /* "cyext_acv.pyx":5692 + * + * else: + * nodes_child.insert(children_right[b, it_node]) # <<<<<<<<<<<<<< + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: + */ + /*else*/ { + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_right.data + __pyx_t_11 * __pyx_v_children_right.strides[0]) ) + __pyx_t_10 * __pyx_v_children_right.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 5692, __pyx_L1_error) + } + + /* "cyext_acv.pyx":5694 + * nodes_child.insert(children_right[b, it_node]) + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 0] = thresholds[b, it_node] + * + */ + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_15 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_10 * __pyx_v_features.strides[0]) ) + __pyx_t_11 * __pyx_v_features.strides[1]) ))); + __pyx_t_12 = 0; + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_15 * __pyx_v_partition.strides[0]) ) + __pyx_t_12 * __pyx_v_partition.strides[1]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_14 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_13 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":5695 + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: + * partition[features[b, it_node], 0] = thresholds[b, it_node] # <<<<<<<<<<<<<< + * + * it = in_data.begin() + */ + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_12 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_11 * __pyx_v_features.strides[0]) ) + __pyx_t_10 * __pyx_v_features.strides[1]) ))); + __pyx_t_15 = 0; + *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_12 * __pyx_v_partition.strides[0]) ) + __pyx_t_15 * __pyx_v_partition.strides[1]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_13 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_14 * __pyx_v_thresholds.strides[1]) ))); + + /* "cyext_acv.pyx":5694 + * nodes_child.insert(children_right[b, it_node]) + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 0] = thresholds[b, it_node] + * + */ + } + + /* "cyext_acv.pyx":5697 + * partition[features[b, it_node], 0] = thresholds[b, it_node] + * + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + */ + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":5698 + * + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":5699 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_10 = (*__pyx_v_it); + __pyx_t_11 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_14 * __pyx_v_features.strides[0]) ) + __pyx_t_13 * __pyx_v_features.strides[1]) ))); + __pyx_t_15 = __pyx_v_b; + __pyx_t_12 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_data.data + __pyx_t_10 * __pyx_v_data.strides[0]) ) + __pyx_t_11 * __pyx_v_data.strides[1]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_15 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_12 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":5700 + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) # <<<<<<<<<<<<<< + * inc(it) + * in_data = in_data_b + */ + (void)(__pyx_v_in_data_b.erase((*__pyx_v_it))); + + /* "cyext_acv.pyx":5699 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + } + + /* "cyext_acv.pyx":5701 + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + * inc(it) # <<<<<<<<<<<<<< + * in_data = in_data_b + * + */ + (void)((++__pyx_v_it)); + } + + /* "cyext_acv.pyx":5702 + * in_data_b.erase(deref(it)) + * inc(it) + * in_data = in_data_b # <<<<<<<<<<<<<< + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] <= thresholds[b, it_node]: + */ + __pyx_v_in_data = __pyx_v_in_data_b; + } + __pyx_L12:; + + /* "cyext_acv.pyx":5677 + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): # <<<<<<<<<<<<<< + * if x[features[b, it_node]] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) + */ + goto __pyx_L11; + } + + /* "cyext_acv.pyx":5704 + * in_data = in_data_b + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * + */ + __pyx_t_12 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_16 = (((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_12 * __pyx_v_features.strides[0]) ) + __pyx_t_15 * __pyx_v_features.strides[1]) ))) >= 0) != 0); + if (__pyx_t_16) { + } else { + __pyx_t_9 = __pyx_t_16; + goto __pyx_L21_bool_binop_done; + } + __pyx_t_15 = __pyx_v_b; + __pyx_t_12 = __pyx_v_it_node; + __pyx_t_13 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_15 * __pyx_v_features.strides[0]) ) + __pyx_t_12 * __pyx_v_features.strides[1]) ))); + __pyx_t_14 = 1; + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_16 = (((*((double const *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_cond.data + __pyx_t_13 * __pyx_v_cond.strides[0]) ) + __pyx_t_14 * __pyx_v_cond.strides[1]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_11 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_10 * __pyx_v_thresholds.strides[1]) )))) != 0); + __pyx_t_9 = __pyx_t_16; + __pyx_L21_bool_binop_done:; + if (__pyx_t_9) { + + /* "cyext_acv.pyx":5705 + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) # <<<<<<<<<<<<<< + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + */ + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_left.data + __pyx_t_10 * __pyx_v_children_left.strides[0]) ) + __pyx_t_11 * __pyx_v_children_left.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 5705, __pyx_L1_error) + } + + /* "cyext_acv.pyx":5707 + * nodes_child.insert(children_left[b, it_node]) + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 1] = thresholds[b, it_node] + * + */ + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_12 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_11 * __pyx_v_features.strides[0]) ) + __pyx_t_10 * __pyx_v_features.strides[1]) ))); + __pyx_t_15 = 1; + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_12 * __pyx_v_partition.strides[0]) ) + __pyx_t_15 * __pyx_v_partition.strides[1]) ))) >= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_14 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_13 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":5708 + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + * partition[features[b, it_node], 1] = thresholds[b, it_node] # <<<<<<<<<<<<<< + * + * it = in_data.begin() + */ + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_15 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_10 * __pyx_v_features.strides[0]) ) + __pyx_t_11 * __pyx_v_features.strides[1]) ))); + __pyx_t_12 = 1; + *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_15 * __pyx_v_partition.strides[0]) ) + __pyx_t_12 * __pyx_v_partition.strides[1]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_13 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_14 * __pyx_v_thresholds.strides[1]) ))); + + /* "cyext_acv.pyx":5707 + * nodes_child.insert(children_left[b, it_node]) + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 1] = thresholds[b, it_node] + * + */ + } + + /* "cyext_acv.pyx":5710 + * partition[features[b, it_node], 1] = thresholds[b, it_node] + * + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + */ + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":5711 + * + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":5712 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_11 = (*__pyx_v_it); + __pyx_t_10 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_14 * __pyx_v_features.strides[0]) ) + __pyx_t_13 * __pyx_v_features.strides[1]) ))); + __pyx_t_12 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_data.data + __pyx_t_11 * __pyx_v_data.strides[0]) ) + __pyx_t_10 * __pyx_v_data.strides[1]) ))) > (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_12 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_15 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":5713 + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) # <<<<<<<<<<<<<< + * inc(it) + * in_data = in_data_b + */ + (void)(__pyx_v_in_data_b.erase((*__pyx_v_it))); + + /* "cyext_acv.pyx":5712 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + } + + /* "cyext_acv.pyx":5714 + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + * inc(it) # <<<<<<<<<<<<<< + * in_data = in_data_b + * + */ + (void)((++__pyx_v_it)); + } + + /* "cyext_acv.pyx":5715 + * in_data_b.erase(deref(it)) + * inc(it) + * in_data = in_data_b # <<<<<<<<<<<<<< + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 0] > thresholds[b, it_node]: + */ + __pyx_v_in_data = __pyx_v_in_data_b; + + /* "cyext_acv.pyx":5704 + * in_data = in_data_b + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * + */ + goto __pyx_L11; + } + + /* "cyext_acv.pyx":5717 + * in_data = in_data_b + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 0] > thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_right[b, it_node]) + * + */ + __pyx_t_15 = __pyx_v_b; + __pyx_t_12 = __pyx_v_it_node; + __pyx_t_16 = (((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_15 * __pyx_v_features.strides[0]) ) + __pyx_t_12 * __pyx_v_features.strides[1]) ))) >= 0) != 0); + if (__pyx_t_16) { + } else { + __pyx_t_9 = __pyx_t_16; + goto __pyx_L27_bool_binop_done; + } + __pyx_t_12 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_13 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_12 * __pyx_v_features.strides[0]) ) + __pyx_t_15 * __pyx_v_features.strides[1]) ))); + __pyx_t_14 = 0; + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_16 = (((*((double const *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_cond.data + __pyx_t_13 * __pyx_v_cond.strides[0]) ) + __pyx_t_14 * __pyx_v_cond.strides[1]) ))) > (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_10 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_11 * __pyx_v_thresholds.strides[1]) )))) != 0); + __pyx_t_9 = __pyx_t_16; + __pyx_L27_bool_binop_done:; + if (__pyx_t_9) { + + /* "cyext_acv.pyx":5718 + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 0] > thresholds[b, it_node]: + * nodes_child.insert(children_right[b, it_node]) # <<<<<<<<<<<<<< + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: + */ + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_right.data + __pyx_t_11 * __pyx_v_children_right.strides[0]) ) + __pyx_t_10 * __pyx_v_children_right.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 5718, __pyx_L1_error) + } + + /* "cyext_acv.pyx":5720 + * nodes_child.insert(children_right[b, it_node]) + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 0] = thresholds[b, it_node] + * + */ + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_15 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_10 * __pyx_v_features.strides[0]) ) + __pyx_t_11 * __pyx_v_features.strides[1]) ))); + __pyx_t_12 = 0; + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_15 * __pyx_v_partition.strides[0]) ) + __pyx_t_12 * __pyx_v_partition.strides[1]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_14 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_13 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":5721 + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: + * partition[features[b, it_node], 0] = thresholds[b, it_node] # <<<<<<<<<<<<<< + * + * it = in_data.begin() + */ + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_12 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_11 * __pyx_v_features.strides[0]) ) + __pyx_t_10 * __pyx_v_features.strides[1]) ))); + __pyx_t_15 = 0; + *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_12 * __pyx_v_partition.strides[0]) ) + __pyx_t_15 * __pyx_v_partition.strides[1]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_13 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_14 * __pyx_v_thresholds.strides[1]) ))); + + /* "cyext_acv.pyx":5720 + * nodes_child.insert(children_right[b, it_node]) + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 0] = thresholds[b, it_node] + * + */ + } + + /* "cyext_acv.pyx":5723 + * partition[features[b, it_node], 0] = thresholds[b, it_node] + * + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + */ + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":5724 + * + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":5725 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_10 = (*__pyx_v_it); + __pyx_t_11 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_14 * __pyx_v_features.strides[0]) ) + __pyx_t_13 * __pyx_v_features.strides[1]) ))); + __pyx_t_15 = __pyx_v_b; + __pyx_t_12 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_data.data + __pyx_t_10 * __pyx_v_data.strides[0]) ) + __pyx_t_11 * __pyx_v_data.strides[1]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_15 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_12 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":5726 + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) # <<<<<<<<<<<<<< + * inc(it) + * in_data = in_data_b + */ + (void)(__pyx_v_in_data_b.erase((*__pyx_v_it))); + + /* "cyext_acv.pyx":5725 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + } + + /* "cyext_acv.pyx":5727 + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + * inc(it) # <<<<<<<<<<<<<< + * in_data = in_data_b + * + */ + (void)((++__pyx_v_it)); + } + + /* "cyext_acv.pyx":5728 + * in_data_b.erase(deref(it)) + * inc(it) + * in_data = in_data_b # <<<<<<<<<<<<<< + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] >= thresholds[b, it_node] and cond[features[b, it_node], 0] <= thresholds[b, it_node]: + */ + __pyx_v_in_data = __pyx_v_in_data_b; + + /* "cyext_acv.pyx":5717 + * in_data = in_data_b + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 0] > thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_right[b, it_node]) + * + */ + goto __pyx_L11; + } + + /* "cyext_acv.pyx":5730 + * in_data = in_data_b + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] >= thresholds[b, it_node] and cond[features[b, it_node], 0] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * nodes_child.insert(children_right[b, it_node]) + */ + __pyx_t_12 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_16 = (((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_12 * __pyx_v_features.strides[0]) ) + __pyx_t_15 * __pyx_v_features.strides[1]) ))) >= 0) != 0); + if (__pyx_t_16) { + } else { + __pyx_t_9 = __pyx_t_16; + goto __pyx_L33_bool_binop_done; + } + __pyx_t_15 = __pyx_v_b; + __pyx_t_12 = __pyx_v_it_node; + __pyx_t_13 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_15 * __pyx_v_features.strides[0]) ) + __pyx_t_12 * __pyx_v_features.strides[1]) ))); + __pyx_t_14 = 1; + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_16 = (((*((double const *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_cond.data + __pyx_t_13 * __pyx_v_cond.strides[0]) ) + __pyx_t_14 * __pyx_v_cond.strides[1]) ))) >= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_11 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_10 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_16) { + } else { + __pyx_t_9 = __pyx_t_16; + goto __pyx_L33_bool_binop_done; + } + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_12 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_10 * __pyx_v_features.strides[0]) ) + __pyx_t_11 * __pyx_v_features.strides[1]) ))); + __pyx_t_15 = 0; + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_16 = (((*((double const *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_cond.data + __pyx_t_12 * __pyx_v_cond.strides[0]) ) + __pyx_t_15 * __pyx_v_cond.strides[1]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_14 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_13 * __pyx_v_thresholds.strides[1]) )))) != 0); + __pyx_t_9 = __pyx_t_16; + __pyx_L33_bool_binop_done:; + if (__pyx_t_9) { + + /* "cyext_acv.pyx":5731 + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] >= thresholds[b, it_node] and cond[features[b, it_node], 0] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) # <<<<<<<<<<<<<< + * nodes_child.insert(children_right[b, it_node]) + * + */ + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_left.data + __pyx_t_13 * __pyx_v_children_left.strides[0]) ) + __pyx_t_14 * __pyx_v_children_left.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 5731, __pyx_L1_error) + } + + /* "cyext_acv.pyx":5732 + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] >= thresholds[b, it_node] and cond[features[b, it_node], 0] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) + * nodes_child.insert(children_right[b, it_node]) # <<<<<<<<<<<<<< + * + * # if partition[features[b, it_node], 0] <= thresholds[b, it_node]: # TO DO: compute correctly the partition in this case + */ + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_right.data + __pyx_t_14 * __pyx_v_children_right.strides[0]) ) + __pyx_t_13 * __pyx_v_children_right.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 5732, __pyx_L1_error) + } + + /* "cyext_acv.pyx":5730 + * in_data = in_data_b + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] >= thresholds[b, it_node] and cond[features[b, it_node], 0] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * nodes_child.insert(children_right[b, it_node]) + */ + goto __pyx_L11; + } + + /* "cyext_acv.pyx":5748 + * + * else: + * nodes_child.insert(children_left[b, it_node]) # <<<<<<<<<<<<<< + * nodes_child.insert(children_right[b, it_node]) + * + */ + /*else*/ { + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_left.data + __pyx_t_13 * __pyx_v_children_left.strides[0]) ) + __pyx_t_14 * __pyx_v_children_left.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 5748, __pyx_L1_error) + } + + /* "cyext_acv.pyx":5749 + * else: + * nodes_child.insert(children_left[b, it_node]) + * nodes_child.insert(children_right[b, it_node]) # <<<<<<<<<<<<<< + * + * if in_data.size() < min_node_size: + */ + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_right.data + __pyx_t_14 * __pyx_v_children_right.strides[0]) ) + __pyx_t_13 * __pyx_v_children_right.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 5749, __pyx_L1_error) + } + } + __pyx_L11:; + + /* "cyext_acv.pyx":5751 + * nodes_child.insert(children_right[b, it_node]) + * + * if in_data.size() < min_node_size: # <<<<<<<<<<<<<< + * break + * inc(it_point) + */ + __pyx_t_9 = ((__pyx_v_in_data.size() < __pyx_v_min_node_size) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":5752 + * + * if in_data.size() < min_node_size: + * break # <<<<<<<<<<<<<< + * inc(it_point) + * + */ + goto __pyx_L10_break; + + /* "cyext_acv.pyx":5751 + * nodes_child.insert(children_right[b, it_node]) + * + * if in_data.size() < min_node_size: # <<<<<<<<<<<<<< + * break + * inc(it_point) + */ + } + + /* "cyext_acv.pyx":5753 + * if in_data.size() < min_node_size: + * break + * inc(it_point) # <<<<<<<<<<<<<< + * + * nodes_level = nodes_child + */ + (void)((++__pyx_v_it_point)); + } + __pyx_L10_break:; + + /* "cyext_acv.pyx":5755 + * inc(it_point) + * + * nodes_level = nodes_child # <<<<<<<<<<<<<< + * + * if classifier == 1: + */ + __pyx_v_nodes_level = __pyx_v_nodes_child; + } + + /* "cyext_acv.pyx":5757 + * nodes_level = nodes_child + * + * if classifier == 1: # <<<<<<<<<<<<<< + * it = in_data.begin() + * while(it != in_data.end()): + */ + __pyx_t_9 = ((__pyx_v_classifier == 1) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":5758 + * + * if classifier == 1: + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) + */ + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":5759 + * if classifier == 1: + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) + * w[deref(it)] += (1./(n_trees*in_data.size())) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":5760 + * it = in_data.begin() + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) # <<<<<<<<<<<<<< + * w[deref(it)] += (1./(n_trees*in_data.size())) + * inc(it) + */ + __pyx_t_13 = (*__pyx_v_it); + __pyx_v_sdp = (__pyx_v_sdp + ((1. / (__pyx_v_n_trees * __pyx_v_in_data.size())) * (__pyx_v_y_x != (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_13)) )))))); + + /* "cyext_acv.pyx":5761 + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) + * w[deref(it)] += (1./(n_trees*in_data.size())) # <<<<<<<<<<<<<< + * inc(it) + * else: + */ + __pyx_t_13 = (*__pyx_v_it); + *((double *) ( /* dim=0 */ (__pyx_v_w.data + __pyx_t_13 * __pyx_v_w.strides[0]) )) += (1. / (__pyx_v_n_trees * __pyx_v_in_data.size())); + + /* "cyext_acv.pyx":5762 + * sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) + * w[deref(it)] += (1./(n_trees*in_data.size())) + * inc(it) # <<<<<<<<<<<<<< + * else: + * it = in_data.begin() + */ + (void)((++__pyx_v_it)); + } + + /* "cyext_acv.pyx":5757 + * nodes_level = nodes_child + * + * if classifier == 1: # <<<<<<<<<<<<<< + * it = in_data.begin() + * while(it != in_data.end()): + */ + goto __pyx_L37; + } + + /* "cyext_acv.pyx":5764 + * inc(it) + * else: + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (1-(t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) + */ + /*else*/ { + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":5765 + * else: + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * sdp += (1./(n_trees*in_data.size())) * (1-(t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) + * w[deref(it)] += (1./(n_trees*in_data.size())) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":5766 + * it = in_data.begin() + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (1-(t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) # <<<<<<<<<<<<<< + * w[deref(it)] += (1./(n_trees*in_data.size())) + * inc(it) + */ + __pyx_t_13 = 0; + __pyx_t_14 = (*__pyx_v_it); + __pyx_t_11 = (*__pyx_v_it); + __pyx_t_10 = 1; + __pyx_v_sdp = (__pyx_v_sdp + ((1. / (__pyx_v_n_trees * __pyx_v_in_data.size())) * (1 - (((*((double *) ( /* dim=0 */ (__pyx_v_t.data + __pyx_t_13 * __pyx_v_t.strides[0]) ))) <= (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_14)) )))) * ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_11)) ))) <= (*((double *) ( /* dim=0 */ (__pyx_v_t.data + __pyx_t_10 * __pyx_v_t.strides[0]) )))))))); + + /* "cyext_acv.pyx":5767 + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (1-(t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) + * w[deref(it)] += (1./(n_trees*in_data.size())) # <<<<<<<<<<<<<< + * inc(it) + * + */ + __pyx_t_10 = (*__pyx_v_it); + *((double *) ( /* dim=0 */ (__pyx_v_w.data + __pyx_t_10 * __pyx_v_w.strides[0]) )) += (1. / (__pyx_v_n_trees * __pyx_v_in_data.size())); + + /* "cyext_acv.pyx":5768 + * sdp += (1./(n_trees*in_data.size())) * (1-(t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) + * w[deref(it)] += (1./(n_trees*in_data.size())) + * inc(it) # <<<<<<<<<<<<<< + * + * return sdp + */ + (void)((++__pyx_v_it)); + } + } + __pyx_L37:; + } + + /* "cyext_acv.pyx":5770 + * inc(it) + * + * return sdp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_sdp; + goto __pyx_L0; + + /* "cyext_acv.pyx":5647 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cdef double single_compute_ddp_cond_rule_weights(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, # <<<<<<<<<<<<<< + * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + * int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("cyext_acv.single_compute_ddp_cond_rule_weights", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_r = 0; + __pyx_L0:; + return __pyx_r; +} + +/* "cyext_acv.pyx":5777 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_ddp_cond_weights(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * const double [:, :, :] & cond, + */ + +static PyObject *__pyx_pw_9cyext_acv_89compute_ddp_cond_weights(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_ddp_cond_weights(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, __Pyx_memviewslice &__pyx_v_cond, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, CYTHON_UNUSED double &__pyx_v_pi, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_buffer = NULL; + __Pyx_memviewslice __pyx_v_partition_byobs = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_N; + __Pyx_memviewslice __pyx_v_sdp = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_weights = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_13; + __Pyx_memviewslice __pyx_t_14 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_15 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_16 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_ddp_cond_weights", 0); + + /* "cyext_acv.pyx":5782 + * int max_depth, int min_node_size, int & classifier, double[:, :] & t, double & pi): + * + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) # <<<<<<<<<<<<<< + * buffer[:, :, 0] = -1e+10 + * cdef double [:, :, :] partition_byobs = buffer + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5782, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ones); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5782, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5782, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_X.shape[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5782, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_X.shape[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5782, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5782, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_INCREF(__pyx_int_2); + __Pyx_GIVEREF(__pyx_int_2); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_2); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 5782, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5782, __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 = PyNumber_Multiply(__pyx_float_1e_10, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5782, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_buffer = __pyx_t_1; + __pyx_t_1 = 0; + + /* "cyext_acv.pyx":5783 + * + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + * buffer[:, :, 0] = -1e+10 # <<<<<<<<<<<<<< + * cdef double [:, :, :] partition_byobs = buffer + * + */ + if (unlikely(PyObject_SetItem(__pyx_v_buffer, __pyx_tuple__3, __pyx_float_neg_1e_10) < 0)) __PYX_ERR(0, 5783, __pyx_L1_error) + + /* "cyext_acv.pyx":5784 + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + * buffer[:, :, 0] = -1e+10 + * cdef double [:, :, :] partition_byobs = buffer # <<<<<<<<<<<<<< + * + * cdef int N = X.shape[0] + */ + __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_v_buffer, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 5784, __pyx_L1_error) + __pyx_v_partition_byobs = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "cyext_acv.pyx":5786 + * cdef double [:, :, :] partition_byobs = buffer + * + * cdef int N = X.shape[0] # <<<<<<<<<<<<<< + * cdef double[::1] sdp = np.zeros(N) + * cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + */ + __pyx_v_N = (__pyx_v_X.shape[0]); + + /* "cyext_acv.pyx":5787 + * + * cdef int N = X.shape[0] + * cdef double[::1] sdp = np.zeros(N) # <<<<<<<<<<<<<< + * cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + * cdef int i, j + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5787, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5787, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5787, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5787, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 5787, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp = __pyx_t_7; + __pyx_t_7.memview = NULL; + __pyx_t_7.data = NULL; + + /* "cyext_acv.pyx":5788 + * cdef int N = X.shape[0] + * cdef double[::1] sdp = np.zeros(N) + * cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) # <<<<<<<<<<<<<< + * cdef int i, j + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_data.shape[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __pyx_t_5 = 0; + __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_3) < 0) __PYX_ERR(0, 5788, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 5788, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_weights = __pyx_t_8; + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; + + /* "cyext_acv.pyx":5791 + * cdef int i, j + * + * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_ddp_cond_rule_weights(X[i], y_X[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + __pyx_t_9 = __pyx_v_N; + if ((1 == 0)) abort(); + { + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) (x) + #define unlikely(x) (x) + #endif + __pyx_t_11 = (__pyx_t_9 - 0 + 1 - 1/abs(1)) / 1; + if (__pyx_t_11 > 0) + { + #ifdef _OPENMP + #pragma omp parallel private(__pyx_t_13, __pyx_t_17) firstprivate(__pyx_t_12, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_8) + #endif /* _OPENMP */ + { + #ifdef _OPENMP + #pragma omp for firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) schedule(dynamic) + #endif /* _OPENMP */ + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_11; __pyx_t_10++){ + { + __pyx_v_i = (int)(0 + 1 * __pyx_t_10); + + /* "cyext_acv.pyx":5792 + * + * for i in prange(N, nogil=True, schedule='dynamic'): + * sdp[i] = single_compute_ddp_cond_rule_weights(X[i], y_X[i], data, y_data, S[i], # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i], cond[i]) + */ + __pyx_t_12.data = __pyx_v_X.data; + __pyx_t_12.memview = __pyx_v_X.memview; + __PYX_INC_MEMVIEW(&__pyx_t_12, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_X.strides[0]; + __pyx_t_12.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_12.shape[0] = __pyx_v_X.shape[1]; +__pyx_t_12.strides[0] = __pyx_v_X.strides[1]; + __pyx_t_12.suboffsets[0] = -1; + +__pyx_t_13 = __pyx_v_i; + + /* "cyext_acv.pyx":5794 + * sdp[i] = single_compute_ddp_cond_rule_weights(X[i], y_X[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i], cond[i]) # <<<<<<<<<<<<<< + * + * return np.array(sdp), np.array(weights) + */ + __pyx_t_14.data = __pyx_v_t.data; + __pyx_t_14.memview = __pyx_v_t.memview; + __PYX_INC_MEMVIEW(&__pyx_t_14, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_t.strides[0]; + __pyx_t_14.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_14.shape[0] = __pyx_v_t.shape[1]; +__pyx_t_14.strides[0] = __pyx_v_t.strides[1]; + __pyx_t_14.suboffsets[0] = -1; + +__pyx_t_8.data = __pyx_v_partition_byobs.data; + __pyx_t_8.memview = __pyx_v_partition_byobs.memview; + __PYX_INC_MEMVIEW(&__pyx_t_8, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_partition_byobs.strides[0]; + __pyx_t_8.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_8.shape[0] = __pyx_v_partition_byobs.shape[1]; +__pyx_t_8.strides[0] = __pyx_v_partition_byobs.strides[1]; + __pyx_t_8.suboffsets[0] = -1; + +__pyx_t_8.shape[1] = __pyx_v_partition_byobs.shape[2]; +__pyx_t_8.strides[1] = __pyx_v_partition_byobs.strides[2]; + __pyx_t_8.suboffsets[1] = -1; + +__pyx_t_15.data = __pyx_v_weights.data; + __pyx_t_15.memview = __pyx_v_weights.memview; + __PYX_INC_MEMVIEW(&__pyx_t_15, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_weights.strides[0]; + __pyx_t_15.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_15.shape[0] = __pyx_v_weights.shape[1]; +__pyx_t_15.strides[0] = __pyx_v_weights.strides[1]; + __pyx_t_15.suboffsets[0] = -1; + +__pyx_t_16.data = __pyx_v_cond.data; + __pyx_t_16.memview = __pyx_v_cond.memview; + __PYX_INC_MEMVIEW(&__pyx_t_16, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_cond.strides[0]; + __pyx_t_16.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_16.shape[0] = __pyx_v_cond.shape[1]; +__pyx_t_16.strides[0] = __pyx_v_cond.strides[1]; + __pyx_t_16.suboffsets[0] = -1; + +__pyx_t_16.shape[1] = __pyx_v_cond.shape[2]; +__pyx_t_16.strides[1] = __pyx_v_cond.strides[2]; + __pyx_t_16.suboffsets[1] = -1; + +__pyx_t_17 = __pyx_v_i; + + /* "cyext_acv.pyx":5792 + * + * for i in prange(N, nogil=True, schedule='dynamic'): + * sdp[i] = single_compute_ddp_cond_rule_weights(X[i], y_X[i], data, y_data, S[i], # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i], cond[i]) + */ + *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_sdp.data) + __pyx_t_17)) )) = __pyx_f_9cyext_acv_single_compute_ddp_cond_rule_weights(__pyx_t_12, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_13)) ))), __pyx_v_data, __pyx_v_y_data, (__pyx_v_S[__pyx_v_i]), __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_t_14, __pyx_t_8, __pyx_t_15, __pyx_t_16); + __PYX_XDEC_MEMVIEW(&__pyx_t_12, 0); + __pyx_t_12.memview = NULL; + __pyx_t_12.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_14, 0); + __pyx_t_14.memview = NULL; + __pyx_t_14.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_8, 0); + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_15, 0); + __pyx_t_15.memview = NULL; + __pyx_t_15.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_16, 0); + __pyx_t_16.memview = NULL; + __pyx_t_16.data = NULL; + } + } + } + } + } + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #endif + } + + /* "cyext_acv.pyx":5791 + * cdef int i, j + * + * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_ddp_cond_rule_weights(X[i], y_X[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "cyext_acv.pyx":5796 + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i], cond[i]) + * + * return np.array(sdp), np.array(weights) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_sdp, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_weights, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __pyx_t_3 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "cyext_acv.pyx":5777 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_ddp_cond_weights(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * const double [:, :, :] & cond, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_15, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1); + __Pyx_AddTraceback("cyext_acv.compute_ddp_cond_weights", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_buffer); + __PYX_XDEC_MEMVIEW(&__pyx_v_partition_byobs, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_weights, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_9cyext_acv_89compute_ddp_cond_weights(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_9cyext_acv_89compute_ddp_cond_weights(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + std::vector > __pyx_v_S; + __Pyx_memviewslice __pyx_v_features = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_thresholds = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_left = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_right = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_cond = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_max_depth; + int __pyx_v_min_node_size; + int __pyx_v_classifier; + __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } }; + double __pyx_v_pi; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("compute_ddp_cond_weights (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_y_X,&__pyx_n_s_data,&__pyx_n_s_y_data,&__pyx_n_s_S,&__pyx_n_s_features,&__pyx_n_s_thresholds,&__pyx_n_s_children_left,&__pyx_n_s_children_right,&__pyx_n_s_cond,&__pyx_n_s_max_depth,&__pyx_n_s_min_node_size,&__pyx_n_s_classifier,&__pyx_n_s_t,&__pyx_n_s_pi,0}; + PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_X)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_cond_weights", 1, 15, 15, 1); __PYX_ERR(0, 5777, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_cond_weights", 1, 15, 15, 2); __PYX_ERR(0, 5777, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_cond_weights", 1, 15, 15, 3); __PYX_ERR(0, 5777, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_S)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_cond_weights", 1, 15, 15, 4); __PYX_ERR(0, 5777, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_features)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_cond_weights", 1, 15, 15, 5); __PYX_ERR(0, 5777, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thresholds)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_cond_weights", 1, 15, 15, 6); __PYX_ERR(0, 5777, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_left)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_cond_weights", 1, 15, 15, 7); __PYX_ERR(0, 5777, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_cond_weights", 1, 15, 15, 8); __PYX_ERR(0, 5777, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_cond_weights", 1, 15, 15, 9); __PYX_ERR(0, 5777, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_cond_weights", 1, 15, 15, 10); __PYX_ERR(0, 5777, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_node_size)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_cond_weights", 1, 15, 15, 11); __PYX_ERR(0, 5777, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classifier)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_cond_weights", 1, 15, 15, 12); __PYX_ERR(0, 5777, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 13: + if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_cond_weights", 1, 15, 15, 13); __PYX_ERR(0, 5777, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 14: + if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pi)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_cond_weights", 1, 15, 15, 14); __PYX_ERR(0, 5777, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_ddp_cond_weights") < 0)) __PYX_ERR(0, 5777, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 15) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + } + __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 5777, __pyx_L3_error) + __pyx_v_y_X = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_X.memview)) __PYX_ERR(0, 5777, __pyx_L3_error) + __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 5777, __pyx_L3_error) + __pyx_v_y_data = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_data.memview)) __PYX_ERR(0, 5777, __pyx_L3_error) + __pyx_v_S = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_int_3e___(values[4]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5777, __pyx_L3_error) + __pyx_v_features = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_features.memview)) __PYX_ERR(0, 5778, __pyx_L3_error) + __pyx_v_thresholds = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_thresholds.memview)) __PYX_ERR(0, 5778, __pyx_L3_error) + __pyx_v_children_left = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_left.memview)) __PYX_ERR(0, 5778, __pyx_L3_error) + __pyx_v_children_right = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_right.memview)) __PYX_ERR(0, 5778, __pyx_L3_error) + __pyx_v_cond = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double__const__(values[9], 0); if (unlikely(!__pyx_v_cond.memview)) __PYX_ERR(0, 5779, __pyx_L3_error) + __pyx_v_max_depth = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5780, __pyx_L3_error) + __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5780, __pyx_L3_error) + __pyx_v_classifier = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5780, __pyx_L3_error) + __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[13], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 5780, __pyx_L3_error) + __pyx_v_pi = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_pi == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5780, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("compute_ddp_cond_weights", 1, 15, 15, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5777, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cyext_acv.compute_ddp_cond_weights", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_9cyext_acv_88compute_ddp_cond_weights(__pyx_self, __pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_cond, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_v_pi); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9cyext_acv_88compute_ddp_cond_weights(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, __Pyx_memviewslice __pyx_v_cond, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t, double __pyx_v_pi) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_ddp_cond_weights", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundLocalError("X"); __PYX_ERR(0, 5777, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_X.memview)) { __Pyx_RaiseUnboundLocalError("y_X"); __PYX_ERR(0, 5777, __pyx_L1_error) } + if (unlikely(!__pyx_v_data.memview)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 5777, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_data.memview)) { __Pyx_RaiseUnboundLocalError("y_data"); __PYX_ERR(0, 5777, __pyx_L1_error) } + if (unlikely(!__pyx_v_features.memview)) { __Pyx_RaiseUnboundLocalError("features"); __PYX_ERR(0, 5777, __pyx_L1_error) } + if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 5777, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 5777, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 5777, __pyx_L1_error) } + if (unlikely(!__pyx_v_cond.memview)) { __Pyx_RaiseUnboundLocalError("cond"); __PYX_ERR(0, 5777, __pyx_L1_error) } + if (unlikely(!__pyx_v_t.memview)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 5777, __pyx_L1_error) } + __pyx_t_1 = __pyx_f_9cyext_acv_compute_ddp_cond_weights(__pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_cond, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_v_pi, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cyext_acv.compute_ddp_cond_weights", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_features, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_thresholds, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_left, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_right, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_cond, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_t, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cyext_acv.pyx":5803 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cdef double single_compute_sdp_rf(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, # <<<<<<<<<<<<<< + * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + * int & max_depth, int & min_node_size, int & classifier, double[:] & t) nogil: + */ + +static double __pyx_f_9cyext_acv_single_compute_sdp_rf(__Pyx_memviewslice &__pyx_v_x, double &__pyx_v_y_x, __Pyx_memviewslice &__pyx_v_data, __Pyx_memviewslice &__pyx_v_y_data, std::vector &__pyx_v_S, __Pyx_memviewslice &__pyx_v_features, __Pyx_memviewslice &__pyx_v_thresholds, __Pyx_memviewslice &__pyx_v_children_left, __Pyx_memviewslice &__pyx_v_children_right, int &__pyx_v_max_depth, int &__pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t) { + unsigned int __pyx_v_n_trees; + unsigned int __pyx_v_N; + double __pyx_v_sdp; + int __pyx_v_b; + CYTHON_UNUSED int __pyx_v_level; + int __pyx_v_i; + int __pyx_v_it_node; + std::set __pyx_v_nodes_level; + std::set __pyx_v_nodes_child; + std::set __pyx_v_in_data; + std::set __pyx_v_in_data_b; + std::set ::iterator __pyx_v_it; + std::set ::iterator __pyx_v_it_point; + double __pyx_r; + unsigned int __pyx_t_1; + unsigned int __pyx_t_2; + int __pyx_t_3; + unsigned int __pyx_t_4; + unsigned int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "cyext_acv.pyx":5807 + * int & max_depth, int & min_node_size, int & classifier, double[:] & t) nogil: + * + * cdef unsigned int n_trees = features.shape[0] # <<<<<<<<<<<<<< + * cdef unsigned int N = data.shape[0] + * cdef double s, sdp + */ + __pyx_v_n_trees = (__pyx_v_features.shape[0]); + + /* "cyext_acv.pyx":5808 + * + * cdef unsigned int n_trees = features.shape[0] + * cdef unsigned int N = data.shape[0] # <<<<<<<<<<<<<< + * cdef double s, sdp + * cdef int o + */ + __pyx_v_N = (__pyx_v_data.shape[0]); + + /* "cyext_acv.pyx":5811 + * cdef double s, sdp + * cdef int o + * sdp = 0 # <<<<<<<<<<<<<< + * + * cdef int b, level, i, it_node + */ + __pyx_v_sdp = 0.0; + + /* "cyext_acv.pyx":5817 + * cdef set[int].iterator it, it_point + * + * for b in range(n_trees): # <<<<<<<<<<<<<< + * nodes_child.clear() + * nodes_level.clear() + */ + __pyx_t_1 = __pyx_v_n_trees; + __pyx_t_2 = __pyx_t_1; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_b = __pyx_t_3; + + /* "cyext_acv.pyx":5818 + * + * for b in range(n_trees): + * nodes_child.clear() # <<<<<<<<<<<<<< + * nodes_level.clear() + * nodes_level.insert(0) + */ + __pyx_v_nodes_child.clear(); + + /* "cyext_acv.pyx":5819 + * for b in range(n_trees): + * nodes_child.clear() + * nodes_level.clear() # <<<<<<<<<<<<<< + * nodes_level.insert(0) + * + */ + __pyx_v_nodes_level.clear(); + + /* "cyext_acv.pyx":5820 + * nodes_child.clear() + * nodes_level.clear() + * nodes_level.insert(0) # <<<<<<<<<<<<<< + * + * in_data.clear() + */ + try { + __pyx_v_nodes_level.insert(0); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 5820, __pyx_L1_error) + } + + /* "cyext_acv.pyx":5822 + * nodes_level.insert(0) + * + * in_data.clear() # <<<<<<<<<<<<<< + * in_data_b.clear() + * for i in range(N): + */ + __pyx_v_in_data.clear(); + + /* "cyext_acv.pyx":5823 + * + * in_data.clear() + * in_data_b.clear() # <<<<<<<<<<<<<< + * for i in range(N): + * in_data.insert(i) + */ + __pyx_v_in_data_b.clear(); + + /* "cyext_acv.pyx":5824 + * in_data.clear() + * in_data_b.clear() + * for i in range(N): # <<<<<<<<<<<<<< + * in_data.insert(i) + * in_data_b.insert(i) + */ + __pyx_t_4 = __pyx_v_N; + __pyx_t_5 = __pyx_t_4; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "cyext_acv.pyx":5825 + * in_data_b.clear() + * for i in range(N): + * in_data.insert(i) # <<<<<<<<<<<<<< + * in_data_b.insert(i) + * + */ + try { + __pyx_v_in_data.insert(__pyx_v_i); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 5825, __pyx_L1_error) + } + + /* "cyext_acv.pyx":5826 + * for i in range(N): + * in_data.insert(i) + * in_data_b.insert(i) # <<<<<<<<<<<<<< + * + * for level in range(max_depth): + */ + try { + __pyx_v_in_data_b.insert(__pyx_v_i); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 5826, __pyx_L1_error) + } + } + + /* "cyext_acv.pyx":5828 + * in_data_b.insert(i) + * + * for level in range(max_depth): # <<<<<<<<<<<<<< + * it_point = nodes_level.begin() + * while(it_point != nodes_level.end()): + */ + __pyx_t_6 = __pyx_v_max_depth; + __pyx_t_7 = __pyx_t_6; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_level = __pyx_t_8; + + /* "cyext_acv.pyx":5829 + * + * for level in range(max_depth): + * it_point = nodes_level.begin() # <<<<<<<<<<<<<< + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) + */ + __pyx_v_it_point = __pyx_v_nodes_level.begin(); + + /* "cyext_acv.pyx":5830 + * for level in range(max_depth): + * it_point = nodes_level.begin() + * while(it_point != nodes_level.end()): # <<<<<<<<<<<<<< + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it_point != __pyx_v_nodes_level.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":5831 + * it_point = nodes_level.begin() + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) # <<<<<<<<<<<<<< + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * if x[features[b, it_node]] <= thresholds[b, it_node]: + */ + __pyx_v_it_node = (*__pyx_v_it_point); + + /* "cyext_acv.pyx":5832 + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): # <<<<<<<<<<<<<< + * if x[features[b, it_node]] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) + */ + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_9 = ((std::find ::iterator,int>(__pyx_v_S.begin(), __pyx_v_S.end(), (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_10 * __pyx_v_features.strides[0]) ) + __pyx_t_11 * __pyx_v_features.strides[1]) )))) != __pyx_v_S.end()) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":5833 + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * if x[features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * + */ + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_12 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_11 * __pyx_v_features.strides[0]) ) + __pyx_t_10 * __pyx_v_features.strides[1]) ))); + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_12 * __pyx_v_x.strides[0]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_13 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_14 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":5834 + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * if x[features[b, it_node]] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) # <<<<<<<<<<<<<< + * + * it = in_data.begin() + */ + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_left.data + __pyx_t_14 * __pyx_v_children_left.strides[0]) ) + __pyx_t_13 * __pyx_v_children_left.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 5834, __pyx_L1_error) + } + + /* "cyext_acv.pyx":5836 + * nodes_child.insert(children_left[b, it_node]) + * + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + */ + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":5837 + * + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":5838 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + __pyx_t_10 = (*__pyx_v_it); + __pyx_t_11 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_13 * __pyx_v_features.strides[0]) ) + __pyx_t_14 * __pyx_v_features.strides[1]) ))); + __pyx_t_12 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_data.data + __pyx_t_10 * __pyx_v_data.strides[0]) ) + __pyx_t_11 * __pyx_v_data.strides[1]) ))) > (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_12 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_15 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":5839 + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) # <<<<<<<<<<<<<< + * inc(it) + * in_data = in_data_b + */ + (void)(__pyx_v_in_data_b.erase((*__pyx_v_it))); + + /* "cyext_acv.pyx":5838 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + } + + /* "cyext_acv.pyx":5840 + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + * inc(it) # <<<<<<<<<<<<<< + * in_data = in_data_b + * + */ + (void)((++__pyx_v_it)); + } + + /* "cyext_acv.pyx":5841 + * in_data_b.erase(deref(it)) + * inc(it) + * in_data = in_data_b # <<<<<<<<<<<<<< + * + * else: + */ + __pyx_v_in_data = __pyx_v_in_data_b; + + /* "cyext_acv.pyx":5833 + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * if x[features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * + */ + goto __pyx_L12; + } + + /* "cyext_acv.pyx":5844 + * + * else: + * nodes_child.insert(children_right[b, it_node]) # <<<<<<<<<<<<<< + * + * it = in_data.begin() + */ + /*else*/ { + __pyx_t_15 = __pyx_v_b; + __pyx_t_12 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_right.data + __pyx_t_15 * __pyx_v_children_right.strides[0]) ) + __pyx_t_12 * __pyx_v_children_right.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 5844, __pyx_L1_error) + } + + /* "cyext_acv.pyx":5846 + * nodes_child.insert(children_right[b, it_node]) + * + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + */ + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":5847 + * + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":5848 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + __pyx_t_12 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_14 = (*__pyx_v_it); + __pyx_t_13 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_12 * __pyx_v_features.strides[0]) ) + __pyx_t_15 * __pyx_v_features.strides[1]) ))); + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_data.data + __pyx_t_14 * __pyx_v_data.strides[0]) ) + __pyx_t_13 * __pyx_v_data.strides[1]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_11 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_10 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":5849 + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) # <<<<<<<<<<<<<< + * inc(it) + * in_data = in_data_b + */ + (void)(__pyx_v_in_data_b.erase((*__pyx_v_it))); + + /* "cyext_acv.pyx":5848 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + } + + /* "cyext_acv.pyx":5850 + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + * inc(it) # <<<<<<<<<<<<<< + * in_data = in_data_b + * else: + */ + (void)((++__pyx_v_it)); + } + + /* "cyext_acv.pyx":5851 + * in_data_b.erase(deref(it)) + * inc(it) + * in_data = in_data_b # <<<<<<<<<<<<<< + * else: + * nodes_child.insert(children_left[b, it_node]) + */ + __pyx_v_in_data = __pyx_v_in_data_b; + } + __pyx_L12:; + + /* "cyext_acv.pyx":5832 + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): # <<<<<<<<<<<<<< + * if x[features[b, it_node]] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) + */ + goto __pyx_L11; + } + + /* "cyext_acv.pyx":5853 + * in_data = in_data_b + * else: + * nodes_child.insert(children_left[b, it_node]) # <<<<<<<<<<<<<< + * nodes_child.insert(children_right[b, it_node]) + * + */ + /*else*/ { + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_left.data + __pyx_t_10 * __pyx_v_children_left.strides[0]) ) + __pyx_t_11 * __pyx_v_children_left.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 5853, __pyx_L1_error) + } + + /* "cyext_acv.pyx":5854 + * else: + * nodes_child.insert(children_left[b, it_node]) + * nodes_child.insert(children_right[b, it_node]) # <<<<<<<<<<<<<< + * + * if in_data.size() < min_node_size: + */ + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_right.data + __pyx_t_11 * __pyx_v_children_right.strides[0]) ) + __pyx_t_10 * __pyx_v_children_right.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 5854, __pyx_L1_error) + } + } + __pyx_L11:; + + /* "cyext_acv.pyx":5856 + * nodes_child.insert(children_right[b, it_node]) + * + * if in_data.size() < min_node_size: # <<<<<<<<<<<<<< + * break + * inc(it_point) + */ + __pyx_t_9 = ((__pyx_v_in_data.size() < __pyx_v_min_node_size) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":5857 + * + * if in_data.size() < min_node_size: + * break # <<<<<<<<<<<<<< + * inc(it_point) + * + */ + goto __pyx_L10_break; + + /* "cyext_acv.pyx":5856 + * nodes_child.insert(children_right[b, it_node]) + * + * if in_data.size() < min_node_size: # <<<<<<<<<<<<<< + * break + * inc(it_point) + */ + } + + /* "cyext_acv.pyx":5858 + * if in_data.size() < min_node_size: + * break + * inc(it_point) # <<<<<<<<<<<<<< + * + * nodes_level = nodes_child + */ + (void)((++__pyx_v_it_point)); + } + __pyx_L10_break:; + + /* "cyext_acv.pyx":5860 + * inc(it_point) + * + * nodes_level = nodes_child # <<<<<<<<<<<<<< + * + * if classifier == 1: + */ + __pyx_v_nodes_level = __pyx_v_nodes_child; + } + + /* "cyext_acv.pyx":5862 + * nodes_level = nodes_child + * + * if classifier == 1: # <<<<<<<<<<<<<< + * it = in_data.begin() + * while(it != in_data.end()): + */ + __pyx_t_9 = ((__pyx_v_classifier == 1) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":5863 + * + * if classifier == 1: + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (y_x == y_data[deref(it)]) + */ + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":5864 + * if classifier == 1: + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * sdp += (1./(n_trees*in_data.size())) * (y_x == y_data[deref(it)]) + * inc(it) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":5865 + * it = in_data.begin() + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (y_x == y_data[deref(it)]) # <<<<<<<<<<<<<< + * inc(it) + * else: + */ + __pyx_t_10 = (*__pyx_v_it); + __pyx_v_sdp = (__pyx_v_sdp + ((1. / (__pyx_v_n_trees * __pyx_v_in_data.size())) * (__pyx_v_y_x == (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_10)) )))))); + + /* "cyext_acv.pyx":5866 + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (y_x == y_data[deref(it)]) + * inc(it) # <<<<<<<<<<<<<< + * else: + * it = in_data.begin() + */ + (void)((++__pyx_v_it)); + } + + /* "cyext_acv.pyx":5862 + * nodes_level = nodes_child + * + * if classifier == 1: # <<<<<<<<<<<<<< + * it = in_data.begin() + * while(it != in_data.end()): + */ + goto __pyx_L20; + } + + /* "cyext_acv.pyx":5868 + * inc(it) + * else: + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1]) + */ + /*else*/ { + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":5869 + * else: + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * sdp += (1./(n_trees*in_data.size())) * (t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1]) + * inc(it) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":5870 + * it = in_data.begin() + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1]) # <<<<<<<<<<<<<< + * inc(it) + * + */ + __pyx_t_10 = 0; + __pyx_t_11 = (*__pyx_v_it); + __pyx_t_15 = (*__pyx_v_it); + __pyx_t_12 = 1; + __pyx_v_sdp = (__pyx_v_sdp + (((1. / (__pyx_v_n_trees * __pyx_v_in_data.size())) * ((*((double *) ( /* dim=0 */ (__pyx_v_t.data + __pyx_t_10 * __pyx_v_t.strides[0]) ))) <= (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_11)) ))))) * ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_15)) ))) <= (*((double *) ( /* dim=0 */ (__pyx_v_t.data + __pyx_t_12 * __pyx_v_t.strides[0]) )))))); + + /* "cyext_acv.pyx":5871 + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1]) + * inc(it) # <<<<<<<<<<<<<< + * + * return sdp + */ + (void)((++__pyx_v_it)); + } + } + __pyx_L20:; + } + + /* "cyext_acv.pyx":5873 + * inc(it) + * + * return sdp # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_r = __pyx_v_sdp; + goto __pyx_L0; + + /* "cyext_acv.pyx":5803 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cdef double single_compute_sdp_rf(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, # <<<<<<<<<<<<<< + * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + * int & max_depth, int & min_node_size, int & classifier, double[:] & t) nogil: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("cyext_acv.single_compute_sdp_rf", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_r = 0; + __pyx_L0:; + return __pyx_r; +} + +/* "cyext_acv.pyx":5879 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_sdp_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * int max_depth, int min_node_size, int & classifier, double[:, :] & t): + */ + +static PyObject *__pyx_pw_9cyext_acv_91compute_sdp_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_sdp_rf(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, CYTHON_UNUSED int __pyx_skip_dispatch) { + int __pyx_v_N; + __Pyx_memviewslice __pyx_v_sdp = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_10; + __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_sdp_rf", 0); + + /* "cyext_acv.pyx":5883 + * int max_depth, int min_node_size, int & classifier, double[:, :] & t): + * + * cdef int N = X.shape[0] # <<<<<<<<<<<<<< + * cdef double[::1] sdp = np.zeros(N) + * cdef int i + */ + __pyx_v_N = (__pyx_v_X.shape[0]); + + /* "cyext_acv.pyx":5884 + * + * cdef int N = X.shape[0] + * cdef double[::1] sdp = np.zeros(N) # <<<<<<<<<<<<<< + * cdef int i + * for i in prange(N, nogil=True, schedule='dynamic'): + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5884, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5884, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5884, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5884, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 5884, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":5886 + * cdef double[::1] sdp = np.zeros(N) + * cdef int i + * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_sdp_rf(X[i], y_X[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + __pyx_t_6 = __pyx_v_N; + if ((1 == 0)) abort(); + { + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) (x) + #define unlikely(x) (x) + #endif + __pyx_t_8 = (__pyx_t_6 - 0 + 1 - 1/abs(1)) / 1; + if (__pyx_t_8 > 0) + { + #ifdef _OPENMP + #pragma omp parallel private(__pyx_t_10, __pyx_t_12) firstprivate(__pyx_t_11, __pyx_t_9) + #endif /* _OPENMP */ + { + #ifdef _OPENMP + #pragma omp for firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) schedule(dynamic) + #endif /* _OPENMP */ + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7++){ + { + __pyx_v_i = (int)(0 + 1 * __pyx_t_7); + + /* "cyext_acv.pyx":5887 + * cdef int i + * for i in prange(N, nogil=True, schedule='dynamic'): + * sdp[i] = single_compute_sdp_rf(X[i], y_X[i], data, y_data, S[i], # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i]) + */ + __pyx_t_9.data = __pyx_v_X.data; + __pyx_t_9.memview = __pyx_v_X.memview; + __PYX_INC_MEMVIEW(&__pyx_t_9, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_X.strides[0]; + __pyx_t_9.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_9.shape[0] = __pyx_v_X.shape[1]; +__pyx_t_9.strides[0] = __pyx_v_X.strides[1]; + __pyx_t_9.suboffsets[0] = -1; + +__pyx_t_10 = __pyx_v_i; + + /* "cyext_acv.pyx":5889 + * sdp[i] = single_compute_sdp_rf(X[i], y_X[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i]) # <<<<<<<<<<<<<< + * return np.array(sdp) + * + */ + __pyx_t_11.data = __pyx_v_t.data; + __pyx_t_11.memview = __pyx_v_t.memview; + __PYX_INC_MEMVIEW(&__pyx_t_11, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_t.strides[0]; + __pyx_t_11.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_11.shape[0] = __pyx_v_t.shape[1]; +__pyx_t_11.strides[0] = __pyx_v_t.strides[1]; + __pyx_t_11.suboffsets[0] = -1; + +__pyx_t_12 = __pyx_v_i; + + /* "cyext_acv.pyx":5887 + * cdef int i + * for i in prange(N, nogil=True, schedule='dynamic'): + * sdp[i] = single_compute_sdp_rf(X[i], y_X[i], data, y_data, S[i], # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i]) + */ + *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_sdp.data) + __pyx_t_12)) )) = __pyx_f_9cyext_acv_single_compute_sdp_rf(__pyx_t_9, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_10)) ))), __pyx_v_data, __pyx_v_y_data, (__pyx_v_S[__pyx_v_i]), __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_t_11); + __PYX_XDEC_MEMVIEW(&__pyx_t_9, 0); + __pyx_t_9.memview = NULL; + __pyx_t_9.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_11, 0); + __pyx_t_11.memview = NULL; + __pyx_t_11.data = NULL; + } + } + } + } + } + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #endif + } + + /* "cyext_acv.pyx":5886 + * cdef double[::1] sdp = np.zeros(N) + * cdef int i + * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_sdp_rf(X[i], y_X[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "cyext_acv.pyx":5890 + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i]) + * return np.array(sdp) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5890, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5890, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_sdp, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5890, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5890, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "cyext_acv.pyx":5879 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_sdp_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * int max_depth, int min_node_size, int & classifier, double[:, :] & t): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1); + __Pyx_AddTraceback("cyext_acv.compute_sdp_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_9cyext_acv_91compute_sdp_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_9cyext_acv_91compute_sdp_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + std::vector > __pyx_v_S; + __Pyx_memviewslice __pyx_v_features = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_thresholds = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_left = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_right = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_max_depth; + int __pyx_v_min_node_size; + int __pyx_v_classifier; + __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("compute_sdp_rf (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_y_X,&__pyx_n_s_data,&__pyx_n_s_y_data,&__pyx_n_s_S,&__pyx_n_s_features,&__pyx_n_s_thresholds,&__pyx_n_s_children_left,&__pyx_n_s_children_right,&__pyx_n_s_max_depth,&__pyx_n_s_min_node_size,&__pyx_n_s_classifier,&__pyx_n_s_t,0}; + PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_X)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_sdp_rf", 1, 13, 13, 1); __PYX_ERR(0, 5879, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_sdp_rf", 1, 13, 13, 2); __PYX_ERR(0, 5879, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_sdp_rf", 1, 13, 13, 3); __PYX_ERR(0, 5879, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_S)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_sdp_rf", 1, 13, 13, 4); __PYX_ERR(0, 5879, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_features)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_sdp_rf", 1, 13, 13, 5); __PYX_ERR(0, 5879, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thresholds)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_sdp_rf", 1, 13, 13, 6); __PYX_ERR(0, 5879, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_left)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_sdp_rf", 1, 13, 13, 7); __PYX_ERR(0, 5879, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_sdp_rf", 1, 13, 13, 8); __PYX_ERR(0, 5879, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_sdp_rf", 1, 13, 13, 9); __PYX_ERR(0, 5879, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_node_size)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_sdp_rf", 1, 13, 13, 10); __PYX_ERR(0, 5879, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classifier)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_sdp_rf", 1, 13, 13, 11); __PYX_ERR(0, 5879, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_sdp_rf", 1, 13, 13, 12); __PYX_ERR(0, 5879, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_sdp_rf") < 0)) __PYX_ERR(0, 5879, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 13) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + } + __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 5879, __pyx_L3_error) + __pyx_v_y_X = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_X.memview)) __PYX_ERR(0, 5879, __pyx_L3_error) + __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 5879, __pyx_L3_error) + __pyx_v_y_data = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_data.memview)) __PYX_ERR(0, 5879, __pyx_L3_error) + __pyx_v_S = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_int_3e___(values[4]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5879, __pyx_L3_error) + __pyx_v_features = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_features.memview)) __PYX_ERR(0, 5880, __pyx_L3_error) + __pyx_v_thresholds = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_thresholds.memview)) __PYX_ERR(0, 5880, __pyx_L3_error) + __pyx_v_children_left = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_left.memview)) __PYX_ERR(0, 5880, __pyx_L3_error) + __pyx_v_children_right = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_right.memview)) __PYX_ERR(0, 5880, __pyx_L3_error) + __pyx_v_max_depth = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5881, __pyx_L3_error) + __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5881, __pyx_L3_error) + __pyx_v_classifier = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5881, __pyx_L3_error) + __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[12], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 5881, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("compute_sdp_rf", 1, 13, 13, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5879, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cyext_acv.compute_sdp_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_9cyext_acv_90compute_sdp_rf(__pyx_self, __pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9cyext_acv_90compute_sdp_rf(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_sdp_rf", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundLocalError("X"); __PYX_ERR(0, 5879, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_X.memview)) { __Pyx_RaiseUnboundLocalError("y_X"); __PYX_ERR(0, 5879, __pyx_L1_error) } + if (unlikely(!__pyx_v_data.memview)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 5879, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_data.memview)) { __Pyx_RaiseUnboundLocalError("y_data"); __PYX_ERR(0, 5879, __pyx_L1_error) } + if (unlikely(!__pyx_v_features.memview)) { __Pyx_RaiseUnboundLocalError("features"); __PYX_ERR(0, 5879, __pyx_L1_error) } + if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 5879, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 5879, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 5879, __pyx_L1_error) } + if (unlikely(!__pyx_v_t.memview)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 5879, __pyx_L1_error) } + __pyx_t_1 = __pyx_f_9cyext_acv_compute_sdp_rf(__pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5879, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cyext_acv.compute_sdp_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_features, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_thresholds, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_left, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_right, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_t, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cyext_acv.pyx":5897 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cdef double single_compute_ddp_rf(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, # <<<<<<<<<<<<<< + * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + * int & max_depth, int & min_node_size, int & classifier, double[:] & t) nogil: + */ + +static double __pyx_f_9cyext_acv_single_compute_ddp_rf(__Pyx_memviewslice &__pyx_v_x, double &__pyx_v_y_x, __Pyx_memviewslice &__pyx_v_data, __Pyx_memviewslice &__pyx_v_y_data, std::vector &__pyx_v_S, __Pyx_memviewslice &__pyx_v_features, __Pyx_memviewslice &__pyx_v_thresholds, __Pyx_memviewslice &__pyx_v_children_left, __Pyx_memviewslice &__pyx_v_children_right, int &__pyx_v_max_depth, int &__pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t) { + unsigned int __pyx_v_n_trees; + unsigned int __pyx_v_N; + double __pyx_v_sdp; + int __pyx_v_b; + CYTHON_UNUSED int __pyx_v_level; + int __pyx_v_i; + int __pyx_v_it_node; + std::set __pyx_v_nodes_level; + std::set __pyx_v_nodes_child; + std::set __pyx_v_in_data; + std::set __pyx_v_in_data_b; + std::set ::iterator __pyx_v_it; + std::set ::iterator __pyx_v_it_point; + double __pyx_r; + unsigned int __pyx_t_1; + unsigned int __pyx_t_2; + int __pyx_t_3; + unsigned int __pyx_t_4; + unsigned int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "cyext_acv.pyx":5901 + * int & max_depth, int & min_node_size, int & classifier, double[:] & t) nogil: + * + * cdef unsigned int n_trees = features.shape[0] # <<<<<<<<<<<<<< + * cdef unsigned int N = data.shape[0] + * cdef double s, sdp + */ + __pyx_v_n_trees = (__pyx_v_features.shape[0]); + + /* "cyext_acv.pyx":5902 + * + * cdef unsigned int n_trees = features.shape[0] + * cdef unsigned int N = data.shape[0] # <<<<<<<<<<<<<< + * cdef double s, sdp + * cdef int o + */ + __pyx_v_N = (__pyx_v_data.shape[0]); + + /* "cyext_acv.pyx":5905 + * cdef double s, sdp + * cdef int o + * sdp = 0 # <<<<<<<<<<<<<< + * + * cdef int b, level, i, it_node + */ + __pyx_v_sdp = 0.0; + + /* "cyext_acv.pyx":5911 + * cdef set[int].iterator it, it_point + * + * for b in range(n_trees): # <<<<<<<<<<<<<< + * nodes_child.clear() + * nodes_level.clear() + */ + __pyx_t_1 = __pyx_v_n_trees; + __pyx_t_2 = __pyx_t_1; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_b = __pyx_t_3; + + /* "cyext_acv.pyx":5912 + * + * for b in range(n_trees): + * nodes_child.clear() # <<<<<<<<<<<<<< + * nodes_level.clear() + * nodes_level.insert(0) + */ + __pyx_v_nodes_child.clear(); + + /* "cyext_acv.pyx":5913 + * for b in range(n_trees): + * nodes_child.clear() + * nodes_level.clear() # <<<<<<<<<<<<<< + * nodes_level.insert(0) + * + */ + __pyx_v_nodes_level.clear(); + + /* "cyext_acv.pyx":5914 + * nodes_child.clear() + * nodes_level.clear() + * nodes_level.insert(0) # <<<<<<<<<<<<<< + * + * in_data.clear() + */ + try { + __pyx_v_nodes_level.insert(0); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 5914, __pyx_L1_error) + } + + /* "cyext_acv.pyx":5916 + * nodes_level.insert(0) + * + * in_data.clear() # <<<<<<<<<<<<<< + * in_data_b.clear() + * for i in range(N): + */ + __pyx_v_in_data.clear(); + + /* "cyext_acv.pyx":5917 + * + * in_data.clear() + * in_data_b.clear() # <<<<<<<<<<<<<< + * for i in range(N): + * in_data.insert(i) + */ + __pyx_v_in_data_b.clear(); + + /* "cyext_acv.pyx":5918 + * in_data.clear() + * in_data_b.clear() + * for i in range(N): # <<<<<<<<<<<<<< + * in_data.insert(i) + * in_data_b.insert(i) + */ + __pyx_t_4 = __pyx_v_N; + __pyx_t_5 = __pyx_t_4; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "cyext_acv.pyx":5919 + * in_data_b.clear() + * for i in range(N): + * in_data.insert(i) # <<<<<<<<<<<<<< + * in_data_b.insert(i) + * + */ + try { + __pyx_v_in_data.insert(__pyx_v_i); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 5919, __pyx_L1_error) + } + + /* "cyext_acv.pyx":5920 + * for i in range(N): + * in_data.insert(i) + * in_data_b.insert(i) # <<<<<<<<<<<<<< + * + * for level in range(max_depth): + */ + try { + __pyx_v_in_data_b.insert(__pyx_v_i); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 5920, __pyx_L1_error) + } + } + + /* "cyext_acv.pyx":5922 + * in_data_b.insert(i) + * + * for level in range(max_depth): # <<<<<<<<<<<<<< + * it_point = nodes_level.begin() + * while(it_point != nodes_level.end()): + */ + __pyx_t_6 = __pyx_v_max_depth; + __pyx_t_7 = __pyx_t_6; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_level = __pyx_t_8; + + /* "cyext_acv.pyx":5923 + * + * for level in range(max_depth): + * it_point = nodes_level.begin() # <<<<<<<<<<<<<< + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) + */ + __pyx_v_it_point = __pyx_v_nodes_level.begin(); + + /* "cyext_acv.pyx":5924 + * for level in range(max_depth): + * it_point = nodes_level.begin() + * while(it_point != nodes_level.end()): # <<<<<<<<<<<<<< + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it_point != __pyx_v_nodes_level.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":5925 + * it_point = nodes_level.begin() + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) # <<<<<<<<<<<<<< + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * if x[features[b, it_node]] <= thresholds[b, it_node]: + */ + __pyx_v_it_node = (*__pyx_v_it_point); + + /* "cyext_acv.pyx":5926 + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): # <<<<<<<<<<<<<< + * if x[features[b, it_node]] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) + */ + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_9 = ((std::find ::iterator,int>(__pyx_v_S.begin(), __pyx_v_S.end(), (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_10 * __pyx_v_features.strides[0]) ) + __pyx_t_11 * __pyx_v_features.strides[1]) )))) != __pyx_v_S.end()) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":5927 + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * if x[features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * + */ + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_12 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_11 * __pyx_v_features.strides[0]) ) + __pyx_t_10 * __pyx_v_features.strides[1]) ))); + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_12 * __pyx_v_x.strides[0]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_13 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_14 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":5928 + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * if x[features[b, it_node]] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) # <<<<<<<<<<<<<< + * + * it = in_data.begin() + */ + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_left.data + __pyx_t_14 * __pyx_v_children_left.strides[0]) ) + __pyx_t_13 * __pyx_v_children_left.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 5928, __pyx_L1_error) + } + + /* "cyext_acv.pyx":5930 + * nodes_child.insert(children_left[b, it_node]) + * + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + */ + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":5931 + * + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":5932 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + __pyx_t_10 = (*__pyx_v_it); + __pyx_t_11 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_13 * __pyx_v_features.strides[0]) ) + __pyx_t_14 * __pyx_v_features.strides[1]) ))); + __pyx_t_12 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_data.data + __pyx_t_10 * __pyx_v_data.strides[0]) ) + __pyx_t_11 * __pyx_v_data.strides[1]) ))) > (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_12 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_15 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":5933 + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) # <<<<<<<<<<<<<< + * inc(it) + * in_data = in_data_b + */ + (void)(__pyx_v_in_data_b.erase((*__pyx_v_it))); + + /* "cyext_acv.pyx":5932 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + } + + /* "cyext_acv.pyx":5934 + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + * inc(it) # <<<<<<<<<<<<<< + * in_data = in_data_b + * + */ + (void)((++__pyx_v_it)); + } + + /* "cyext_acv.pyx":5935 + * in_data_b.erase(deref(it)) + * inc(it) + * in_data = in_data_b # <<<<<<<<<<<<<< + * + * else: + */ + __pyx_v_in_data = __pyx_v_in_data_b; + + /* "cyext_acv.pyx":5927 + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * if x[features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * + */ + goto __pyx_L12; + } + + /* "cyext_acv.pyx":5938 + * + * else: + * nodes_child.insert(children_right[b, it_node]) # <<<<<<<<<<<<<< + * + * it = in_data.begin() + */ + /*else*/ { + __pyx_t_15 = __pyx_v_b; + __pyx_t_12 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_right.data + __pyx_t_15 * __pyx_v_children_right.strides[0]) ) + __pyx_t_12 * __pyx_v_children_right.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 5938, __pyx_L1_error) + } + + /* "cyext_acv.pyx":5940 + * nodes_child.insert(children_right[b, it_node]) + * + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + */ + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":5941 + * + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":5942 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + __pyx_t_12 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_14 = (*__pyx_v_it); + __pyx_t_13 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_12 * __pyx_v_features.strides[0]) ) + __pyx_t_15 * __pyx_v_features.strides[1]) ))); + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_data.data + __pyx_t_14 * __pyx_v_data.strides[0]) ) + __pyx_t_13 * __pyx_v_data.strides[1]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_11 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_10 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":5943 + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) # <<<<<<<<<<<<<< + * inc(it) + * in_data = in_data_b + */ + (void)(__pyx_v_in_data_b.erase((*__pyx_v_it))); + + /* "cyext_acv.pyx":5942 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + } + + /* "cyext_acv.pyx":5944 + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + * inc(it) # <<<<<<<<<<<<<< + * in_data = in_data_b + * else: + */ + (void)((++__pyx_v_it)); + } + + /* "cyext_acv.pyx":5945 + * in_data_b.erase(deref(it)) + * inc(it) + * in_data = in_data_b # <<<<<<<<<<<<<< + * else: + * nodes_child.insert(children_left[b, it_node]) + */ + __pyx_v_in_data = __pyx_v_in_data_b; + } + __pyx_L12:; + + /* "cyext_acv.pyx":5926 + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): # <<<<<<<<<<<<<< + * if x[features[b, it_node]] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) + */ + goto __pyx_L11; + } + + /* "cyext_acv.pyx":5947 + * in_data = in_data_b + * else: + * nodes_child.insert(children_left[b, it_node]) # <<<<<<<<<<<<<< + * nodes_child.insert(children_right[b, it_node]) + * + */ + /*else*/ { + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_left.data + __pyx_t_10 * __pyx_v_children_left.strides[0]) ) + __pyx_t_11 * __pyx_v_children_left.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 5947, __pyx_L1_error) + } + + /* "cyext_acv.pyx":5948 + * else: + * nodes_child.insert(children_left[b, it_node]) + * nodes_child.insert(children_right[b, it_node]) # <<<<<<<<<<<<<< + * + * if in_data.size() < min_node_size: + */ + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_right.data + __pyx_t_11 * __pyx_v_children_right.strides[0]) ) + __pyx_t_10 * __pyx_v_children_right.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 5948, __pyx_L1_error) + } + } + __pyx_L11:; + + /* "cyext_acv.pyx":5950 + * nodes_child.insert(children_right[b, it_node]) + * + * if in_data.size() < min_node_size: # <<<<<<<<<<<<<< + * break + * inc(it_point) + */ + __pyx_t_9 = ((__pyx_v_in_data.size() < __pyx_v_min_node_size) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":5951 + * + * if in_data.size() < min_node_size: + * break # <<<<<<<<<<<<<< + * inc(it_point) + * + */ + goto __pyx_L10_break; + + /* "cyext_acv.pyx":5950 + * nodes_child.insert(children_right[b, it_node]) + * + * if in_data.size() < min_node_size: # <<<<<<<<<<<<<< + * break + * inc(it_point) + */ + } + + /* "cyext_acv.pyx":5952 + * if in_data.size() < min_node_size: + * break + * inc(it_point) # <<<<<<<<<<<<<< + * + * nodes_level = nodes_child + */ + (void)((++__pyx_v_it_point)); + } + __pyx_L10_break:; + + /* "cyext_acv.pyx":5954 + * inc(it_point) + * + * nodes_level = nodes_child # <<<<<<<<<<<<<< + * + * if classifier == 1: + */ + __pyx_v_nodes_level = __pyx_v_nodes_child; + } + + /* "cyext_acv.pyx":5956 + * nodes_level = nodes_child + * + * if classifier == 1: # <<<<<<<<<<<<<< + * it = in_data.begin() + * while(it != in_data.end()): + */ + __pyx_t_9 = ((__pyx_v_classifier == 1) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":5957 + * + * if classifier == 1: + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) + */ + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":5958 + * if classifier == 1: + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) + * inc(it) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":5959 + * it = in_data.begin() + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) # <<<<<<<<<<<<<< + * inc(it) + * else: + */ + __pyx_t_10 = (*__pyx_v_it); + __pyx_v_sdp = (__pyx_v_sdp + ((1. / (__pyx_v_n_trees * __pyx_v_in_data.size())) * (__pyx_v_y_x != (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_10)) )))))); + + /* "cyext_acv.pyx":5960 + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) + * inc(it) # <<<<<<<<<<<<<< + * else: + * it = in_data.begin() + */ + (void)((++__pyx_v_it)); + } + + /* "cyext_acv.pyx":5956 + * nodes_level = nodes_child + * + * if classifier == 1: # <<<<<<<<<<<<<< + * it = in_data.begin() + * while(it != in_data.end()): + */ + goto __pyx_L20; + } + + /* "cyext_acv.pyx":5962 + * inc(it) + * else: + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (1-(t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) + */ + /*else*/ { + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":5963 + * else: + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * sdp += (1./(n_trees*in_data.size())) * (1-(t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) + * inc(it) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":5964 + * it = in_data.begin() + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (1-(t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) # <<<<<<<<<<<<<< + * inc(it) + * + */ + __pyx_t_10 = 0; + __pyx_t_11 = (*__pyx_v_it); + __pyx_t_15 = (*__pyx_v_it); + __pyx_t_12 = 1; + __pyx_v_sdp = (__pyx_v_sdp + ((1. / (__pyx_v_n_trees * __pyx_v_in_data.size())) * (1 - (((*((double *) ( /* dim=0 */ (__pyx_v_t.data + __pyx_t_10 * __pyx_v_t.strides[0]) ))) <= (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_11)) )))) * ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_15)) ))) <= (*((double *) ( /* dim=0 */ (__pyx_v_t.data + __pyx_t_12 * __pyx_v_t.strides[0]) )))))))); + + /* "cyext_acv.pyx":5965 + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (1-(t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) + * inc(it) # <<<<<<<<<<<<<< + * + * return sdp + */ + (void)((++__pyx_v_it)); + } + } + __pyx_L20:; + } + + /* "cyext_acv.pyx":5967 + * inc(it) + * + * return sdp # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_r = __pyx_v_sdp; + goto __pyx_L0; + + /* "cyext_acv.pyx":5897 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cdef double single_compute_ddp_rf(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, # <<<<<<<<<<<<<< + * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + * int & max_depth, int & min_node_size, int & classifier, double[:] & t) nogil: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("cyext_acv.single_compute_ddp_rf", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_r = 0; + __pyx_L0:; + return __pyx_r; +} + +/* "cyext_acv.pyx":5973 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_ddp_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * int max_depth, int min_node_size, int & classifier, double[:, :] & t): + */ + +static PyObject *__pyx_pw_9cyext_acv_93compute_ddp_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_ddp_rf(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, CYTHON_UNUSED int __pyx_skip_dispatch) { + int __pyx_v_N; + __Pyx_memviewslice __pyx_v_sdp = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_10; + __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_ddp_rf", 0); + + /* "cyext_acv.pyx":5977 + * int max_depth, int min_node_size, int & classifier, double[:, :] & t): + * + * cdef int N = X.shape[0] # <<<<<<<<<<<<<< + * cdef double[::1] sdp = np.zeros(N) + * cdef int i + */ + __pyx_v_N = (__pyx_v_X.shape[0]); + + /* "cyext_acv.pyx":5978 + * + * cdef int N = X.shape[0] + * cdef double[::1] sdp = np.zeros(N) # <<<<<<<<<<<<<< + * cdef int i + * for i in prange(N, nogil=True, schedule='dynamic'): + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5978, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5978, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5978, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5978, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 5978, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":5980 + * cdef double[::1] sdp = np.zeros(N) + * cdef int i + * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_ddp_rf(X[i], y_X[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + __pyx_t_6 = __pyx_v_N; + if ((1 == 0)) abort(); + { + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) (x) + #define unlikely(x) (x) + #endif + __pyx_t_8 = (__pyx_t_6 - 0 + 1 - 1/abs(1)) / 1; + if (__pyx_t_8 > 0) + { + #ifdef _OPENMP + #pragma omp parallel private(__pyx_t_10, __pyx_t_12) firstprivate(__pyx_t_11, __pyx_t_9) + #endif /* _OPENMP */ + { + #ifdef _OPENMP + #pragma omp for firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) schedule(dynamic) + #endif /* _OPENMP */ + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7++){ + { + __pyx_v_i = (int)(0 + 1 * __pyx_t_7); + + /* "cyext_acv.pyx":5981 + * cdef int i + * for i in prange(N, nogil=True, schedule='dynamic'): + * sdp[i] = single_compute_ddp_rf(X[i], y_X[i], data, y_data, S[i], # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i]) + */ + __pyx_t_9.data = __pyx_v_X.data; + __pyx_t_9.memview = __pyx_v_X.memview; + __PYX_INC_MEMVIEW(&__pyx_t_9, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_X.strides[0]; + __pyx_t_9.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_9.shape[0] = __pyx_v_X.shape[1]; +__pyx_t_9.strides[0] = __pyx_v_X.strides[1]; + __pyx_t_9.suboffsets[0] = -1; + +__pyx_t_10 = __pyx_v_i; + + /* "cyext_acv.pyx":5983 + * sdp[i] = single_compute_ddp_rf(X[i], y_X[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i]) # <<<<<<<<<<<<<< + * return np.array(sdp) + * + */ + __pyx_t_11.data = __pyx_v_t.data; + __pyx_t_11.memview = __pyx_v_t.memview; + __PYX_INC_MEMVIEW(&__pyx_t_11, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_t.strides[0]; + __pyx_t_11.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_11.shape[0] = __pyx_v_t.shape[1]; +__pyx_t_11.strides[0] = __pyx_v_t.strides[1]; + __pyx_t_11.suboffsets[0] = -1; + +__pyx_t_12 = __pyx_v_i; + + /* "cyext_acv.pyx":5981 + * cdef int i + * for i in prange(N, nogil=True, schedule='dynamic'): + * sdp[i] = single_compute_ddp_rf(X[i], y_X[i], data, y_data, S[i], # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i]) + */ + *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_sdp.data) + __pyx_t_12)) )) = __pyx_f_9cyext_acv_single_compute_ddp_rf(__pyx_t_9, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_10)) ))), __pyx_v_data, __pyx_v_y_data, (__pyx_v_S[__pyx_v_i]), __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_t_11); + __PYX_XDEC_MEMVIEW(&__pyx_t_9, 0); + __pyx_t_9.memview = NULL; + __pyx_t_9.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_11, 0); + __pyx_t_11.memview = NULL; + __pyx_t_11.data = NULL; + } + } + } + } + } + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #endif + } + + /* "cyext_acv.pyx":5980 + * cdef double[::1] sdp = np.zeros(N) + * cdef int i + * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_ddp_rf(X[i], y_X[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "cyext_acv.pyx":5984 + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i]) + * return np.array(sdp) # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5984, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5984, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_sdp, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5984, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5984, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "cyext_acv.pyx":5973 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_ddp_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * int max_depth, int min_node_size, int & classifier, double[:, :] & t): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1); + __Pyx_AddTraceback("cyext_acv.compute_ddp_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_9cyext_acv_93compute_ddp_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_9cyext_acv_93compute_ddp_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + std::vector > __pyx_v_S; + __Pyx_memviewslice __pyx_v_features = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_thresholds = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_left = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_right = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_max_depth; + int __pyx_v_min_node_size; + int __pyx_v_classifier; + __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("compute_ddp_rf (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_y_X,&__pyx_n_s_data,&__pyx_n_s_y_data,&__pyx_n_s_S,&__pyx_n_s_features,&__pyx_n_s_thresholds,&__pyx_n_s_children_left,&__pyx_n_s_children_right,&__pyx_n_s_max_depth,&__pyx_n_s_min_node_size,&__pyx_n_s_classifier,&__pyx_n_s_t,0}; + PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_X)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_rf", 1, 13, 13, 1); __PYX_ERR(0, 5973, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_rf", 1, 13, 13, 2); __PYX_ERR(0, 5973, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_rf", 1, 13, 13, 3); __PYX_ERR(0, 5973, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_S)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_rf", 1, 13, 13, 4); __PYX_ERR(0, 5973, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_features)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_rf", 1, 13, 13, 5); __PYX_ERR(0, 5973, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thresholds)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_rf", 1, 13, 13, 6); __PYX_ERR(0, 5973, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_left)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_rf", 1, 13, 13, 7); __PYX_ERR(0, 5973, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_rf", 1, 13, 13, 8); __PYX_ERR(0, 5973, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_rf", 1, 13, 13, 9); __PYX_ERR(0, 5973, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_node_size)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_rf", 1, 13, 13, 10); __PYX_ERR(0, 5973, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classifier)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_rf", 1, 13, 13, 11); __PYX_ERR(0, 5973, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_rf", 1, 13, 13, 12); __PYX_ERR(0, 5973, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_ddp_rf") < 0)) __PYX_ERR(0, 5973, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 13) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + } + __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 5973, __pyx_L3_error) + __pyx_v_y_X = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_X.memview)) __PYX_ERR(0, 5973, __pyx_L3_error) + __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 5973, __pyx_L3_error) + __pyx_v_y_data = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_data.memview)) __PYX_ERR(0, 5973, __pyx_L3_error) + __pyx_v_S = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_int_3e___(values[4]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5973, __pyx_L3_error) + __pyx_v_features = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_features.memview)) __PYX_ERR(0, 5974, __pyx_L3_error) + __pyx_v_thresholds = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_thresholds.memview)) __PYX_ERR(0, 5974, __pyx_L3_error) + __pyx_v_children_left = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_left.memview)) __PYX_ERR(0, 5974, __pyx_L3_error) + __pyx_v_children_right = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_right.memview)) __PYX_ERR(0, 5974, __pyx_L3_error) + __pyx_v_max_depth = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5975, __pyx_L3_error) + __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5975, __pyx_L3_error) + __pyx_v_classifier = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5975, __pyx_L3_error) + __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[12], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 5975, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("compute_ddp_rf", 1, 13, 13, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5973, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cyext_acv.compute_ddp_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_9cyext_acv_92compute_ddp_rf(__pyx_self, __pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9cyext_acv_92compute_ddp_rf(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_ddp_rf", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundLocalError("X"); __PYX_ERR(0, 5973, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_X.memview)) { __Pyx_RaiseUnboundLocalError("y_X"); __PYX_ERR(0, 5973, __pyx_L1_error) } + if (unlikely(!__pyx_v_data.memview)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 5973, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_data.memview)) { __Pyx_RaiseUnboundLocalError("y_data"); __PYX_ERR(0, 5973, __pyx_L1_error) } + if (unlikely(!__pyx_v_features.memview)) { __Pyx_RaiseUnboundLocalError("features"); __PYX_ERR(0, 5973, __pyx_L1_error) } + if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 5973, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 5973, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 5973, __pyx_L1_error) } + if (unlikely(!__pyx_v_t.memview)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 5973, __pyx_L1_error) } + __pyx_t_1 = __pyx_f_9cyext_acv_compute_ddp_rf(__pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5973, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cyext_acv.compute_ddp_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_features, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_thresholds, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_left, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_right, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_t, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cyext_acv.pyx":5990 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_ddp_rf_same_set(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[int] S, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * int max_depth, int min_node_size, int & classifier, double[:, :] & t): + */ + +static PyObject *__pyx_pw_9cyext_acv_95compute_ddp_rf_same_set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_ddp_rf_same_set(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, CYTHON_UNUSED int __pyx_skip_dispatch) { + int __pyx_v_N; + __Pyx_memviewslice __pyx_v_sdp = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_10; + __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_ddp_rf_same_set", 0); + + /* "cyext_acv.pyx":5994 + * int max_depth, int min_node_size, int & classifier, double[:, :] & t): + * + * cdef int N = X.shape[0] # <<<<<<<<<<<<<< + * cdef double[::1] sdp = np.zeros(N) + * cdef int i + */ + __pyx_v_N = (__pyx_v_X.shape[0]); + + /* "cyext_acv.pyx":5995 + * + * cdef int N = X.shape[0] + * cdef double[::1] sdp = np.zeros(N) # <<<<<<<<<<<<<< + * cdef int i + * for i in prange(N, nogil=True, schedule='dynamic'): + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 5995, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":5997 + * cdef double[::1] sdp = np.zeros(N) + * cdef int i + * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_ddp_rf(X[i], y_X[i], data, y_data, S, + * features, thresholds, children_left, children_right, + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + __pyx_t_6 = __pyx_v_N; + if ((1 == 0)) abort(); + { + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) (x) + #define unlikely(x) (x) + #endif + __pyx_t_8 = (__pyx_t_6 - 0 + 1 - 1/abs(1)) / 1; + if (__pyx_t_8 > 0) + { + #ifdef _OPENMP + #pragma omp parallel private(__pyx_t_10, __pyx_t_12) firstprivate(__pyx_t_11, __pyx_t_9) + #endif /* _OPENMP */ + { + #ifdef _OPENMP + #pragma omp for firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) schedule(dynamic) + #endif /* _OPENMP */ + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7++){ + { + __pyx_v_i = (int)(0 + 1 * __pyx_t_7); + + /* "cyext_acv.pyx":5998 + * cdef int i + * for i in prange(N, nogil=True, schedule='dynamic'): + * sdp[i] = single_compute_ddp_rf(X[i], y_X[i], data, y_data, S, # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i]) + */ + __pyx_t_9.data = __pyx_v_X.data; + __pyx_t_9.memview = __pyx_v_X.memview; + __PYX_INC_MEMVIEW(&__pyx_t_9, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_X.strides[0]; + __pyx_t_9.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_9.shape[0] = __pyx_v_X.shape[1]; +__pyx_t_9.strides[0] = __pyx_v_X.strides[1]; + __pyx_t_9.suboffsets[0] = -1; + +__pyx_t_10 = __pyx_v_i; + + /* "cyext_acv.pyx":6000 + * sdp[i] = single_compute_ddp_rf(X[i], y_X[i], data, y_data, S, + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i]) # <<<<<<<<<<<<<< + * return np.array(sdp) + * + */ + __pyx_t_11.data = __pyx_v_t.data; + __pyx_t_11.memview = __pyx_v_t.memview; + __PYX_INC_MEMVIEW(&__pyx_t_11, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_t.strides[0]; + __pyx_t_11.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_11.shape[0] = __pyx_v_t.shape[1]; +__pyx_t_11.strides[0] = __pyx_v_t.strides[1]; + __pyx_t_11.suboffsets[0] = -1; + +__pyx_t_12 = __pyx_v_i; + + /* "cyext_acv.pyx":5998 + * cdef int i + * for i in prange(N, nogil=True, schedule='dynamic'): + * sdp[i] = single_compute_ddp_rf(X[i], y_X[i], data, y_data, S, # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i]) + */ + *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_sdp.data) + __pyx_t_12)) )) = __pyx_f_9cyext_acv_single_compute_ddp_rf(__pyx_t_9, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_10)) ))), __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_t_11); + __PYX_XDEC_MEMVIEW(&__pyx_t_9, 0); + __pyx_t_9.memview = NULL; + __pyx_t_9.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_11, 0); + __pyx_t_11.memview = NULL; + __pyx_t_11.data = NULL; + } + } + } + } + } + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #endif + } + + /* "cyext_acv.pyx":5997 + * cdef double[::1] sdp = np.zeros(N) + * cdef int i + * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_ddp_rf(X[i], y_X[i], data, y_data, S, + * features, thresholds, children_left, children_right, + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "cyext_acv.pyx":6001 + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i]) + * return np.array(sdp) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_sdp, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "cyext_acv.pyx":5990 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_ddp_rf_same_set(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[int] S, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * int max_depth, int min_node_size, int & classifier, double[:, :] & t): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1); + __Pyx_AddTraceback("cyext_acv.compute_ddp_rf_same_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_9cyext_acv_95compute_ddp_rf_same_set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_9cyext_acv_95compute_ddp_rf_same_set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + std::vector __pyx_v_S; + __Pyx_memviewslice __pyx_v_features = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_thresholds = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_left = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_right = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_max_depth; + int __pyx_v_min_node_size; + int __pyx_v_classifier; + __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("compute_ddp_rf_same_set (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_y_X,&__pyx_n_s_data,&__pyx_n_s_y_data,&__pyx_n_s_S,&__pyx_n_s_features,&__pyx_n_s_thresholds,&__pyx_n_s_children_left,&__pyx_n_s_children_right,&__pyx_n_s_max_depth,&__pyx_n_s_min_node_size,&__pyx_n_s_classifier,&__pyx_n_s_t,0}; + PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_X)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_rf_same_set", 1, 13, 13, 1); __PYX_ERR(0, 5990, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_rf_same_set", 1, 13, 13, 2); __PYX_ERR(0, 5990, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_rf_same_set", 1, 13, 13, 3); __PYX_ERR(0, 5990, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_S)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_rf_same_set", 1, 13, 13, 4); __PYX_ERR(0, 5990, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_features)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_rf_same_set", 1, 13, 13, 5); __PYX_ERR(0, 5990, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thresholds)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_rf_same_set", 1, 13, 13, 6); __PYX_ERR(0, 5990, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_left)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_rf_same_set", 1, 13, 13, 7); __PYX_ERR(0, 5990, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_rf_same_set", 1, 13, 13, 8); __PYX_ERR(0, 5990, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_rf_same_set", 1, 13, 13, 9); __PYX_ERR(0, 5990, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_node_size)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_rf_same_set", 1, 13, 13, 10); __PYX_ERR(0, 5990, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classifier)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_rf_same_set", 1, 13, 13, 11); __PYX_ERR(0, 5990, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_rf_same_set", 1, 13, 13, 12); __PYX_ERR(0, 5990, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_ddp_rf_same_set") < 0)) __PYX_ERR(0, 5990, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 13) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + } + __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 5990, __pyx_L3_error) + __pyx_v_y_X = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_X.memview)) __PYX_ERR(0, 5990, __pyx_L3_error) + __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 5990, __pyx_L3_error) + __pyx_v_y_data = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_data.memview)) __PYX_ERR(0, 5990, __pyx_L3_error) + __pyx_v_S = __pyx_convert_vector_from_py_int(values[4]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5990, __pyx_L3_error) + __pyx_v_features = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_features.memview)) __PYX_ERR(0, 5991, __pyx_L3_error) + __pyx_v_thresholds = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_thresholds.memview)) __PYX_ERR(0, 5991, __pyx_L3_error) + __pyx_v_children_left = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_left.memview)) __PYX_ERR(0, 5991, __pyx_L3_error) + __pyx_v_children_right = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_right.memview)) __PYX_ERR(0, 5991, __pyx_L3_error) + __pyx_v_max_depth = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5992, __pyx_L3_error) + __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5992, __pyx_L3_error) + __pyx_v_classifier = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5992, __pyx_L3_error) + __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[12], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 5992, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("compute_ddp_rf_same_set", 1, 13, 13, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5990, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cyext_acv.compute_ddp_rf_same_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_9cyext_acv_94compute_ddp_rf_same_set(__pyx_self, __pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9cyext_acv_94compute_ddp_rf_same_set(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_ddp_rf_same_set", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundLocalError("X"); __PYX_ERR(0, 5990, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_X.memview)) { __Pyx_RaiseUnboundLocalError("y_X"); __PYX_ERR(0, 5990, __pyx_L1_error) } + if (unlikely(!__pyx_v_data.memview)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 5990, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_data.memview)) { __Pyx_RaiseUnboundLocalError("y_data"); __PYX_ERR(0, 5990, __pyx_L1_error) } + if (unlikely(!__pyx_v_features.memview)) { __Pyx_RaiseUnboundLocalError("features"); __PYX_ERR(0, 5990, __pyx_L1_error) } + if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 5990, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 5990, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 5990, __pyx_L1_error) } + if (unlikely(!__pyx_v_t.memview)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 5990, __pyx_L1_error) } + __pyx_t_1 = __pyx_f_9cyext_acv_compute_ddp_rf_same_set(__pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5990, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cyext_acv.compute_ddp_rf_same_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_features, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_thresholds, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_left, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_right, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_t, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cyext_acv.pyx":6008 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef global_ddp_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * int max_depth, int min_node_size, int & classifier, double[:, :] & t, list C, double pi_level, + */ + +static PyObject *__pyx_pw_9cyext_acv_97global_ddp_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_global_ddp_rf(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, PyObject *__pyx_v_C, double __pyx_v_pi_level, int __pyx_v_minimal, int __pyx_v_stop, PyObject *__pyx_v_search_space, CYTHON_UNUSED int __pyx_skip_dispatch) { + unsigned int __pyx_v_N; + unsigned int __pyx_v_m; + __Pyx_memviewslice __pyx_v_sdp = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_sdp_b = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_sdp_ba = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_sdp_global = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_in_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_i; + int __pyx_v_s; + int __pyx_v_s_0; + int __pyx_v_s_1; + int __pyx_v_S_size; + int __pyx_v_max_size; + int __pyx_v_size; + std::vector __pyx_v_S; + std::vector __pyx_v_len_s_star; + PyObject *__pyx_v_power = 0; + PyObject *__pyx_v_va_id = 0; + std::vector __pyx_v_R; + std::vector __pyx_v_r; + __Pyx_memviewslice __pyx_v_R_buf = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_X_arr = NULL; + PyObject *__pyx_v_y_X_arr = NULL; + PyObject *__pyx_v_t_arr = NULL; + PyObject *__pyx_v_remove_va = NULL; + Py_ssize_t __pyx_v_ci; + Py_ssize_t __pyx_v_cj; + PyObject *__pyx_v_power_b = NULL; + PyObject *__pyx_v_co = NULL; + std::vector > > __pyx_v_power_cpp; + __Pyx_memviewslice __pyx_v_s_star = { 0, 0, { 0 }, { 0 }, { 0 } }; + CYTHON_UNUSED long __pyx_v_power_set_size; + PyObject *__pyx_v_S_bar = NULL; + PyObject *__pyx_v_S_bar_set = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_t_6 = NULL; + std::vector __pyx_t_7; + unsigned int __pyx_t_8; + unsigned int __pyx_t_9; + int __pyx_t_10; + __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_t_19; + long __pyx_t_20; + long __pyx_t_21; + int __pyx_t_22; + PyObject *(*__pyx_t_23)(PyObject *); + PyObject *__pyx_t_24 = NULL; + int __pyx_t_25; + std::vector > > __pyx_t_26; + __Pyx_memviewslice __pyx_t_27 = { 0, 0, { 0 }, { 0 }, { 0 } }; + std::vector > ::size_type __pyx_t_28; + std::vector > ::size_type __pyx_t_29; + std::vector ::size_type __pyx_t_30; + std::vector ::size_type __pyx_t_31; + int __pyx_t_32; + int __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + __Pyx_memviewslice __pyx_t_36 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_37 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_38 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + int __pyx_t_41; + PyObject *__pyx_t_42 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("global_ddp_rf", 0); + + /* "cyext_acv.pyx":6013 + * int minimal, bint stop, list search_space): + * + * cdef unsigned int N = X.shape[0] # <<<<<<<<<<<<<< + * cdef unsigned int m = X.shape[1] + * + */ + __pyx_v_N = (__pyx_v_X.shape[0]); + + /* "cyext_acv.pyx":6014 + * + * cdef unsigned int N = X.shape[0] + * cdef unsigned int m = X.shape[1] # <<<<<<<<<<<<<< + * + * cdef double[:] sdp, sdp_b, sdp_ba + */ + __pyx_v_m = (__pyx_v_X.shape[1]); + + /* "cyext_acv.pyx":6019 + * cdef double[:] sdp_global + * cdef double[:] in_data + * sdp = np.zeros((N)) # <<<<<<<<<<<<<< + * sdp_b = np.zeros((N)) + * sdp_global = np.zeros((m)) + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6019, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6019, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6019, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6019, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 6019, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":6020 + * cdef double[:] in_data + * sdp = np.zeros((N)) + * sdp_b = np.zeros((N)) # <<<<<<<<<<<<<< + * sdp_global = np.zeros((m)) + * in_data = np.zeros(N) + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6020, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6020, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6020, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6020, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 6020, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp_b = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":6021 + * sdp = np.zeros((N)) + * sdp_b = np.zeros((N)) + * sdp_global = np.zeros((m)) # <<<<<<<<<<<<<< + * in_data = np.zeros(N) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6021, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6021, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_m); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6021, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6021, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 6021, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp_global = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":6022 + * sdp_b = np.zeros((N)) + * sdp_global = np.zeros((m)) + * in_data = np.zeros(N) # <<<<<<<<<<<<<< + * + * cdef unsigned int it, it_s, a_it, b_it, o_all, p, p_s, nb_leaf, p_u, p_d, p_su, p_sd, down, up + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6022, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6022, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6022, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6022, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 6022, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_in_data = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":6029 + * + * cdef vector[int] S, len_s_star + * len_s_star = np.zeros((N), dtype=np.int) # <<<<<<<<<<<<<< + * + * cdef list power, va_id + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6029, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6029, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6029, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6029, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6029, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6029, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6029, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 6029, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6029, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = __pyx_convert_vector_from_py_int(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6029, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_len_s_star = __pyx_t_7; + + /* "cyext_acv.pyx":6034 + * + * cdef vector[long] R, r + * R.resize(N) # <<<<<<<<<<<<<< + * for i in range(N): + * R[i] = i + */ + try { + __pyx_v_R.resize(__pyx_v_N); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 6034, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6035 + * cdef vector[long] R, r + * R.resize(N) + * for i in range(N): # <<<<<<<<<<<<<< + * R[i] = i + * r.resize(N) + */ + __pyx_t_8 = __pyx_v_N; + __pyx_t_9 = __pyx_t_8; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "cyext_acv.pyx":6036 + * R.resize(N) + * for i in range(N): + * R[i] = i # <<<<<<<<<<<<<< + * r.resize(N) + * + */ + (__pyx_v_R[__pyx_v_i]) = __pyx_v_i; + } + + /* "cyext_acv.pyx":6037 + * for i in range(N): + * R[i] = i + * r.resize(N) # <<<<<<<<<<<<<< + * + * cdef long[:] R_buf + */ + try { + __pyx_v_r.resize(__pyx_v_N); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 6037, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6040 + * + * cdef long[:] R_buf + * R_buf = np.zeros((N), dtype=np.int) # <<<<<<<<<<<<<< + * + * X_arr = np.array(X, dtype=np.double) + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6040, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6040, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6040, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6040, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6040, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6040, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6040, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 6040, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6040, __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(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_long(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 6040, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_R_buf = __pyx_t_11; + __pyx_t_11.memview = NULL; + __pyx_t_11.data = NULL; + + /* "cyext_acv.pyx":6042 + * R_buf = np.zeros((N), dtype=np.int) + * + * X_arr = np.array(X, dtype=np.double) # <<<<<<<<<<<<<< + * y_X_arr = np.array(y_X, dtype=np.double) + * t_arr = np.array(t, dtype=np.double) + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6042, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6042, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_X, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6042, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6042, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6042, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6042, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_double); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6042, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 6042, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6042, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_X_arr = __pyx_t_2; + __pyx_t_2 = 0; + + /* "cyext_acv.pyx":6043 + * + * X_arr = np.array(X, dtype=np.double) + * y_X_arr = np.array(y_X, dtype=np.double) # <<<<<<<<<<<<<< + * t_arr = np.array(t, dtype=np.double) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6043, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6043, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_y_X, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6043, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6043, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6043, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6043, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_double); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6043, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 6043, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6043, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_y_X_arr = __pyx_t_1; + __pyx_t_1 = 0; + + /* "cyext_acv.pyx":6044 + * X_arr = np.array(X, dtype=np.double) + * y_X_arr = np.array(y_X, dtype=np.double) + * t_arr = np.array(t, dtype=np.double) # <<<<<<<<<<<<<< + * + * if C[0] != []: + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6044, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6044, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_t, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6044, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6044, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6044, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6044, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6044, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 6044, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6044, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_t_arr = __pyx_t_6; + __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6046 + * t_arr = np.array(t, dtype=np.double) + * + * if C[0] != []: # <<<<<<<<<<<<<< + * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] + * va_id = [[i] for i in search_space if i not in remove_va] + */ + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 6046, __pyx_L1_error) + } + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6046, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyObject_RichCompare(PyList_GET_ITEM(__pyx_v_C, 0), __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6046, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 6046, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_12) { + + /* "cyext_acv.pyx":6047 + * + * if C[0] != []: + * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] # <<<<<<<<<<<<<< + * va_id = [[i] for i in search_space if i not in remove_va] + * for ci in range(len(C)): + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6047, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 6047, __pyx_L1_error) + } + __pyx_t_13 = PyList_GET_SIZE(__pyx_v_C); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6047, __pyx_L1_error) + __pyx_t_14 = __pyx_t_13; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_ci = __pyx_t_15; + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 6047, __pyx_L1_error) + } + __pyx_t_6 = PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci); + __Pyx_INCREF(__pyx_t_6); + __pyx_t_16 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6047, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_17 = __pyx_t_16; + for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { + __pyx_v_cj = __pyx_t_18; + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 6047, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_GetItemInt(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci), __pyx_v_cj, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6047, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 6047, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + } + __pyx_v_remove_va = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "cyext_acv.pyx":6048 + * if C[0] != []: + * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] + * va_id = [[i] for i in search_space if i not in remove_va] # <<<<<<<<<<<<<< + * for ci in range(len(C)): + * i = 0 + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6048, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__pyx_v_search_space == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 6048, __pyx_L1_error) + } + __pyx_t_6 = __pyx_v_search_space; __Pyx_INCREF(__pyx_t_6); __pyx_t_13 = 0; + for (;;) { + if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_6)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 6048, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6048, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6048, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_i = __pyx_t_10; + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6048, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_t_3, __pyx_v_remove_va, Py_NE)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 6048, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_19 = (__pyx_t_12 != 0); + if (__pyx_t_19) { + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6048, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6048, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __pyx_t_3 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 6048, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_va_id = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "cyext_acv.pyx":6049 + * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] + * va_id = [[i] for i in search_space if i not in remove_va] + * for ci in range(len(C)): # <<<<<<<<<<<<<< + * i = 0 + * for cj in range(len(C[ci])): + */ + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 6049, __pyx_L1_error) + } + __pyx_t_13 = PyList_GET_SIZE(__pyx_v_C); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6049, __pyx_L1_error) + __pyx_t_14 = __pyx_t_13; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_ci = __pyx_t_15; + + /* "cyext_acv.pyx":6050 + * va_id = [[i] for i in search_space if i not in remove_va] + * for ci in range(len(C)): + * i = 0 # <<<<<<<<<<<<<< + * for cj in range(len(C[ci])): + * if C[ci][cj] in search_space: + */ + __pyx_v_i = 0; + + /* "cyext_acv.pyx":6051 + * for ci in range(len(C)): + * i = 0 + * for cj in range(len(C[ci])): # <<<<<<<<<<<<<< + * if C[ci][cj] in search_space: + * i += 1 + */ + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 6051, __pyx_L1_error) + } + __pyx_t_1 = PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_16 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6051, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_17 = __pyx_t_16; + for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { + __pyx_v_cj = __pyx_t_18; + + /* "cyext_acv.pyx":6052 + * i = 0 + * for cj in range(len(C[ci])): + * if C[ci][cj] in search_space: # <<<<<<<<<<<<<< + * i += 1 + * break + */ + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 6052, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci), __pyx_v_cj, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6052, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_19 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_search_space, Py_EQ)); if (unlikely(__pyx_t_19 < 0)) __PYX_ERR(0, 6052, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_12 = (__pyx_t_19 != 0); + if (__pyx_t_12) { + + /* "cyext_acv.pyx":6053 + * for cj in range(len(C[ci])): + * if C[ci][cj] in search_space: + * i += 1 # <<<<<<<<<<<<<< + * break + * if i != 0: + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "cyext_acv.pyx":6054 + * if C[ci][cj] in search_space: + * i += 1 + * break # <<<<<<<<<<<<<< + * if i != 0: + * va_id += [C[ci]] + */ + goto __pyx_L16_break; + + /* "cyext_acv.pyx":6052 + * i = 0 + * for cj in range(len(C[ci])): + * if C[ci][cj] in search_space: # <<<<<<<<<<<<<< + * i += 1 + * break + */ + } + } + __pyx_L16_break:; + + /* "cyext_acv.pyx":6055 + * i += 1 + * break + * if i != 0: # <<<<<<<<<<<<<< + * va_id += [C[ci]] + * else: + */ + __pyx_t_12 = ((__pyx_v_i != 0) != 0); + if (__pyx_t_12) { + + /* "cyext_acv.pyx":6056 + * break + * if i != 0: + * va_id += [C[ci]] # <<<<<<<<<<<<<< + * else: + * va_id = [[i] for i in search_space] + */ + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 6056, __pyx_L1_error) + } + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6056, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci)); + __Pyx_GIVEREF(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci)); + PyList_SET_ITEM(__pyx_t_1, 0, PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci)); + __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_va_id, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6056, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_va_id, ((PyObject*)__pyx_t_6)); + __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6055 + * i += 1 + * break + * if i != 0: # <<<<<<<<<<<<<< + * va_id += [C[ci]] + * else: + */ + } + } + + /* "cyext_acv.pyx":6046 + * t_arr = np.array(t, dtype=np.double) + * + * if C[0] != []: # <<<<<<<<<<<<<< + * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] + * va_id = [[i] for i in search_space if i not in remove_va] + */ + goto __pyx_L5; + } + + /* "cyext_acv.pyx":6058 + * va_id += [C[ci]] + * else: + * va_id = [[i] for i in search_space] # <<<<<<<<<<<<<< + * + * m = len(va_id) + */ + /*else*/ { + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6058, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__pyx_v_search_space == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 6058, __pyx_L1_error) + } + __pyx_t_1 = __pyx_v_search_space; __Pyx_INCREF(__pyx_t_1); __pyx_t_13 = 0; + for (;;) { + if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 6058, __pyx_L1_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6058, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6058, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_i = __pyx_t_10; + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6058, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6058, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __pyx_t_2 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 6058, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_va_id = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + } + __pyx_L5:; + + /* "cyext_acv.pyx":6060 + * va_id = [[i] for i in search_space] + * + * m = len(va_id) # <<<<<<<<<<<<<< + * power = [] + * max_size = 0 + */ + __pyx_t_13 = PyList_GET_SIZE(__pyx_v_va_id); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6060, __pyx_L1_error) + __pyx_v_m = __pyx_t_13; + + /* "cyext_acv.pyx":6061 + * + * m = len(va_id) + * power = [] # <<<<<<<<<<<<<< + * max_size = 0 + * for size in range(m + 1): + */ + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6061, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_power = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6062 + * m = len(va_id) + * power = [] + * max_size = 0 # <<<<<<<<<<<<<< + * for size in range(m + 1): + * power_b = [] + */ + __pyx_v_max_size = 0; + + /* "cyext_acv.pyx":6063 + * power = [] + * max_size = 0 + * for size in range(m + 1): # <<<<<<<<<<<<<< + * power_b = [] + * for co in itertools.combinations(va_id, size): + */ + __pyx_t_20 = (__pyx_v_m + 1); + __pyx_t_21 = __pyx_t_20; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_21; __pyx_t_10+=1) { + __pyx_v_size = __pyx_t_10; + + /* "cyext_acv.pyx":6064 + * max_size = 0 + * for size in range(m + 1): + * power_b = [] # <<<<<<<<<<<<<< + * for co in itertools.combinations(va_id, size): + * power_b.append(np.array(sum(list(co),[]))) + */ + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6064, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_power_b, ((PyObject*)__pyx_t_6)); + __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6065 + * for size in range(m + 1): + * power_b = [] + * for co in itertools.combinations(va_id, size): # <<<<<<<<<<<<<< + * power_b.append(np.array(sum(list(co),[]))) + * max_size += 1 + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_itertools); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6065, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_combinations); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6065, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6065, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = NULL; + __pyx_t_22 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_22 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_va_id, __pyx_t_1}; + __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6065, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_va_id, __pyx_t_1}; + __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6065, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + { + __pyx_t_4 = PyTuple_New(2+__pyx_t_22); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6065, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__pyx_t_2) { + __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL; + } + __Pyx_INCREF(__pyx_v_va_id); + __Pyx_GIVEREF(__pyx_v_va_id); + PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_22, __pyx_v_va_id); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_22, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6065, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) { + __pyx_t_3 = __pyx_t_6; __Pyx_INCREF(__pyx_t_3); __pyx_t_13 = 0; + __pyx_t_23 = NULL; + } else { + __pyx_t_13 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6065, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_23 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 6065, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + for (;;) { + if (likely(!__pyx_t_23)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 6065, __pyx_L1_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6065, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } else { + if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 6065, __pyx_L1_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6065, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } + } else { + __pyx_t_6 = __pyx_t_23(__pyx_t_3); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 6065, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_co, __pyx_t_6); + __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6066 + * power_b = [] + * for co in itertools.combinations(va_id, size): + * power_b.append(np.array(sum(list(co),[]))) # <<<<<<<<<<<<<< + * max_size += 1 + * power.append(power_b) + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6066, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6066, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PySequence_List(__pyx_v_co); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6066, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6066, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_24 = PyTuple_New(2); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6066, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_2); + __pyx_t_4 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6066, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_24 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_24)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_24); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_6 = (__pyx_t_24) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_24, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6066, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_25 = __Pyx_PyList_Append(__pyx_v_power_b, __pyx_t_6); if (unlikely(__pyx_t_25 == ((int)-1))) __PYX_ERR(0, 6066, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6067 + * for co in itertools.combinations(va_id, size): + * power_b.append(np.array(sum(list(co),[]))) + * max_size += 1 # <<<<<<<<<<<<<< + * power.append(power_b) + * if max_size >= 2**15: + */ + __pyx_v_max_size = (__pyx_v_max_size + 1); + + /* "cyext_acv.pyx":6065 + * for size in range(m + 1): + * power_b = [] + * for co in itertools.combinations(va_id, size): # <<<<<<<<<<<<<< + * power_b.append(np.array(sum(list(co),[]))) + * max_size += 1 + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "cyext_acv.pyx":6068 + * power_b.append(np.array(sum(list(co),[]))) + * max_size += 1 + * power.append(power_b) # <<<<<<<<<<<<<< + * if max_size >= 2**15: + * break + */ + __pyx_t_25 = __Pyx_PyList_Append(__pyx_v_power, __pyx_v_power_b); if (unlikely(__pyx_t_25 == ((int)-1))) __PYX_ERR(0, 6068, __pyx_L1_error) + + /* "cyext_acv.pyx":6069 + * max_size += 1 + * power.append(power_b) + * if max_size >= 2**15: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_12 = ((__pyx_v_max_size >= 0x8000) != 0); + if (__pyx_t_12) { + + /* "cyext_acv.pyx":6070 + * power.append(power_b) + * if max_size >= 2**15: + * break # <<<<<<<<<<<<<< + * + * cdef vector[vector[vector[long]]] power_cpp = power + */ + goto __pyx_L22_break; + + /* "cyext_acv.pyx":6069 + * max_size += 1 + * power.append(power_b) + * if max_size >= 2**15: # <<<<<<<<<<<<<< + * break + * + */ + } + } + __pyx_L22_break:; + + /* "cyext_acv.pyx":6072 + * break + * + * cdef vector[vector[vector[long]]] power_cpp = power # <<<<<<<<<<<<<< + * cdef long[:, :] s_star + * s_star = -1*np.ones((N, X.shape[1]), dtype=np.int) + */ + __pyx_t_26 = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_std_3a__3a_vector_3c_long_3e____3e___(__pyx_v_power); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6072, __pyx_L1_error) + __pyx_v_power_cpp = __pyx_t_26; + + /* "cyext_acv.pyx":6074 + * cdef vector[vector[vector[long]]] power_cpp = power + * cdef long[:, :] s_star + * s_star = -1*np.ones((N, X.shape[1]), dtype=np.int) # <<<<<<<<<<<<<< + * + * cdef long power_set_size = 2**m + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6074, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ones); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6074, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6074, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_X.shape[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6074, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6074, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); + __pyx_t_3 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6074, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6074, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6074, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6074, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_24) < 0) __PYX_ERR(0, 6074, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6074, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Multiply(__pyx_int_neg_1, __pyx_t_24); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6074, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_27 = __Pyx_PyObject_to_MemoryviewSlice_dsds_long(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_27.memview)) __PYX_ERR(0, 6074, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_s_star = __pyx_t_27; + __pyx_t_27.memview = NULL; + __pyx_t_27.data = NULL; + + /* "cyext_acv.pyx":6076 + * s_star = -1*np.ones((N, X.shape[1]), dtype=np.int) + * + * cdef long power_set_size = 2**m # <<<<<<<<<<<<<< + * S = np.zeros((data.shape[1]), dtype=np.int) + * S_bar = np.zeros((data.shape[1]), dtype=np.int) + */ + __pyx_v_power_set_size = __Pyx_pow_long(2, ((long)__pyx_v_m)); + + /* "cyext_acv.pyx":6077 + * + * cdef long power_set_size = 2**m + * S = np.zeros((data.shape[1]), dtype=np.int) # <<<<<<<<<<<<<< + * S_bar = np.zeros((data.shape[1]), dtype=np.int) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6077, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6077, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_data.shape[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6077, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6077, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6077, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6077, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6077, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 6077, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_24, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6077, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __pyx_convert_vector_from_py_int(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6077, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_S = __pyx_t_7; + + /* "cyext_acv.pyx":6078 + * cdef long power_set_size = 2**m + * S = np.zeros((data.shape[1]), dtype=np.int) + * S_bar = np.zeros((data.shape[1]), dtype=np.int) # <<<<<<<<<<<<<< + * + * for s_0 in tqdm(range(minimal, m+1)): + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6078, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6078, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_data.shape[1])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6078, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6078, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6078, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_24, __pyx_n_s_np); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6078, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_24, __pyx_n_s_int); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6078, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 6078, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6078, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_S_bar = __pyx_t_6; + __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6080 + * S_bar = np.zeros((data.shape[1]), dtype=np.int) + * + * for s_0 in tqdm(range(minimal, m+1)): # <<<<<<<<<<<<<< + * for s_1 in range(0, power_cpp[s_0].size()): + * for i in range(power_cpp[s_0][s_1].size()): + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_tqdm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6080, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_minimal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6080, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_long((__pyx_v_m + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6080, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_24 = PyTuple_New(2); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6080, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6080, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_24 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_24)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_24); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_6 = (__pyx_t_24) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_24, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6080, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) { + __pyx_t_3 = __pyx_t_6; __Pyx_INCREF(__pyx_t_3); __pyx_t_13 = 0; + __pyx_t_23 = NULL; + } else { + __pyx_t_13 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6080, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_23 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 6080, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + for (;;) { + if (likely(!__pyx_t_23)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 6080, __pyx_L1_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6080, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } else { + if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 6080, __pyx_L1_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6080, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } + } else { + __pyx_t_6 = __pyx_t_23(__pyx_t_3); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 6080, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6080, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_s_0 = __pyx_t_10; + + /* "cyext_acv.pyx":6081 + * + * for s_0 in tqdm(range(minimal, m+1)): + * for s_1 in range(0, power_cpp[s_0].size()): # <<<<<<<<<<<<<< + * for i in range(power_cpp[s_0][s_1].size()): + * S[i] = power_cpp[s_0][s_1][i] + */ + __pyx_t_28 = (__pyx_v_power_cpp[__pyx_v_s_0]).size(); + __pyx_t_29 = __pyx_t_28; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_29; __pyx_t_10+=1) { + __pyx_v_s_1 = __pyx_t_10; + + /* "cyext_acv.pyx":6082 + * for s_0 in tqdm(range(minimal, m+1)): + * for s_1 in range(0, power_cpp[s_0].size()): + * for i in range(power_cpp[s_0][s_1].size()): # <<<<<<<<<<<<<< + * S[i] = power_cpp[s_0][s_1][i] + * + */ + __pyx_t_30 = ((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1]).size(); + __pyx_t_31 = __pyx_t_30; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_31; __pyx_t_22+=1) { + __pyx_v_i = __pyx_t_22; + + /* "cyext_acv.pyx":6083 + * for s_1 in range(0, power_cpp[s_0].size()): + * for i in range(power_cpp[s_0][s_1].size()): + * S[i] = power_cpp[s_0][s_1][i] # <<<<<<<<<<<<<< + * + * S_size = power_cpp[s_0][s_1].size() + */ + (__pyx_v_S[__pyx_v_i]) = (((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1])[__pyx_v_i]); + } + + /* "cyext_acv.pyx":6085 + * S[i] = power_cpp[s_0][s_1][i] + * + * S_size = power_cpp[s_0][s_1].size() # <<<<<<<<<<<<<< + * r.clear() + * N = R.size() + */ + __pyx_v_S_size = ((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1]).size(); + + /* "cyext_acv.pyx":6086 + * + * S_size = power_cpp[s_0][s_1].size() + * r.clear() # <<<<<<<<<<<<<< + * N = R.size() + * in_data = np.zeros(X.shape[0]) + */ + __pyx_v_r.clear(); + + /* "cyext_acv.pyx":6087 + * S_size = power_cpp[s_0][s_1].size() + * r.clear() + * N = R.size() # <<<<<<<<<<<<<< + * in_data = np.zeros(X.shape[0]) + * + */ + __pyx_v_N = __pyx_v_R.size(); + + /* "cyext_acv.pyx":6088 + * r.clear() + * N = R.size() + * in_data = np.zeros(X.shape[0]) # <<<<<<<<<<<<<< + * + * S_bar_set = list(range(data.shape[1])) + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6088, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6088, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_X.shape[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6088, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_24))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_24); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_24); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_24, function); + } + } + __pyx_t_6 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_24, __pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_24, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6088, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 6088, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_in_data, 1); + __pyx_v_in_data = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":6090 + * in_data = np.zeros(X.shape[0]) + * + * S_bar_set = list(range(data.shape[1])) # <<<<<<<<<<<<<< + * for i in range(S_size): + * S_bar_set.remove(S[i]) + */ + __pyx_t_6 = PyInt_FromSsize_t((__pyx_v_data.shape[1])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6090, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_24 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_6); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6090, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PySequence_List(__pyx_t_24); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6090, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_XDECREF_SET(__pyx_v_S_bar_set, ((PyObject*)__pyx_t_6)); + __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6091 + * + * S_bar_set = list(range(data.shape[1])) + * for i in range(S_size): # <<<<<<<<<<<<<< + * S_bar_set.remove(S[i]) + * + */ + __pyx_t_22 = __pyx_v_S_size; + __pyx_t_32 = __pyx_t_22; + for (__pyx_t_33 = 0; __pyx_t_33 < __pyx_t_32; __pyx_t_33+=1) { + __pyx_v_i = __pyx_t_33; + + /* "cyext_acv.pyx":6092 + * S_bar_set = list(range(data.shape[1])) + * for i in range(S_size): + * S_bar_set.remove(S[i]) # <<<<<<<<<<<<<< + * + * for i in range(data.shape[1]-S_size): + */ + __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_S[__pyx_v_i])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6092, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_24 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyList_Type_remove, __pyx_v_S_bar_set, __pyx_t_6); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6092, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + } + + /* "cyext_acv.pyx":6094 + * S_bar_set.remove(S[i]) + * + * for i in range(data.shape[1]-S_size): # <<<<<<<<<<<<<< + * S_bar[i] = S_bar_set[i] + * + */ + __pyx_t_14 = ((__pyx_v_data.shape[1]) - __pyx_v_S_size); + __pyx_t_15 = __pyx_t_14; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_15; __pyx_t_22+=1) { + __pyx_v_i = __pyx_t_22; + + /* "cyext_acv.pyx":6095 + * + * for i in range(data.shape[1]-S_size): + * S_bar[i] = S_bar_set[i] # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_24 = PyList_GET_ITEM(__pyx_v_S_bar_set, __pyx_v_i); + __Pyx_INCREF(__pyx_t_24); + if (unlikely(__Pyx_SetItemInt(__pyx_v_S_bar, __pyx_v_i, __pyx_t_24, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0)) __PYX_ERR(0, 6095, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + } + + /* "cyext_acv.pyx":6097 + * S_bar[i] = S_bar_set[i] + * + * for i in range(N): # <<<<<<<<<<<<<< + * R_buf[i] = R[i] + * in_data[R_buf[i]] = 1 + */ + __pyx_t_8 = __pyx_v_N; + __pyx_t_9 = __pyx_t_8; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_9; __pyx_t_22+=1) { + __pyx_v_i = __pyx_t_22; + + /* "cyext_acv.pyx":6098 + * + * for i in range(N): + * R_buf[i] = R[i] # <<<<<<<<<<<<<< + * in_data[R_buf[i]] = 1 + * + */ + __pyx_t_34 = __pyx_v_i; + *((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_34 * __pyx_v_R_buf.strides[0]) )) = (__pyx_v_R[__pyx_v_i]); + + /* "cyext_acv.pyx":6099 + * for i in range(N): + * R_buf[i] = R[i] + * in_data[R_buf[i]] = 1 # <<<<<<<<<<<<<< + * + * # sdp_b[R_buf[i]] = single_compute_ddp_rf(X[R_buf[i]], y_X[R_buf[i]], data, y_data, S_bar[:m-S_size], features, thresholds, children_left, children_right, + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_34 * __pyx_v_R_buf.strides[0]) ))); + *((double *) ( /* dim=0 */ (__pyx_v_in_data.data + __pyx_t_35 * __pyx_v_in_data.strides[0]) )) = 1.0; + } + + /* "cyext_acv.pyx":6104 + * # max_depth, min_node_size, classifier, t) + * + * sdp_ba = compute_ddp_rf_same_set(X_arr[np.array(in_data, dtype=bool)], # <<<<<<<<<<<<<< + * y_X_arr[np.array(in_data, dtype=bool)], + * data, y_data, S_bar[:data.shape[1]-S_size], features, thresholds, children_left, + */ + __Pyx_GetModuleGlobalName(__pyx_t_24, __pyx_n_s_np); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_24, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = __pyx_memoryview_fromslice(__pyx_v_in_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_24); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_24); + __pyx_t_24 = 0; + __pyx_t_24 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 6104, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, __pyx_t_24); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = __Pyx_PyObject_GetItem(__pyx_v_X_arr, __pyx_t_1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_36 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_24, PyBUF_WRITABLE); if (unlikely(!__pyx_t_36.memview)) __PYX_ERR(0, 6104, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + + /* "cyext_acv.pyx":6105 + * + * sdp_ba = compute_ddp_rf_same_set(X_arr[np.array(in_data, dtype=bool)], + * y_X_arr[np.array(in_data, dtype=bool)], # <<<<<<<<<<<<<< + * data, y_data, S_bar[:data.shape[1]-S_size], features, thresholds, children_left, + * children_right, max_depth, min_node_size, classifier, t_arr[np.array(in_data, dtype=bool)]) + */ + __Pyx_GetModuleGlobalName(__pyx_t_24, __pyx_n_s_np); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_24, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = __pyx_memoryview_fromslice(__pyx_v_in_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_24); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_24); + __pyx_t_24 = 0; + __pyx_t_24 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 6105, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_24); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = __Pyx_PyObject_GetItem(__pyx_v_y_X_arr, __pyx_t_6); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_37 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_24, PyBUF_WRITABLE); if (unlikely(!__pyx_t_37.memview)) __PYX_ERR(0, 6105, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + + /* "cyext_acv.pyx":6106 + * sdp_ba = compute_ddp_rf_same_set(X_arr[np.array(in_data, dtype=bool)], + * y_X_arr[np.array(in_data, dtype=bool)], + * data, y_data, S_bar[:data.shape[1]-S_size], features, thresholds, children_left, # <<<<<<<<<<<<<< + * children_right, max_depth, min_node_size, classifier, t_arr[np.array(in_data, dtype=bool)]) + * + */ + __pyx_t_24 = __Pyx_PyObject_GetSlice(__pyx_v_S_bar, 0, ((__pyx_v_data.shape[1]) - __pyx_v_S_size), NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_7 = __pyx_convert_vector_from_py_int(__pyx_t_24); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6106, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + + /* "cyext_acv.pyx":6107 + * y_X_arr[np.array(in_data, dtype=bool)], + * data, y_data, S_bar[:data.shape[1]-S_size], features, thresholds, children_left, + * children_right, max_depth, min_node_size, classifier, t_arr[np.array(in_data, dtype=bool)]) # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __Pyx_GetModuleGlobalName(__pyx_t_24, __pyx_n_s_np); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_24, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = __pyx_memoryview_fromslice(__pyx_v_in_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_24); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_24); + __pyx_t_24 = 0; + __pyx_t_24 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 6107, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, __pyx_t_24); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = __Pyx_PyObject_GetItem(__pyx_v_t_arr, __pyx_t_1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_38 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_24, PyBUF_WRITABLE); if (unlikely(!__pyx_t_38.memview)) __PYX_ERR(0, 6107, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + + /* "cyext_acv.pyx":6104 + * # max_depth, min_node_size, classifier, t) + * + * sdp_ba = compute_ddp_rf_same_set(X_arr[np.array(in_data, dtype=bool)], # <<<<<<<<<<<<<< + * y_X_arr[np.array(in_data, dtype=bool)], + * data, y_data, S_bar[:data.shape[1]-S_size], features, thresholds, children_left, + */ + __pyx_t_24 = __pyx_f_9cyext_acv_compute_ddp_rf_same_set(__pyx_t_36, __pyx_t_37, __pyx_v_data, __pyx_v_y_data, __pyx_t_7, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_t_38, 0); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __PYX_XDEC_MEMVIEW(&__pyx_t_36, 1); + __pyx_t_36.memview = NULL; + __pyx_t_36.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_37, 1); + __pyx_t_37.memview = NULL; + __pyx_t_37.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_38, 1); + __pyx_t_38.memview = NULL; + __pyx_t_38.data = NULL; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_24, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 6104, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp_ba, 1); + __pyx_v_sdp_ba = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":6109 + * children_right, max_depth, min_node_size, classifier, t_arr[np.array(in_data, dtype=bool)]) + * + * for i in range(N): # <<<<<<<<<<<<<< + * sdp_b[R_buf[i]] = sdp_ba[i] + * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: + */ + __pyx_t_8 = __pyx_v_N; + __pyx_t_9 = __pyx_t_8; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_9; __pyx_t_22+=1) { + __pyx_v_i = __pyx_t_22; + + /* "cyext_acv.pyx":6110 + * + * for i in range(N): + * sdp_b[R_buf[i]] = sdp_ba[i] # <<<<<<<<<<<<<< + * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: + * sdp[R_buf[i]] = sdp_b[R_buf[i]] + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_i; + __pyx_t_39 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_35 * __pyx_v_R_buf.strides[0]) ))); + *((double *) ( /* dim=0 */ (__pyx_v_sdp_b.data + __pyx_t_39 * __pyx_v_sdp_b.strides[0]) )) = (*((double *) ( /* dim=0 */ (__pyx_v_sdp_ba.data + __pyx_t_34 * __pyx_v_sdp_ba.strides[0]) ))); + + /* "cyext_acv.pyx":6111 + * for i in range(N): + * sdp_b[R_buf[i]] = sdp_ba[i] + * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: # <<<<<<<<<<<<<< + * sdp[R_buf[i]] = sdp_b[R_buf[i]] + * len_s_star[R_buf[i]] = S_size + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_34 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_39 = __pyx_v_i; + __pyx_t_40 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_39 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_12 = (((*((double *) ( /* dim=0 */ (__pyx_v_sdp_b.data + __pyx_t_35 * __pyx_v_sdp_b.strides[0]) ))) >= (*((double *) ( /* dim=0 */ (__pyx_v_sdp.data + __pyx_t_40 * __pyx_v_sdp.strides[0]) )))) != 0); + if (__pyx_t_12) { + + /* "cyext_acv.pyx":6112 + * sdp_b[R_buf[i]] = sdp_ba[i] + * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: + * sdp[R_buf[i]] = sdp_b[R_buf[i]] # <<<<<<<<<<<<<< + * len_s_star[R_buf[i]] = S_size + * for s in range(S_size): + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_40 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_39 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_34 * __pyx_v_R_buf.strides[0]) ))); + *((double *) ( /* dim=0 */ (__pyx_v_sdp.data + __pyx_t_35 * __pyx_v_sdp.strides[0]) )) = (*((double *) ( /* dim=0 */ (__pyx_v_sdp_b.data + __pyx_t_40 * __pyx_v_sdp_b.strides[0]) ))); + + /* "cyext_acv.pyx":6113 + * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: + * sdp[R_buf[i]] = sdp_b[R_buf[i]] + * len_s_star[R_buf[i]] = S_size # <<<<<<<<<<<<<< + * for s in range(S_size): + * s_star[R_buf[i], s] = S[s] + */ + __pyx_t_39 = __pyx_v_i; + (__pyx_v_len_s_star[(*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_39 * __pyx_v_R_buf.strides[0]) )))]) = __pyx_v_S_size; + + /* "cyext_acv.pyx":6114 + * sdp[R_buf[i]] = sdp_b[R_buf[i]] + * len_s_star[R_buf[i]] = S_size + * for s in range(S_size): # <<<<<<<<<<<<<< + * s_star[R_buf[i], s] = S[s] + * + */ + __pyx_t_32 = __pyx_v_S_size; + __pyx_t_33 = __pyx_t_32; + for (__pyx_t_41 = 0; __pyx_t_41 < __pyx_t_33; __pyx_t_41+=1) { + __pyx_v_s = __pyx_t_41; + + /* "cyext_acv.pyx":6115 + * len_s_star[R_buf[i]] = S_size + * for s in range(S_size): + * s_star[R_buf[i], s] = S[s] # <<<<<<<<<<<<<< + * + * if S_size == X.shape[1]: + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_40 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_39 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_34 = __pyx_v_s; + *((long *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_s_star.data + __pyx_t_40 * __pyx_v_s_star.strides[0]) ) + __pyx_t_34 * __pyx_v_s_star.strides[1]) )) = (__pyx_v_S[__pyx_v_s]); + } + + /* "cyext_acv.pyx":6111 + * for i in range(N): + * sdp_b[R_buf[i]] = sdp_ba[i] + * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: # <<<<<<<<<<<<<< + * sdp[R_buf[i]] = sdp_b[R_buf[i]] + * len_s_star[R_buf[i]] = S_size + */ + } + + /* "cyext_acv.pyx":6117 + * s_star[R_buf[i], s] = S[s] + * + * if S_size == X.shape[1]: # <<<<<<<<<<<<<< + * sdp[R_buf[i]] = 1 + * len_s_star[R_buf[i]] = S_size + */ + __pyx_t_12 = ((__pyx_v_S_size == (__pyx_v_X.shape[1])) != 0); + if (__pyx_t_12) { + + /* "cyext_acv.pyx":6118 + * + * if S_size == X.shape[1]: + * sdp[R_buf[i]] = 1 # <<<<<<<<<<<<<< + * len_s_star[R_buf[i]] = S_size + * for s in range(S_size): + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_34 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_39 * __pyx_v_R_buf.strides[0]) ))); + *((double *) ( /* dim=0 */ (__pyx_v_sdp.data + __pyx_t_34 * __pyx_v_sdp.strides[0]) )) = 1.0; + + /* "cyext_acv.pyx":6119 + * if S_size == X.shape[1]: + * sdp[R_buf[i]] = 1 + * len_s_star[R_buf[i]] = S_size # <<<<<<<<<<<<<< + * for s in range(S_size): + * s_star[R_buf[i], s] = S[s] + */ + __pyx_t_39 = __pyx_v_i; + (__pyx_v_len_s_star[(*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_39 * __pyx_v_R_buf.strides[0]) )))]) = __pyx_v_S_size; + + /* "cyext_acv.pyx":6120 + * sdp[R_buf[i]] = 1 + * len_s_star[R_buf[i]] = S_size + * for s in range(S_size): # <<<<<<<<<<<<<< + * s_star[R_buf[i], s] = S[s] + * for s in range(len_s_star[R_buf[i]], X.shape[1]): # to filter (important for coalition) + */ + __pyx_t_32 = __pyx_v_S_size; + __pyx_t_33 = __pyx_t_32; + for (__pyx_t_41 = 0; __pyx_t_41 < __pyx_t_33; __pyx_t_41+=1) { + __pyx_v_s = __pyx_t_41; + + /* "cyext_acv.pyx":6121 + * len_s_star[R_buf[i]] = S_size + * for s in range(S_size): + * s_star[R_buf[i], s] = S[s] # <<<<<<<<<<<<<< + * for s in range(len_s_star[R_buf[i]], X.shape[1]): # to filter (important for coalition) + * s_star[R_buf[i], s] = -1 + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_34 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_39 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_40 = __pyx_v_s; + *((long *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_s_star.data + __pyx_t_34 * __pyx_v_s_star.strides[0]) ) + __pyx_t_40 * __pyx_v_s_star.strides[1]) )) = (__pyx_v_S[__pyx_v_s]); + } + + /* "cyext_acv.pyx":6122 + * for s in range(S_size): + * s_star[R_buf[i], s] = S[s] + * for s in range(len_s_star[R_buf[i]], X.shape[1]): # to filter (important for coalition) # <<<<<<<<<<<<<< + * s_star[R_buf[i], s] = -1 + * + */ + __pyx_t_14 = (__pyx_v_X.shape[1]); + __pyx_t_39 = __pyx_v_i; + __pyx_t_15 = __pyx_t_14; + for (__pyx_t_32 = (__pyx_v_len_s_star[(*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_39 * __pyx_v_R_buf.strides[0]) )))]); __pyx_t_32 < __pyx_t_15; __pyx_t_32+=1) { + __pyx_v_s = __pyx_t_32; + + /* "cyext_acv.pyx":6123 + * s_star[R_buf[i], s] = S[s] + * for s in range(len_s_star[R_buf[i]], X.shape[1]): # to filter (important for coalition) + * s_star[R_buf[i], s] = -1 # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_40 = __pyx_v_i; + __pyx_t_34 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_40 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_35 = __pyx_v_s; + *((long *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_s_star.data + __pyx_t_34 * __pyx_v_s_star.strides[0]) ) + __pyx_t_35 * __pyx_v_s_star.strides[1]) )) = -1L; + } + + /* "cyext_acv.pyx":6117 + * s_star[R_buf[i], s] = S[s] + * + * if S_size == X.shape[1]: # <<<<<<<<<<<<<< + * sdp[R_buf[i]] = 1 + * len_s_star[R_buf[i]] = S_size + */ + } + } + } + + /* "cyext_acv.pyx":6125 + * s_star[R_buf[i], s] = -1 + * + * for i in range(N): # <<<<<<<<<<<<<< + * if sdp[R_buf[i]] >= pi_level: + * r.push_back(R[i]) + */ + __pyx_t_8 = __pyx_v_N; + __pyx_t_9 = __pyx_t_8; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "cyext_acv.pyx":6126 + * + * for i in range(N): + * if sdp[R_buf[i]] >= pi_level: # <<<<<<<<<<<<<< + * r.push_back(R[i]) + * for s in range(len_s_star[R_buf[i]]): + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_40 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_39 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_12 = (((*((double *) ( /* dim=0 */ (__pyx_v_sdp.data + __pyx_t_40 * __pyx_v_sdp.strides[0]) ))) >= __pyx_v_pi_level) != 0); + if (__pyx_t_12) { + + /* "cyext_acv.pyx":6127 + * for i in range(N): + * if sdp[R_buf[i]] >= pi_level: + * r.push_back(R[i]) # <<<<<<<<<<<<<< + * for s in range(len_s_star[R_buf[i]]): + * sdp_global[s_star[R_buf[i], s]] += 1 + */ + try { + __pyx_v_r.push_back((__pyx_v_R[__pyx_v_i])); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 6127, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6128 + * if sdp[R_buf[i]] >= pi_level: + * r.push_back(R[i]) + * for s in range(len_s_star[R_buf[i]]): # <<<<<<<<<<<<<< + * sdp_global[s_star[R_buf[i], s]] += 1 + * + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_22 = (__pyx_v_len_s_star[(*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_39 * __pyx_v_R_buf.strides[0]) )))]); + __pyx_t_32 = __pyx_t_22; + for (__pyx_t_33 = 0; __pyx_t_33 < __pyx_t_32; __pyx_t_33+=1) { + __pyx_v_s = __pyx_t_33; + + /* "cyext_acv.pyx":6129 + * r.push_back(R[i]) + * for s in range(len_s_star[R_buf[i]]): + * sdp_global[s_star[R_buf[i], s]] += 1 # <<<<<<<<<<<<<< + * + * for i in range(r.size()): + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_40 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_39 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_35 = __pyx_v_s; + __pyx_t_34 = (*((long *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_s_star.data + __pyx_t_40 * __pyx_v_s_star.strides[0]) ) + __pyx_t_35 * __pyx_v_s_star.strides[1]) ))); + *((double *) ( /* dim=0 */ (__pyx_v_sdp_global.data + __pyx_t_34 * __pyx_v_sdp_global.strides[0]) )) += 1.0; + } + + /* "cyext_acv.pyx":6126 + * + * for i in range(N): + * if sdp[R_buf[i]] >= pi_level: # <<<<<<<<<<<<<< + * r.push_back(R[i]) + * for s in range(len_s_star[R_buf[i]]): + */ + } + } + + /* "cyext_acv.pyx":6131 + * sdp_global[s_star[R_buf[i], s]] += 1 + * + * for i in range(r.size()): # <<<<<<<<<<<<<< + * std_remove[vector[long].iterator, long](R.begin(), R.end(), r[i]) + * R.pop_back() + */ + __pyx_t_30 = __pyx_v_r.size(); + __pyx_t_31 = __pyx_t_30; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_31; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "cyext_acv.pyx":6132 + * + * for i in range(r.size()): + * std_remove[vector[long].iterator, long](R.begin(), R.end(), r[i]) # <<<<<<<<<<<<<< + * R.pop_back() + * + */ + (void)(std::remove ::iterator,long>(__pyx_v_R.begin(), __pyx_v_R.end(), (__pyx_v_r[__pyx_v_i]))); + + /* "cyext_acv.pyx":6133 + * for i in range(r.size()): + * std_remove[vector[long].iterator, long](R.begin(), R.end(), r[i]) + * R.pop_back() # <<<<<<<<<<<<<< + * + * if (R.size() == 0 or S_size >= X.shape[1]/2) and stop: + */ + __pyx_v_R.pop_back(); + } + + /* "cyext_acv.pyx":6135 + * R.pop_back() + * + * if (R.size() == 0 or S_size >= X.shape[1]/2) and stop: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_19 = ((__pyx_v_R.size() == 0) != 0); + if (!__pyx_t_19) { + } else { + goto __pyx_L57_next_and; + } + __pyx_t_19 = ((__pyx_v_S_size >= ((__pyx_v_X.shape[1]) / 2)) != 0); + if (__pyx_t_19) { + } else { + __pyx_t_12 = __pyx_t_19; + goto __pyx_L56_bool_binop_done; + } + __pyx_L57_next_and:; + __pyx_t_19 = (__pyx_v_stop != 0); + __pyx_t_12 = __pyx_t_19; + __pyx_L56_bool_binop_done:; + if (__pyx_t_12) { + + /* "cyext_acv.pyx":6136 + * + * if (R.size() == 0 or S_size >= X.shape[1]/2) and stop: + * break # <<<<<<<<<<<<<< + * + * return np.asarray(sdp_global)/X.shape[0], np.array(s_star, dtype=np.long), np.array(len_s_star, dtype=np.long), np.array(sdp) + */ + goto __pyx_L27_break; + + /* "cyext_acv.pyx":6135 + * R.pop_back() + * + * if (R.size() == 0 or S_size >= X.shape[1]/2) and stop: # <<<<<<<<<<<<<< + * break + * + */ + } + + /* "cyext_acv.pyx":6080 + * S_bar = np.zeros((data.shape[1]), dtype=np.int) + * + * for s_0 in tqdm(range(minimal, m+1)): # <<<<<<<<<<<<<< + * for s_1 in range(0, power_cpp[s_0].size()): + * for i in range(power_cpp[s_0][s_1].size()): + */ + } + __pyx_L27_break:; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "cyext_acv.pyx":6138 + * break + * + * return np.asarray(sdp_global)/X.shape[0], np.array(s_star, dtype=np.long), np.array(len_s_star, dtype=np.long), np.array(sdp) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_24, __pyx_n_s_np); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_24, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = __pyx_memoryview_fromslice(__pyx_v_sdp_global, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_t_24) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_24); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_X.shape[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_24 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_s_star, 2, (PyObject *(*)(char *)) __pyx_memview_get_long, (int (*)(char *, PyObject *)) __pyx_memview_set_long, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_long); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 6138, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_convert_vector_to_py_int(__pyx_v_len_s_star); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_42 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_long); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 6138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_42); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_42) < 0) __PYX_ERR(0, 6138, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0; + __pyx_t_42 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 6138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_42); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_sdp, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_24); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_24); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_42); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_42); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_1); + __pyx_t_24 = 0; + __pyx_t_4 = 0; + __pyx_t_42 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "cyext_acv.pyx":6008 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef global_ddp_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * int max_depth, int min_node_size, int & classifier, double[:, :] & t, list C, double pi_level, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); + __Pyx_XDECREF(__pyx_t_6); + __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1); + __Pyx_XDECREF(__pyx_t_24); + __PYX_XDEC_MEMVIEW(&__pyx_t_27, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_36, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_37, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_38, 1); + __Pyx_XDECREF(__pyx_t_42); + __Pyx_AddTraceback("cyext_acv.global_ddp_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp_b, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp_ba, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp_global, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_in_data, 1); + __Pyx_XDECREF(__pyx_v_power); + __Pyx_XDECREF(__pyx_v_va_id); + __PYX_XDEC_MEMVIEW(&__pyx_v_R_buf, 1); + __Pyx_XDECREF(__pyx_v_X_arr); + __Pyx_XDECREF(__pyx_v_y_X_arr); + __Pyx_XDECREF(__pyx_v_t_arr); + __Pyx_XDECREF(__pyx_v_remove_va); + __Pyx_XDECREF(__pyx_v_power_b); + __Pyx_XDECREF(__pyx_v_co); + __PYX_XDEC_MEMVIEW(&__pyx_v_s_star, 1); + __Pyx_XDECREF(__pyx_v_S_bar); + __Pyx_XDECREF(__pyx_v_S_bar_set); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_9cyext_acv_97global_ddp_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_9cyext_acv_97global_ddp_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_features = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_thresholds = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_left = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_right = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_max_depth; + int __pyx_v_min_node_size; + int __pyx_v_classifier; + __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_C = 0; + double __pyx_v_pi_level; + int __pyx_v_minimal; + int __pyx_v_stop; + PyObject *__pyx_v_search_space = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("global_ddp_rf (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_y_X,&__pyx_n_s_data,&__pyx_n_s_y_data,&__pyx_n_s_features,&__pyx_n_s_thresholds,&__pyx_n_s_children_left,&__pyx_n_s_children_right,&__pyx_n_s_max_depth,&__pyx_n_s_min_node_size,&__pyx_n_s_classifier,&__pyx_n_s_t,&__pyx_n_s_C,&__pyx_n_s_pi_level,&__pyx_n_s_minimal,&__pyx_n_s_stop,&__pyx_n_s_search_space,0}; + PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16); + CYTHON_FALLTHROUGH; + case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15); + CYTHON_FALLTHROUGH; + case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_X)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_rf", 1, 17, 17, 1); __PYX_ERR(0, 6008, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_rf", 1, 17, 17, 2); __PYX_ERR(0, 6008, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_rf", 1, 17, 17, 3); __PYX_ERR(0, 6008, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_features)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_rf", 1, 17, 17, 4); __PYX_ERR(0, 6008, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thresholds)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_rf", 1, 17, 17, 5); __PYX_ERR(0, 6008, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_left)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_rf", 1, 17, 17, 6); __PYX_ERR(0, 6008, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_rf", 1, 17, 17, 7); __PYX_ERR(0, 6008, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_rf", 1, 17, 17, 8); __PYX_ERR(0, 6008, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_node_size)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_rf", 1, 17, 17, 9); __PYX_ERR(0, 6008, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classifier)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_rf", 1, 17, 17, 10); __PYX_ERR(0, 6008, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_rf", 1, 17, 17, 11); __PYX_ERR(0, 6008, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_rf", 1, 17, 17, 12); __PYX_ERR(0, 6008, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 13: + if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pi_level)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_rf", 1, 17, 17, 13); __PYX_ERR(0, 6008, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 14: + if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minimal)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_rf", 1, 17, 17, 14); __PYX_ERR(0, 6008, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 15: + if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_rf", 1, 17, 17, 15); __PYX_ERR(0, 6008, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 16: + if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_search_space)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_rf", 1, 17, 17, 16); __PYX_ERR(0, 6008, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "global_ddp_rf") < 0)) __PYX_ERR(0, 6008, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 17) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + values[15] = PyTuple_GET_ITEM(__pyx_args, 15); + values[16] = PyTuple_GET_ITEM(__pyx_args, 16); + } + __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 6008, __pyx_L3_error) + __pyx_v_y_X = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_X.memview)) __PYX_ERR(0, 6008, __pyx_L3_error) + __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 6008, __pyx_L3_error) + __pyx_v_y_data = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_data.memview)) __PYX_ERR(0, 6008, __pyx_L3_error) + __pyx_v_features = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_features.memview)) __PYX_ERR(0, 6009, __pyx_L3_error) + __pyx_v_thresholds = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_thresholds.memview)) __PYX_ERR(0, 6009, __pyx_L3_error) + __pyx_v_children_left = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_left.memview)) __PYX_ERR(0, 6009, __pyx_L3_error) + __pyx_v_children_right = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_right.memview)) __PYX_ERR(0, 6009, __pyx_L3_error) + __pyx_v_max_depth = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6010, __pyx_L3_error) + __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6010, __pyx_L3_error) + __pyx_v_classifier = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6010, __pyx_L3_error) + __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[11], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 6010, __pyx_L3_error) + __pyx_v_C = ((PyObject*)values[12]); + __pyx_v_pi_level = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_pi_level == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 6010, __pyx_L3_error) + __pyx_v_minimal = __Pyx_PyInt_As_int(values[14]); if (unlikely((__pyx_v_minimal == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6011, __pyx_L3_error) + __pyx_v_stop = __Pyx_PyObject_IsTrue(values[15]); if (unlikely((__pyx_v_stop == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6011, __pyx_L3_error) + __pyx_v_search_space = ((PyObject*)values[16]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("global_ddp_rf", 1, 17, 17, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6008, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cyext_acv.global_ddp_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_C), (&PyList_Type), 1, "C", 1))) __PYX_ERR(0, 6010, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_search_space), (&PyList_Type), 1, "search_space", 1))) __PYX_ERR(0, 6011, __pyx_L1_error) + __pyx_r = __pyx_pf_9cyext_acv_96global_ddp_rf(__pyx_self, __pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_v_C, __pyx_v_pi_level, __pyx_v_minimal, __pyx_v_stop, __pyx_v_search_space); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9cyext_acv_96global_ddp_rf(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t, PyObject *__pyx_v_C, double __pyx_v_pi_level, int __pyx_v_minimal, int __pyx_v_stop, PyObject *__pyx_v_search_space) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("global_ddp_rf", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundLocalError("X"); __PYX_ERR(0, 6008, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_X.memview)) { __Pyx_RaiseUnboundLocalError("y_X"); __PYX_ERR(0, 6008, __pyx_L1_error) } + if (unlikely(!__pyx_v_data.memview)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 6008, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_data.memview)) { __Pyx_RaiseUnboundLocalError("y_data"); __PYX_ERR(0, 6008, __pyx_L1_error) } + if (unlikely(!__pyx_v_features.memview)) { __Pyx_RaiseUnboundLocalError("features"); __PYX_ERR(0, 6008, __pyx_L1_error) } + if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 6008, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 6008, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 6008, __pyx_L1_error) } + if (unlikely(!__pyx_v_t.memview)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 6008, __pyx_L1_error) } + __pyx_t_1 = __pyx_f_9cyext_acv_global_ddp_rf(__pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_v_C, __pyx_v_pi_level, __pyx_v_minimal, __pyx_v_stop, __pyx_v_search_space, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6008, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cyext_acv.global_ddp_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_features, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_thresholds, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_left, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_right, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_t, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cyext_acv.pyx":6145 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_sdp_rf_same_set(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[int] S, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * int max_depth, int min_node_size, int & classifier, double[:, :] & t): + */ + +static PyObject *__pyx_pw_9cyext_acv_99compute_sdp_rf_same_set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_sdp_rf_same_set(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, CYTHON_UNUSED int __pyx_skip_dispatch) { + int __pyx_v_N; + __Pyx_memviewslice __pyx_v_sdp = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_10; + __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_sdp_rf_same_set", 0); + + /* "cyext_acv.pyx":6149 + * int max_depth, int min_node_size, int & classifier, double[:, :] & t): + * + * cdef int N = X.shape[0] # <<<<<<<<<<<<<< + * cdef double[::1] sdp = np.zeros(N) + * cdef int i + */ + __pyx_v_N = (__pyx_v_X.shape[0]); + + /* "cyext_acv.pyx":6150 + * + * cdef int N = X.shape[0] + * cdef double[::1] sdp = np.zeros(N) # <<<<<<<<<<<<<< + * cdef int i + * for i in prange(N, nogil=True, schedule='dynamic'): + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 6150, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":6152 + * cdef double[::1] sdp = np.zeros(N) + * cdef int i + * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_sdp_rf(X[i], y_X[i], data, y_data, S, + * features, thresholds, children_left, children_right, + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + __pyx_t_6 = __pyx_v_N; + if ((1 == 0)) abort(); + { + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) (x) + #define unlikely(x) (x) + #endif + __pyx_t_8 = (__pyx_t_6 - 0 + 1 - 1/abs(1)) / 1; + if (__pyx_t_8 > 0) + { + #ifdef _OPENMP + #pragma omp parallel private(__pyx_t_10, __pyx_t_12) firstprivate(__pyx_t_11, __pyx_t_9) + #endif /* _OPENMP */ + { + #ifdef _OPENMP + #pragma omp for firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) schedule(dynamic) + #endif /* _OPENMP */ + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7++){ + { + __pyx_v_i = (int)(0 + 1 * __pyx_t_7); + + /* "cyext_acv.pyx":6153 + * cdef int i + * for i in prange(N, nogil=True, schedule='dynamic'): + * sdp[i] = single_compute_sdp_rf(X[i], y_X[i], data, y_data, S, # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i]) + */ + __pyx_t_9.data = __pyx_v_X.data; + __pyx_t_9.memview = __pyx_v_X.memview; + __PYX_INC_MEMVIEW(&__pyx_t_9, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_X.strides[0]; + __pyx_t_9.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_9.shape[0] = __pyx_v_X.shape[1]; +__pyx_t_9.strides[0] = __pyx_v_X.strides[1]; + __pyx_t_9.suboffsets[0] = -1; + +__pyx_t_10 = __pyx_v_i; + + /* "cyext_acv.pyx":6155 + * sdp[i] = single_compute_sdp_rf(X[i], y_X[i], data, y_data, S, + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i]) # <<<<<<<<<<<<<< + * return np.array(sdp) + * + */ + __pyx_t_11.data = __pyx_v_t.data; + __pyx_t_11.memview = __pyx_v_t.memview; + __PYX_INC_MEMVIEW(&__pyx_t_11, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_t.strides[0]; + __pyx_t_11.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_11.shape[0] = __pyx_v_t.shape[1]; +__pyx_t_11.strides[0] = __pyx_v_t.strides[1]; + __pyx_t_11.suboffsets[0] = -1; + +__pyx_t_12 = __pyx_v_i; + + /* "cyext_acv.pyx":6153 + * cdef int i + * for i in prange(N, nogil=True, schedule='dynamic'): + * sdp[i] = single_compute_sdp_rf(X[i], y_X[i], data, y_data, S, # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i]) + */ + *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_sdp.data) + __pyx_t_12)) )) = __pyx_f_9cyext_acv_single_compute_sdp_rf(__pyx_t_9, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_10)) ))), __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_t_11); + __PYX_XDEC_MEMVIEW(&__pyx_t_9, 0); + __pyx_t_9.memview = NULL; + __pyx_t_9.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_11, 0); + __pyx_t_11.memview = NULL; + __pyx_t_11.data = NULL; + } + } + } + } + } + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #endif + } + + /* "cyext_acv.pyx":6152 + * cdef double[::1] sdp = np.zeros(N) + * cdef int i + * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_sdp_rf(X[i], y_X[i], data, y_data, S, + * features, thresholds, children_left, children_right, + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "cyext_acv.pyx":6156 + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i]) + * return np.array(sdp) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_sdp, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "cyext_acv.pyx":6145 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_sdp_rf_same_set(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[int] S, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * int max_depth, int min_node_size, int & classifier, double[:, :] & t): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1); + __Pyx_AddTraceback("cyext_acv.compute_sdp_rf_same_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_9cyext_acv_99compute_sdp_rf_same_set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_9cyext_acv_99compute_sdp_rf_same_set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + std::vector __pyx_v_S; + __Pyx_memviewslice __pyx_v_features = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_thresholds = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_left = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_right = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_max_depth; + int __pyx_v_min_node_size; + int __pyx_v_classifier; + __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("compute_sdp_rf_same_set (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_y_X,&__pyx_n_s_data,&__pyx_n_s_y_data,&__pyx_n_s_S,&__pyx_n_s_features,&__pyx_n_s_thresholds,&__pyx_n_s_children_left,&__pyx_n_s_children_right,&__pyx_n_s_max_depth,&__pyx_n_s_min_node_size,&__pyx_n_s_classifier,&__pyx_n_s_t,0}; + PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_X)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_sdp_rf_same_set", 1, 13, 13, 1); __PYX_ERR(0, 6145, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_sdp_rf_same_set", 1, 13, 13, 2); __PYX_ERR(0, 6145, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_sdp_rf_same_set", 1, 13, 13, 3); __PYX_ERR(0, 6145, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_S)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_sdp_rf_same_set", 1, 13, 13, 4); __PYX_ERR(0, 6145, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_features)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_sdp_rf_same_set", 1, 13, 13, 5); __PYX_ERR(0, 6145, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thresholds)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_sdp_rf_same_set", 1, 13, 13, 6); __PYX_ERR(0, 6145, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_left)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_sdp_rf_same_set", 1, 13, 13, 7); __PYX_ERR(0, 6145, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_sdp_rf_same_set", 1, 13, 13, 8); __PYX_ERR(0, 6145, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_sdp_rf_same_set", 1, 13, 13, 9); __PYX_ERR(0, 6145, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_node_size)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_sdp_rf_same_set", 1, 13, 13, 10); __PYX_ERR(0, 6145, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classifier)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_sdp_rf_same_set", 1, 13, 13, 11); __PYX_ERR(0, 6145, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_sdp_rf_same_set", 1, 13, 13, 12); __PYX_ERR(0, 6145, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_sdp_rf_same_set") < 0)) __PYX_ERR(0, 6145, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 13) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + } + __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 6145, __pyx_L3_error) + __pyx_v_y_X = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_X.memview)) __PYX_ERR(0, 6145, __pyx_L3_error) + __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 6145, __pyx_L3_error) + __pyx_v_y_data = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_data.memview)) __PYX_ERR(0, 6145, __pyx_L3_error) + __pyx_v_S = __pyx_convert_vector_from_py_int(values[4]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6145, __pyx_L3_error) + __pyx_v_features = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_features.memview)) __PYX_ERR(0, 6146, __pyx_L3_error) + __pyx_v_thresholds = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_thresholds.memview)) __PYX_ERR(0, 6146, __pyx_L3_error) + __pyx_v_children_left = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_left.memview)) __PYX_ERR(0, 6146, __pyx_L3_error) + __pyx_v_children_right = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_right.memview)) __PYX_ERR(0, 6146, __pyx_L3_error) + __pyx_v_max_depth = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6147, __pyx_L3_error) + __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6147, __pyx_L3_error) + __pyx_v_classifier = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6147, __pyx_L3_error) + __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[12], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 6147, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("compute_sdp_rf_same_set", 1, 13, 13, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6145, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cyext_acv.compute_sdp_rf_same_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_9cyext_acv_98compute_sdp_rf_same_set(__pyx_self, __pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9cyext_acv_98compute_sdp_rf_same_set(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_sdp_rf_same_set", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundLocalError("X"); __PYX_ERR(0, 6145, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_X.memview)) { __Pyx_RaiseUnboundLocalError("y_X"); __PYX_ERR(0, 6145, __pyx_L1_error) } + if (unlikely(!__pyx_v_data.memview)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 6145, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_data.memview)) { __Pyx_RaiseUnboundLocalError("y_data"); __PYX_ERR(0, 6145, __pyx_L1_error) } + if (unlikely(!__pyx_v_features.memview)) { __Pyx_RaiseUnboundLocalError("features"); __PYX_ERR(0, 6145, __pyx_L1_error) } + if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 6145, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 6145, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 6145, __pyx_L1_error) } + if (unlikely(!__pyx_v_t.memview)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 6145, __pyx_L1_error) } + __pyx_t_1 = __pyx_f_9cyext_acv_compute_sdp_rf_same_set(__pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cyext_acv.compute_sdp_rf_same_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_features, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_thresholds, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_left, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_right, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_t, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cyext_acv.pyx":6163 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef global_sdp_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * int max_depth, int min_node_size, int & classifier, double[:, :] & t, list C, double pi_level, + */ + +static PyObject *__pyx_pw_9cyext_acv_101global_sdp_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_global_sdp_rf(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, PyObject *__pyx_v_C, double __pyx_v_pi_level, int __pyx_v_minimal, int __pyx_v_stop, PyObject *__pyx_v_search_space, CYTHON_UNUSED int __pyx_skip_dispatch) { + unsigned int __pyx_v_N; + unsigned int __pyx_v_m; + __Pyx_memviewslice __pyx_v_sdp = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_sdp_b = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_sdp_ba = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_sdp_global = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_in_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_i; + int __pyx_v_s; + int __pyx_v_s_0; + int __pyx_v_s_1; + int __pyx_v_S_size; + int __pyx_v_max_size; + int __pyx_v_size; + std::vector __pyx_v_S; + std::vector __pyx_v_len_s_star; + PyObject *__pyx_v_power = 0; + PyObject *__pyx_v_va_id = 0; + std::vector __pyx_v_R; + std::vector __pyx_v_r; + __Pyx_memviewslice __pyx_v_R_buf = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_X_arr = NULL; + PyObject *__pyx_v_y_X_arr = NULL; + PyObject *__pyx_v_t_arr = NULL; + PyObject *__pyx_v_remove_va = NULL; + Py_ssize_t __pyx_v_ci; + Py_ssize_t __pyx_v_cj; + PyObject *__pyx_v_power_b = NULL; + PyObject *__pyx_v_co = NULL; + std::vector > > __pyx_v_power_cpp; + __Pyx_memviewslice __pyx_v_s_star = { 0, 0, { 0 }, { 0 }, { 0 } }; + CYTHON_UNUSED long __pyx_v_power_set_size; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_t_6 = NULL; + std::vector __pyx_t_7; + unsigned int __pyx_t_8; + unsigned int __pyx_t_9; + int __pyx_t_10; + __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_t_19; + long __pyx_t_20; + long __pyx_t_21; + int __pyx_t_22; + PyObject *(*__pyx_t_23)(PyObject *); + PyObject *__pyx_t_24 = NULL; + int __pyx_t_25; + std::vector > > __pyx_t_26; + __Pyx_memviewslice __pyx_t_27 = { 0, 0, { 0 }, { 0 }, { 0 } }; + std::vector > ::size_type __pyx_t_28; + std::vector > ::size_type __pyx_t_29; + std::vector ::size_type __pyx_t_30; + std::vector ::size_type __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + __Pyx_memviewslice __pyx_t_34 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_35 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_36 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_37; + Py_ssize_t __pyx_t_38; + int __pyx_t_39; + int __pyx_t_40; + int __pyx_t_41; + PyObject *__pyx_t_42 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("global_sdp_rf", 0); + + /* "cyext_acv.pyx":6168 + * int minimal, bint stop, list search_space): + * + * cdef unsigned int N = X.shape[0] # <<<<<<<<<<<<<< + * cdef unsigned int m = X.shape[1] + * + */ + __pyx_v_N = (__pyx_v_X.shape[0]); + + /* "cyext_acv.pyx":6169 + * + * cdef unsigned int N = X.shape[0] + * cdef unsigned int m = X.shape[1] # <<<<<<<<<<<<<< + * + * cdef double[:] sdp, sdp_b, sdp_ba + */ + __pyx_v_m = (__pyx_v_X.shape[1]); + + /* "cyext_acv.pyx":6174 + * cdef double[:] sdp_global + * cdef double[:] in_data + * sdp = np.zeros((N)) # <<<<<<<<<<<<<< + * sdp_b = np.zeros((N)) + * sdp_global = np.zeros((m)) + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 6174, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":6175 + * cdef double[:] in_data + * sdp = np.zeros((N)) + * sdp_b = np.zeros((N)) # <<<<<<<<<<<<<< + * sdp_global = np.zeros((m)) + * in_data = np.zeros(N) + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 6175, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp_b = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":6176 + * sdp = np.zeros((N)) + * sdp_b = np.zeros((N)) + * sdp_global = np.zeros((m)) # <<<<<<<<<<<<<< + * in_data = np.zeros(N) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6176, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6176, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_m); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6176, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6176, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 6176, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp_global = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":6177 + * sdp_b = np.zeros((N)) + * sdp_global = np.zeros((m)) + * in_data = np.zeros(N) # <<<<<<<<<<<<<< + * + * cdef unsigned int it, it_s, a_it, b_it, o_all, p, p_s, nb_leaf, p_u, p_d, p_su, p_sd, down, up + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 6177, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_in_data = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":6184 + * + * cdef vector[int] S, len_s_star + * len_s_star = np.zeros((N), dtype=np.int) # <<<<<<<<<<<<<< + * + * cdef list power, va_id + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 6184, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = __pyx_convert_vector_from_py_int(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6184, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_len_s_star = __pyx_t_7; + + /* "cyext_acv.pyx":6189 + * + * cdef vector[long] R, r + * R.resize(N) # <<<<<<<<<<<<<< + * for i in range(N): + * R[i] = i + */ + try { + __pyx_v_R.resize(__pyx_v_N); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 6189, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6190 + * cdef vector[long] R, r + * R.resize(N) + * for i in range(N): # <<<<<<<<<<<<<< + * R[i] = i + * r.resize(N) + */ + __pyx_t_8 = __pyx_v_N; + __pyx_t_9 = __pyx_t_8; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "cyext_acv.pyx":6191 + * R.resize(N) + * for i in range(N): + * R[i] = i # <<<<<<<<<<<<<< + * r.resize(N) + * + */ + (__pyx_v_R[__pyx_v_i]) = __pyx_v_i; + } + + /* "cyext_acv.pyx":6192 + * for i in range(N): + * R[i] = i + * r.resize(N) # <<<<<<<<<<<<<< + * + * cdef long[:] R_buf + */ + try { + __pyx_v_r.resize(__pyx_v_N); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 6192, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6195 + * + * cdef long[:] R_buf + * R_buf = np.zeros((N), dtype=np.int) # <<<<<<<<<<<<<< + * + * X_arr = np.array(X, dtype=np.double) + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 6195, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6195, __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(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_long(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 6195, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_R_buf = __pyx_t_11; + __pyx_t_11.memview = NULL; + __pyx_t_11.data = NULL; + + /* "cyext_acv.pyx":6197 + * R_buf = np.zeros((N), dtype=np.int) + * + * X_arr = np.array(X, dtype=np.double) # <<<<<<<<<<<<<< + * y_X_arr = np.array(y_X, dtype=np.double) + * t_arr = np.array(t, dtype=np.double) + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_X, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_double); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 6197, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_X_arr = __pyx_t_2; + __pyx_t_2 = 0; + + /* "cyext_acv.pyx":6198 + * + * X_arr = np.array(X, dtype=np.double) + * y_X_arr = np.array(y_X, dtype=np.double) # <<<<<<<<<<<<<< + * t_arr = np.array(t, dtype=np.double) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_y_X, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_double); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 6198, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_y_X_arr = __pyx_t_1; + __pyx_t_1 = 0; + + /* "cyext_acv.pyx":6199 + * X_arr = np.array(X, dtype=np.double) + * y_X_arr = np.array(y_X, dtype=np.double) + * t_arr = np.array(t, dtype=np.double) # <<<<<<<<<<<<<< + * + * if C[0] != []: + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_t, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 6199, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_t_arr = __pyx_t_6; + __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6201 + * t_arr = np.array(t, dtype=np.double) + * + * if C[0] != []: # <<<<<<<<<<<<<< + * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] + * va_id = [[i] for i in search_space if i not in remove_va] + */ + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 6201, __pyx_L1_error) + } + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyObject_RichCompare(PyList_GET_ITEM(__pyx_v_C, 0), __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6201, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 6201, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_12) { + + /* "cyext_acv.pyx":6202 + * + * if C[0] != []: + * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] # <<<<<<<<<<<<<< + * va_id = [[i] for i in search_space if i not in remove_va] + * for ci in range(len(C)): + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 6202, __pyx_L1_error) + } + __pyx_t_13 = PyList_GET_SIZE(__pyx_v_C); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6202, __pyx_L1_error) + __pyx_t_14 = __pyx_t_13; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_ci = __pyx_t_15; + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 6202, __pyx_L1_error) + } + __pyx_t_6 = PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci); + __Pyx_INCREF(__pyx_t_6); + __pyx_t_16 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6202, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_17 = __pyx_t_16; + for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { + __pyx_v_cj = __pyx_t_18; + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 6202, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_GetItemInt(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci), __pyx_v_cj, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 6202, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + } + __pyx_v_remove_va = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "cyext_acv.pyx":6203 + * if C[0] != []: + * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] + * va_id = [[i] for i in search_space if i not in remove_va] # <<<<<<<<<<<<<< + * for ci in range(len(C)): + * i = 0 + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__pyx_v_search_space == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 6203, __pyx_L1_error) + } + __pyx_t_6 = __pyx_v_search_space; __Pyx_INCREF(__pyx_t_6); __pyx_t_13 = 0; + for (;;) { + if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_6)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 6203, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6203, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_i = __pyx_t_10; + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_t_3, __pyx_v_remove_va, Py_NE)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 6203, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_19 = (__pyx_t_12 != 0); + if (__pyx_t_19) { + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __pyx_t_3 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 6203, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_va_id = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "cyext_acv.pyx":6204 + * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] + * va_id = [[i] for i in search_space if i not in remove_va] + * for ci in range(len(C)): # <<<<<<<<<<<<<< + * i = 0 + * for cj in range(len(C[ci])): + */ + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 6204, __pyx_L1_error) + } + __pyx_t_13 = PyList_GET_SIZE(__pyx_v_C); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6204, __pyx_L1_error) + __pyx_t_14 = __pyx_t_13; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_ci = __pyx_t_15; + + /* "cyext_acv.pyx":6205 + * va_id = [[i] for i in search_space if i not in remove_va] + * for ci in range(len(C)): + * i = 0 # <<<<<<<<<<<<<< + * for cj in range(len(C[ci])): + * if C[ci][cj] in search_space: + */ + __pyx_v_i = 0; + + /* "cyext_acv.pyx":6206 + * for ci in range(len(C)): + * i = 0 + * for cj in range(len(C[ci])): # <<<<<<<<<<<<<< + * if C[ci][cj] in search_space: + * i += 1 + */ + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 6206, __pyx_L1_error) + } + __pyx_t_1 = PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_16 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6206, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_17 = __pyx_t_16; + for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { + __pyx_v_cj = __pyx_t_18; + + /* "cyext_acv.pyx":6207 + * i = 0 + * for cj in range(len(C[ci])): + * if C[ci][cj] in search_space: # <<<<<<<<<<<<<< + * i += 1 + * break + */ + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 6207, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci), __pyx_v_cj, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_19 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_search_space, Py_EQ)); if (unlikely(__pyx_t_19 < 0)) __PYX_ERR(0, 6207, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_12 = (__pyx_t_19 != 0); + if (__pyx_t_12) { + + /* "cyext_acv.pyx":6208 + * for cj in range(len(C[ci])): + * if C[ci][cj] in search_space: + * i += 1 # <<<<<<<<<<<<<< + * break + * if i != 0: + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "cyext_acv.pyx":6209 + * if C[ci][cj] in search_space: + * i += 1 + * break # <<<<<<<<<<<<<< + * if i != 0: + * va_id += [C[ci]] + */ + goto __pyx_L16_break; + + /* "cyext_acv.pyx":6207 + * i = 0 + * for cj in range(len(C[ci])): + * if C[ci][cj] in search_space: # <<<<<<<<<<<<<< + * i += 1 + * break + */ + } + } + __pyx_L16_break:; + + /* "cyext_acv.pyx":6210 + * i += 1 + * break + * if i != 0: # <<<<<<<<<<<<<< + * va_id += [C[ci]] + * else: + */ + __pyx_t_12 = ((__pyx_v_i != 0) != 0); + if (__pyx_t_12) { + + /* "cyext_acv.pyx":6211 + * break + * if i != 0: + * va_id += [C[ci]] # <<<<<<<<<<<<<< + * else: + * va_id = [[i] for i in search_space] + */ + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 6211, __pyx_L1_error) + } + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci)); + __Pyx_GIVEREF(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci)); + PyList_SET_ITEM(__pyx_t_1, 0, PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci)); + __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_va_id, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_va_id, ((PyObject*)__pyx_t_6)); + __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6210 + * i += 1 + * break + * if i != 0: # <<<<<<<<<<<<<< + * va_id += [C[ci]] + * else: + */ + } + } + + /* "cyext_acv.pyx":6201 + * t_arr = np.array(t, dtype=np.double) + * + * if C[0] != []: # <<<<<<<<<<<<<< + * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] + * va_id = [[i] for i in search_space if i not in remove_va] + */ + goto __pyx_L5; + } + + /* "cyext_acv.pyx":6213 + * va_id += [C[ci]] + * else: + * va_id = [[i] for i in search_space] # <<<<<<<<<<<<<< + * + * m = len(va_id) + */ + /*else*/ { + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__pyx_v_search_space == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 6213, __pyx_L1_error) + } + __pyx_t_1 = __pyx_v_search_space; __Pyx_INCREF(__pyx_t_1); __pyx_t_13 = 0; + for (;;) { + if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 6213, __pyx_L1_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6213, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_i = __pyx_t_10; + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __pyx_t_2 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 6213, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_va_id = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + } + __pyx_L5:; + + /* "cyext_acv.pyx":6215 + * va_id = [[i] for i in search_space] + * + * m = len(va_id) # <<<<<<<<<<<<<< + * power = [] + * max_size = 0 + */ + __pyx_t_13 = PyList_GET_SIZE(__pyx_v_va_id); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6215, __pyx_L1_error) + __pyx_v_m = __pyx_t_13; + + /* "cyext_acv.pyx":6216 + * + * m = len(va_id) + * power = [] # <<<<<<<<<<<<<< + * max_size = 0 + * for size in range(m + 1): + */ + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6216, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_power = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6217 + * m = len(va_id) + * power = [] + * max_size = 0 # <<<<<<<<<<<<<< + * for size in range(m + 1): + * power_b = [] + */ + __pyx_v_max_size = 0; + + /* "cyext_acv.pyx":6218 + * power = [] + * max_size = 0 + * for size in range(m + 1): # <<<<<<<<<<<<<< + * power_b = [] + * for co in itertools.combinations(va_id, size): + */ + __pyx_t_20 = (__pyx_v_m + 1); + __pyx_t_21 = __pyx_t_20; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_21; __pyx_t_10+=1) { + __pyx_v_size = __pyx_t_10; + + /* "cyext_acv.pyx":6219 + * max_size = 0 + * for size in range(m + 1): + * power_b = [] # <<<<<<<<<<<<<< + * for co in itertools.combinations(va_id, size): + * power_b.append(np.array(sum(list(co),[]))) + */ + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_power_b, ((PyObject*)__pyx_t_6)); + __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6220 + * for size in range(m + 1): + * power_b = [] + * for co in itertools.combinations(va_id, size): # <<<<<<<<<<<<<< + * power_b.append(np.array(sum(list(co),[]))) + * max_size += 1 + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_itertools); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_combinations); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = NULL; + __pyx_t_22 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_22 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_va_id, __pyx_t_1}; + __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6220, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_va_id, __pyx_t_1}; + __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6220, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + { + __pyx_t_4 = PyTuple_New(2+__pyx_t_22); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__pyx_t_2) { + __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL; + } + __Pyx_INCREF(__pyx_v_va_id); + __Pyx_GIVEREF(__pyx_v_va_id); + PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_22, __pyx_v_va_id); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_22, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) { + __pyx_t_3 = __pyx_t_6; __Pyx_INCREF(__pyx_t_3); __pyx_t_13 = 0; + __pyx_t_23 = NULL; + } else { + __pyx_t_13 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_23 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 6220, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + for (;;) { + if (likely(!__pyx_t_23)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 6220, __pyx_L1_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } else { + if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 6220, __pyx_L1_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } + } else { + __pyx_t_6 = __pyx_t_23(__pyx_t_3); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 6220, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_co, __pyx_t_6); + __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6221 + * power_b = [] + * for co in itertools.combinations(va_id, size): + * power_b.append(np.array(sum(list(co),[]))) # <<<<<<<<<<<<<< + * max_size += 1 + * power.append(power_b) + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PySequence_List(__pyx_v_co); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_24 = PyTuple_New(2); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_2); + __pyx_t_4 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_24 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_24)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_24); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_6 = (__pyx_t_24) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_24, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_25 = __Pyx_PyList_Append(__pyx_v_power_b, __pyx_t_6); if (unlikely(__pyx_t_25 == ((int)-1))) __PYX_ERR(0, 6221, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6222 + * for co in itertools.combinations(va_id, size): + * power_b.append(np.array(sum(list(co),[]))) + * max_size += 1 # <<<<<<<<<<<<<< + * power.append(power_b) + * if max_size >= 2**15: + */ + __pyx_v_max_size = (__pyx_v_max_size + 1); + + /* "cyext_acv.pyx":6220 + * for size in range(m + 1): + * power_b = [] + * for co in itertools.combinations(va_id, size): # <<<<<<<<<<<<<< + * power_b.append(np.array(sum(list(co),[]))) + * max_size += 1 + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "cyext_acv.pyx":6223 + * power_b.append(np.array(sum(list(co),[]))) + * max_size += 1 + * power.append(power_b) # <<<<<<<<<<<<<< + * if max_size >= 2**15: + * break + */ + __pyx_t_25 = __Pyx_PyList_Append(__pyx_v_power, __pyx_v_power_b); if (unlikely(__pyx_t_25 == ((int)-1))) __PYX_ERR(0, 6223, __pyx_L1_error) + + /* "cyext_acv.pyx":6224 + * max_size += 1 + * power.append(power_b) + * if max_size >= 2**15: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_12 = ((__pyx_v_max_size >= 0x8000) != 0); + if (__pyx_t_12) { + + /* "cyext_acv.pyx":6225 + * power.append(power_b) + * if max_size >= 2**15: + * break # <<<<<<<<<<<<<< + * + * cdef vector[vector[vector[long]]] power_cpp = power + */ + goto __pyx_L22_break; + + /* "cyext_acv.pyx":6224 + * max_size += 1 + * power.append(power_b) + * if max_size >= 2**15: # <<<<<<<<<<<<<< + * break + * + */ + } + } + __pyx_L22_break:; + + /* "cyext_acv.pyx":6227 + * break + * + * cdef vector[vector[vector[long]]] power_cpp = power # <<<<<<<<<<<<<< + * cdef long[:, :] s_star + * s_star = -1*np.ones((N, X.shape[1]), dtype=np.int) + */ + __pyx_t_26 = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_std_3a__3a_vector_3c_long_3e____3e___(__pyx_v_power); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6227, __pyx_L1_error) + __pyx_v_power_cpp = __pyx_t_26; + + /* "cyext_acv.pyx":6229 + * cdef vector[vector[vector[long]]] power_cpp = power + * cdef long[:, :] s_star + * s_star = -1*np.ones((N, X.shape[1]), dtype=np.int) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ones); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_X.shape[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); + __pyx_t_3 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_24) < 0) __PYX_ERR(0, 6229, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Multiply(__pyx_int_neg_1, __pyx_t_24); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_27 = __Pyx_PyObject_to_MemoryviewSlice_dsds_long(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_27.memview)) __PYX_ERR(0, 6229, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_s_star = __pyx_t_27; + __pyx_t_27.memview = NULL; + __pyx_t_27.data = NULL; + + /* "cyext_acv.pyx":6232 + * + * + * cdef long power_set_size = 2**m # <<<<<<<<<<<<<< + * S = np.zeros((data.shape[1]), dtype=np.int) + * + */ + __pyx_v_power_set_size = __Pyx_pow_long(2, ((long)__pyx_v_m)); + + /* "cyext_acv.pyx":6233 + * + * cdef long power_set_size = 2**m + * S = np.zeros((data.shape[1]), dtype=np.int) # <<<<<<<<<<<<<< + * + * for s_0 in tqdm(range(minimal, m + 1)): + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_data.shape[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 6233, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_24, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __pyx_convert_vector_from_py_int(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6233, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_S = __pyx_t_7; + + /* "cyext_acv.pyx":6235 + * S = np.zeros((data.shape[1]), dtype=np.int) + * + * for s_0 in tqdm(range(minimal, m + 1)): # <<<<<<<<<<<<<< + * for s_1 in range(0, power_cpp[s_0].size()): + * for i in range(power_cpp[s_0][s_1].size()): + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tqdm); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_minimal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_24 = __Pyx_PyInt_From_long((__pyx_v_m + 1)); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_24); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_24); + __pyx_t_1 = 0; + __pyx_t_24 = 0; + __pyx_t_24 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_6, NULL); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_24) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_24); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_13 = 0; + __pyx_t_23 = NULL; + } else { + __pyx_t_13 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_23 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 6235, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (likely(!__pyx_t_23)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 6235, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } else { + if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 6235, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } + } else { + __pyx_t_3 = __pyx_t_23(__pyx_t_2); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 6235, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6235, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_s_0 = __pyx_t_10; + + /* "cyext_acv.pyx":6236 + * + * for s_0 in tqdm(range(minimal, m + 1)): + * for s_1 in range(0, power_cpp[s_0].size()): # <<<<<<<<<<<<<< + * for i in range(power_cpp[s_0][s_1].size()): + * S[i] = power_cpp[s_0][s_1][i] + */ + __pyx_t_28 = (__pyx_v_power_cpp[__pyx_v_s_0]).size(); + __pyx_t_29 = __pyx_t_28; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_29; __pyx_t_10+=1) { + __pyx_v_s_1 = __pyx_t_10; + + /* "cyext_acv.pyx":6237 + * for s_0 in tqdm(range(minimal, m + 1)): + * for s_1 in range(0, power_cpp[s_0].size()): + * for i in range(power_cpp[s_0][s_1].size()): # <<<<<<<<<<<<<< + * S[i] = power_cpp[s_0][s_1][i] + * + */ + __pyx_t_30 = ((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1]).size(); + __pyx_t_31 = __pyx_t_30; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_31; __pyx_t_22+=1) { + __pyx_v_i = __pyx_t_22; + + /* "cyext_acv.pyx":6238 + * for s_1 in range(0, power_cpp[s_0].size()): + * for i in range(power_cpp[s_0][s_1].size()): + * S[i] = power_cpp[s_0][s_1][i] # <<<<<<<<<<<<<< + * + * S_size = power_cpp[s_0][s_1].size() + */ + (__pyx_v_S[__pyx_v_i]) = (((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1])[__pyx_v_i]); + } + + /* "cyext_acv.pyx":6240 + * S[i] = power_cpp[s_0][s_1][i] + * + * S_size = power_cpp[s_0][s_1].size() # <<<<<<<<<<<<<< + * r.clear() + * N = R.size() + */ + __pyx_v_S_size = ((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1]).size(); + + /* "cyext_acv.pyx":6241 + * + * S_size = power_cpp[s_0][s_1].size() + * r.clear() # <<<<<<<<<<<<<< + * N = R.size() + * in_data = np.zeros(X.shape[0]) + */ + __pyx_v_r.clear(); + + /* "cyext_acv.pyx":6242 + * S_size = power_cpp[s_0][s_1].size() + * r.clear() + * N = R.size() # <<<<<<<<<<<<<< + * in_data = np.zeros(X.shape[0]) + * + */ + __pyx_v_N = __pyx_v_R.size(); + + /* "cyext_acv.pyx":6243 + * r.clear() + * N = R.size() + * in_data = np.zeros(X.shape[0]) # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __Pyx_GetModuleGlobalName(__pyx_t_24, __pyx_n_s_np); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_24, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = PyInt_FromSsize_t((__pyx_v_X.shape[0])); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_1, __pyx_t_24) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_24); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 6243, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_in_data, 1); + __pyx_v_in_data = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":6245 + * in_data = np.zeros(X.shape[0]) + * + * for i in range(N): # <<<<<<<<<<<<<< + * R_buf[i] = R[i] + * in_data[R_buf[i]] = 1 + */ + __pyx_t_8 = __pyx_v_N; + __pyx_t_9 = __pyx_t_8; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_9; __pyx_t_22+=1) { + __pyx_v_i = __pyx_t_22; + + /* "cyext_acv.pyx":6246 + * + * for i in range(N): + * R_buf[i] = R[i] # <<<<<<<<<<<<<< + * in_data[R_buf[i]] = 1 + * + */ + __pyx_t_32 = __pyx_v_i; + *((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_32 * __pyx_v_R_buf.strides[0]) )) = (__pyx_v_R[__pyx_v_i]); + + /* "cyext_acv.pyx":6247 + * for i in range(N): + * R_buf[i] = R[i] + * in_data[R_buf[i]] = 1 # <<<<<<<<<<<<<< + * + * # sdp_b[R_buf[i]] = single_compute_sdp_rf(X[R_buf[i]], y_X[R_buf[i]], data, y_data, S[:S_size], features, thresholds, children_left, children_right, + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_32 * __pyx_v_R_buf.strides[0]) ))); + *((double *) ( /* dim=0 */ (__pyx_v_in_data.data + __pyx_t_33 * __pyx_v_in_data.strides[0]) )) = 1.0; + } + + /* "cyext_acv.pyx":6252 + * # max_depth, min_node_size, classifier, t) + * + * sdp_ba = compute_sdp_rf_same_set(X_arr[np.array(in_data, dtype=bool)], # <<<<<<<<<<<<<< + * y_X_arr[np.array(in_data, dtype=bool)], + * data, y_data, S[:S_size], features, thresholds, children_left, + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_in_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_24 = PyTuple_New(1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 6252, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_24, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_X_arr, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_34 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_34.memview)) __PYX_ERR(0, 6252, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "cyext_acv.pyx":6253 + * + * sdp_ba = compute_sdp_rf_same_set(X_arr[np.array(in_data, dtype=bool)], + * y_X_arr[np.array(in_data, dtype=bool)], # <<<<<<<<<<<<<< + * data, y_data, S[:S_size], features, thresholds, children_left, + * children_right, max_depth, min_node_size, classifier, t_arr[np.array(in_data, dtype=bool)]) + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_in_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_24 = PyTuple_New(1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 6253, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_24, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_y_X_arr, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_35 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_35.memview)) __PYX_ERR(0, 6253, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "cyext_acv.pyx":6254 + * sdp_ba = compute_sdp_rf_same_set(X_arr[np.array(in_data, dtype=bool)], + * y_X_arr[np.array(in_data, dtype=bool)], + * data, y_data, S[:S_size], features, thresholds, children_left, # <<<<<<<<<<<<<< + * children_right, max_depth, min_node_size, classifier, t_arr[np.array(in_data, dtype=bool)]) + * + */ + __pyx_t_3 = __pyx_convert_vector_to_py_int(__pyx_v_S); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_t_3, 0, __pyx_v_S_size, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = __pyx_convert_vector_from_py_int(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6254, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6255 + * y_X_arr[np.array(in_data, dtype=bool)], + * data, y_data, S[:S_size], features, thresholds, children_left, + * children_right, max_depth, min_node_size, classifier, t_arr[np.array(in_data, dtype=bool)]) # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6255, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6255, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_in_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6255, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_24 = PyTuple_New(1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6255, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6255, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 6255, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_24, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6255, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_t_arr, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6255, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_36 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_36.memview)) __PYX_ERR(0, 6255, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6252 + * # max_depth, min_node_size, classifier, t) + * + * sdp_ba = compute_sdp_rf_same_set(X_arr[np.array(in_data, dtype=bool)], # <<<<<<<<<<<<<< + * y_X_arr[np.array(in_data, dtype=bool)], + * data, y_data, S[:S_size], features, thresholds, children_left, + */ + __pyx_t_6 = __pyx_f_9cyext_acv_compute_sdp_rf_same_set(__pyx_t_34, __pyx_t_35, __pyx_v_data, __pyx_v_y_data, __pyx_t_7, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_t_36, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __PYX_XDEC_MEMVIEW(&__pyx_t_34, 1); + __pyx_t_34.memview = NULL; + __pyx_t_34.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_35, 1); + __pyx_t_35.memview = NULL; + __pyx_t_35.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_36, 1); + __pyx_t_36.memview = NULL; + __pyx_t_36.data = NULL; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 6252, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp_ba, 1); + __pyx_v_sdp_ba = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":6257 + * children_right, max_depth, min_node_size, classifier, t_arr[np.array(in_data, dtype=bool)]) + * + * for i in range(N): # <<<<<<<<<<<<<< + * sdp_b[R_buf[i]] = sdp_ba[i] + * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: + */ + __pyx_t_8 = __pyx_v_N; + __pyx_t_9 = __pyx_t_8; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_9; __pyx_t_22+=1) { + __pyx_v_i = __pyx_t_22; + + /* "cyext_acv.pyx":6258 + * + * for i in range(N): + * sdp_b[R_buf[i]] = sdp_ba[i] # <<<<<<<<<<<<<< + * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: + * sdp[R_buf[i]] = sdp_b[R_buf[i]] + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = __pyx_v_i; + __pyx_t_37 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_33 * __pyx_v_R_buf.strides[0]) ))); + *((double *) ( /* dim=0 */ (__pyx_v_sdp_b.data + __pyx_t_37 * __pyx_v_sdp_b.strides[0]) )) = (*((double *) ( /* dim=0 */ (__pyx_v_sdp_ba.data + __pyx_t_32 * __pyx_v_sdp_ba.strides[0]) ))); + + /* "cyext_acv.pyx":6259 + * for i in range(N): + * sdp_b[R_buf[i]] = sdp_ba[i] + * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: # <<<<<<<<<<<<<< + * sdp[R_buf[i]] = sdp_b[R_buf[i]] + * len_s_star[R_buf[i]] = S_size + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_32 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_37 = __pyx_v_i; + __pyx_t_38 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_37 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_12 = (((*((double *) ( /* dim=0 */ (__pyx_v_sdp_b.data + __pyx_t_33 * __pyx_v_sdp_b.strides[0]) ))) >= (*((double *) ( /* dim=0 */ (__pyx_v_sdp.data + __pyx_t_38 * __pyx_v_sdp.strides[0]) )))) != 0); + if (__pyx_t_12) { + + /* "cyext_acv.pyx":6260 + * sdp_b[R_buf[i]] = sdp_ba[i] + * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: + * sdp[R_buf[i]] = sdp_b[R_buf[i]] # <<<<<<<<<<<<<< + * len_s_star[R_buf[i]] = S_size + * for s in range(S_size): + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_38 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_37 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_32 * __pyx_v_R_buf.strides[0]) ))); + *((double *) ( /* dim=0 */ (__pyx_v_sdp.data + __pyx_t_33 * __pyx_v_sdp.strides[0]) )) = (*((double *) ( /* dim=0 */ (__pyx_v_sdp_b.data + __pyx_t_38 * __pyx_v_sdp_b.strides[0]) ))); + + /* "cyext_acv.pyx":6261 + * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: + * sdp[R_buf[i]] = sdp_b[R_buf[i]] + * len_s_star[R_buf[i]] = S_size # <<<<<<<<<<<<<< + * for s in range(S_size): + * s_star[R_buf[i], s] = S[s] + */ + __pyx_t_37 = __pyx_v_i; + (__pyx_v_len_s_star[(*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_37 * __pyx_v_R_buf.strides[0]) )))]) = __pyx_v_S_size; + + /* "cyext_acv.pyx":6262 + * sdp[R_buf[i]] = sdp_b[R_buf[i]] + * len_s_star[R_buf[i]] = S_size + * for s in range(S_size): # <<<<<<<<<<<<<< + * s_star[R_buf[i], s] = S[s] + * + */ + __pyx_t_39 = __pyx_v_S_size; + __pyx_t_40 = __pyx_t_39; + for (__pyx_t_41 = 0; __pyx_t_41 < __pyx_t_40; __pyx_t_41+=1) { + __pyx_v_s = __pyx_t_41; + + /* "cyext_acv.pyx":6263 + * len_s_star[R_buf[i]] = S_size + * for s in range(S_size): + * s_star[R_buf[i], s] = S[s] # <<<<<<<<<<<<<< + * + * if S_size == X.shape[1]: + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_38 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_37 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_32 = __pyx_v_s; + *((long *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_s_star.data + __pyx_t_38 * __pyx_v_s_star.strides[0]) ) + __pyx_t_32 * __pyx_v_s_star.strides[1]) )) = (__pyx_v_S[__pyx_v_s]); + } + + /* "cyext_acv.pyx":6259 + * for i in range(N): + * sdp_b[R_buf[i]] = sdp_ba[i] + * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: # <<<<<<<<<<<<<< + * sdp[R_buf[i]] = sdp_b[R_buf[i]] + * len_s_star[R_buf[i]] = S_size + */ + } + + /* "cyext_acv.pyx":6265 + * s_star[R_buf[i], s] = S[s] + * + * if S_size == X.shape[1]: # <<<<<<<<<<<<<< + * sdp[R_buf[i]] = 1 + * len_s_star[R_buf[i]] = S_size + */ + __pyx_t_12 = ((__pyx_v_S_size == (__pyx_v_X.shape[1])) != 0); + if (__pyx_t_12) { + + /* "cyext_acv.pyx":6266 + * + * if S_size == X.shape[1]: + * sdp[R_buf[i]] = 1 # <<<<<<<<<<<<<< + * len_s_star[R_buf[i]] = S_size + * for s in range(S_size): + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_32 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_37 * __pyx_v_R_buf.strides[0]) ))); + *((double *) ( /* dim=0 */ (__pyx_v_sdp.data + __pyx_t_32 * __pyx_v_sdp.strides[0]) )) = 1.0; + + /* "cyext_acv.pyx":6267 + * if S_size == X.shape[1]: + * sdp[R_buf[i]] = 1 + * len_s_star[R_buf[i]] = S_size # <<<<<<<<<<<<<< + * for s in range(S_size): + * s_star[R_buf[i], s] = S[s] + */ + __pyx_t_37 = __pyx_v_i; + (__pyx_v_len_s_star[(*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_37 * __pyx_v_R_buf.strides[0]) )))]) = __pyx_v_S_size; + + /* "cyext_acv.pyx":6268 + * sdp[R_buf[i]] = 1 + * len_s_star[R_buf[i]] = S_size + * for s in range(S_size): # <<<<<<<<<<<<<< + * s_star[R_buf[i], s] = S[s] + * for s in range(len_s_star[R_buf[i]], X.shape[1]): # to filter (important for coalition) + */ + __pyx_t_39 = __pyx_v_S_size; + __pyx_t_40 = __pyx_t_39; + for (__pyx_t_41 = 0; __pyx_t_41 < __pyx_t_40; __pyx_t_41+=1) { + __pyx_v_s = __pyx_t_41; + + /* "cyext_acv.pyx":6269 + * len_s_star[R_buf[i]] = S_size + * for s in range(S_size): + * s_star[R_buf[i], s] = S[s] # <<<<<<<<<<<<<< + * for s in range(len_s_star[R_buf[i]], X.shape[1]): # to filter (important for coalition) + * s_star[R_buf[i], s] = -1 + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_32 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_37 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_38 = __pyx_v_s; + *((long *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_s_star.data + __pyx_t_32 * __pyx_v_s_star.strides[0]) ) + __pyx_t_38 * __pyx_v_s_star.strides[1]) )) = (__pyx_v_S[__pyx_v_s]); + } + + /* "cyext_acv.pyx":6270 + * for s in range(S_size): + * s_star[R_buf[i], s] = S[s] + * for s in range(len_s_star[R_buf[i]], X.shape[1]): # to filter (important for coalition) # <<<<<<<<<<<<<< + * s_star[R_buf[i], s] = -1 + * + */ + __pyx_t_14 = (__pyx_v_X.shape[1]); + __pyx_t_37 = __pyx_v_i; + __pyx_t_15 = __pyx_t_14; + for (__pyx_t_39 = (__pyx_v_len_s_star[(*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_37 * __pyx_v_R_buf.strides[0]) )))]); __pyx_t_39 < __pyx_t_15; __pyx_t_39+=1) { + __pyx_v_s = __pyx_t_39; + + /* "cyext_acv.pyx":6271 + * s_star[R_buf[i], s] = S[s] + * for s in range(len_s_star[R_buf[i]], X.shape[1]): # to filter (important for coalition) + * s_star[R_buf[i], s] = -1 # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_32 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_38 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_33 = __pyx_v_s; + *((long *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_s_star.data + __pyx_t_32 * __pyx_v_s_star.strides[0]) ) + __pyx_t_33 * __pyx_v_s_star.strides[1]) )) = -1L; + } + + /* "cyext_acv.pyx":6265 + * s_star[R_buf[i], s] = S[s] + * + * if S_size == X.shape[1]: # <<<<<<<<<<<<<< + * sdp[R_buf[i]] = 1 + * len_s_star[R_buf[i]] = S_size + */ + } + } + } + + /* "cyext_acv.pyx":6273 + * s_star[R_buf[i], s] = -1 + * + * for i in range(N): # <<<<<<<<<<<<<< + * if sdp[R_buf[i]] >= pi_level: + * r.push_back(R[i]) + */ + __pyx_t_8 = __pyx_v_N; + __pyx_t_9 = __pyx_t_8; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "cyext_acv.pyx":6274 + * + * for i in range(N): + * if sdp[R_buf[i]] >= pi_level: # <<<<<<<<<<<<<< + * r.push_back(R[i]) + * for s in range(len_s_star[R_buf[i]]): + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_38 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_37 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_12 = (((*((double *) ( /* dim=0 */ (__pyx_v_sdp.data + __pyx_t_38 * __pyx_v_sdp.strides[0]) ))) >= __pyx_v_pi_level) != 0); + if (__pyx_t_12) { + + /* "cyext_acv.pyx":6275 + * for i in range(N): + * if sdp[R_buf[i]] >= pi_level: + * r.push_back(R[i]) # <<<<<<<<<<<<<< + * for s in range(len_s_star[R_buf[i]]): + * sdp_global[s_star[R_buf[i], s]] += 1 + */ + try { + __pyx_v_r.push_back((__pyx_v_R[__pyx_v_i])); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 6275, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6276 + * if sdp[R_buf[i]] >= pi_level: + * r.push_back(R[i]) + * for s in range(len_s_star[R_buf[i]]): # <<<<<<<<<<<<<< + * sdp_global[s_star[R_buf[i], s]] += 1 + * + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_22 = (__pyx_v_len_s_star[(*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_37 * __pyx_v_R_buf.strides[0]) )))]); + __pyx_t_39 = __pyx_t_22; + for (__pyx_t_40 = 0; __pyx_t_40 < __pyx_t_39; __pyx_t_40+=1) { + __pyx_v_s = __pyx_t_40; + + /* "cyext_acv.pyx":6277 + * r.push_back(R[i]) + * for s in range(len_s_star[R_buf[i]]): + * sdp_global[s_star[R_buf[i], s]] += 1 # <<<<<<<<<<<<<< + * + * for i in range(r.size()): + */ + __pyx_t_37 = __pyx_v_i; + __pyx_t_38 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_37 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_33 = __pyx_v_s; + __pyx_t_32 = (*((long *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_s_star.data + __pyx_t_38 * __pyx_v_s_star.strides[0]) ) + __pyx_t_33 * __pyx_v_s_star.strides[1]) ))); + *((double *) ( /* dim=0 */ (__pyx_v_sdp_global.data + __pyx_t_32 * __pyx_v_sdp_global.strides[0]) )) += 1.0; + } + + /* "cyext_acv.pyx":6274 + * + * for i in range(N): + * if sdp[R_buf[i]] >= pi_level: # <<<<<<<<<<<<<< + * r.push_back(R[i]) + * for s in range(len_s_star[R_buf[i]]): + */ + } + } + + /* "cyext_acv.pyx":6279 + * sdp_global[s_star[R_buf[i], s]] += 1 + * + * for i in range(r.size()): # <<<<<<<<<<<<<< + * std_remove[vector[long].iterator, long](R.begin(), R.end(), r[i]) + * R.pop_back() + */ + __pyx_t_30 = __pyx_v_r.size(); + __pyx_t_31 = __pyx_t_30; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_31; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "cyext_acv.pyx":6280 + * + * for i in range(r.size()): + * std_remove[vector[long].iterator, long](R.begin(), R.end(), r[i]) # <<<<<<<<<<<<<< + * R.pop_back() + * + */ + (void)(std::remove ::iterator,long>(__pyx_v_R.begin(), __pyx_v_R.end(), (__pyx_v_r[__pyx_v_i]))); + + /* "cyext_acv.pyx":6281 + * for i in range(r.size()): + * std_remove[vector[long].iterator, long](R.begin(), R.end(), r[i]) + * R.pop_back() # <<<<<<<<<<<<<< + * + * if (R.size() == 0 or S_size >= X.shape[1]/2) and stop: + */ + __pyx_v_R.pop_back(); + } + + /* "cyext_acv.pyx":6283 + * R.pop_back() + * + * if (R.size() == 0 or S_size >= X.shape[1]/2) and stop: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_19 = ((__pyx_v_R.size() == 0) != 0); + if (!__pyx_t_19) { + } else { + goto __pyx_L53_next_and; + } + __pyx_t_19 = ((__pyx_v_S_size >= ((__pyx_v_X.shape[1]) / 2)) != 0); + if (__pyx_t_19) { + } else { + __pyx_t_12 = __pyx_t_19; + goto __pyx_L52_bool_binop_done; + } + __pyx_L53_next_and:; + __pyx_t_19 = (__pyx_v_stop != 0); + __pyx_t_12 = __pyx_t_19; + __pyx_L52_bool_binop_done:; + if (__pyx_t_12) { + + /* "cyext_acv.pyx":6284 + * + * if (R.size() == 0 or S_size >= X.shape[1]/2) and stop: + * break # <<<<<<<<<<<<<< + * + * return np.asarray(sdp_global)/X.shape[0], np.array(s_star, dtype=np.long), np.array(len_s_star, dtype=np.long), np.array(sdp) + */ + goto __pyx_L27_break; + + /* "cyext_acv.pyx":6283 + * R.pop_back() + * + * if (R.size() == 0 or S_size >= X.shape[1]/2) and stop: # <<<<<<<<<<<<<< + * break + * + */ + } + + /* "cyext_acv.pyx":6235 + * S = np.zeros((data.shape[1]), dtype=np.int) + * + * for s_0 in tqdm(range(minimal, m + 1)): # <<<<<<<<<<<<<< + * for s_1 in range(0, power_cpp[s_0].size()): + * for i in range(power_cpp[s_0][s_1].size()): + */ + } + __pyx_L27_break:; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "cyext_acv.pyx":6286 + * break + * + * return np.asarray(sdp_global)/X.shape[0], np.array(s_star, dtype=np.long), np.array(len_s_star, dtype=np.long), np.array(sdp) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_sdp_global, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_24 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_24 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_24)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_24); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_2 = (__pyx_t_24) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_24, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); + __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_X.shape[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_s_star, 2, (PyObject *(*)(char *)) __pyx_memview_get_long, (int (*)(char *, PyObject *)) __pyx_memview_set_long, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_24 = PyTuple_New(1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_long); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 6286, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_24, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_convert_vector_to_py_int(__pyx_v_len_s_star); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_42 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_long); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 6286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_42); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_42) < 0) __PYX_ERR(0, 6286, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0; + __pyx_t_42 = __Pyx_PyObject_Call(__pyx_t_24, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 6286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_42); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_sdp, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_24))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_24); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_24); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_24, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_24, __pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_24, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = PyTuple_New(4); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_42); + PyTuple_SET_ITEM(__pyx_t_24, 2, __pyx_t_42); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_24, 3, __pyx_t_1); + __pyx_t_6 = 0; + __pyx_t_4 = 0; + __pyx_t_42 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_24; + __pyx_t_24 = 0; + goto __pyx_L0; + + /* "cyext_acv.pyx":6163 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef global_sdp_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * int max_depth, int min_node_size, int & classifier, double[:, :] & t, list C, double pi_level, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); + __Pyx_XDECREF(__pyx_t_6); + __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1); + __Pyx_XDECREF(__pyx_t_24); + __PYX_XDEC_MEMVIEW(&__pyx_t_27, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_34, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_35, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_36, 1); + __Pyx_XDECREF(__pyx_t_42); + __Pyx_AddTraceback("cyext_acv.global_sdp_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp_b, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp_ba, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp_global, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_in_data, 1); + __Pyx_XDECREF(__pyx_v_power); + __Pyx_XDECREF(__pyx_v_va_id); + __PYX_XDEC_MEMVIEW(&__pyx_v_R_buf, 1); + __Pyx_XDECREF(__pyx_v_X_arr); + __Pyx_XDECREF(__pyx_v_y_X_arr); + __Pyx_XDECREF(__pyx_v_t_arr); + __Pyx_XDECREF(__pyx_v_remove_va); + __Pyx_XDECREF(__pyx_v_power_b); + __Pyx_XDECREF(__pyx_v_co); + __PYX_XDEC_MEMVIEW(&__pyx_v_s_star, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_9cyext_acv_101global_sdp_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_9cyext_acv_101global_sdp_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_features = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_thresholds = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_left = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_right = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_max_depth; + int __pyx_v_min_node_size; + int __pyx_v_classifier; + __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_C = 0; + double __pyx_v_pi_level; + int __pyx_v_minimal; + int __pyx_v_stop; + PyObject *__pyx_v_search_space = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("global_sdp_rf (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_y_X,&__pyx_n_s_data,&__pyx_n_s_y_data,&__pyx_n_s_features,&__pyx_n_s_thresholds,&__pyx_n_s_children_left,&__pyx_n_s_children_right,&__pyx_n_s_max_depth,&__pyx_n_s_min_node_size,&__pyx_n_s_classifier,&__pyx_n_s_t,&__pyx_n_s_C,&__pyx_n_s_pi_level,&__pyx_n_s_minimal,&__pyx_n_s_stop,&__pyx_n_s_search_space,0}; + PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16); + CYTHON_FALLTHROUGH; + case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15); + CYTHON_FALLTHROUGH; + case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_X)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, 1); __PYX_ERR(0, 6163, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, 2); __PYX_ERR(0, 6163, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, 3); __PYX_ERR(0, 6163, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_features)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, 4); __PYX_ERR(0, 6163, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thresholds)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, 5); __PYX_ERR(0, 6163, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_left)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, 6); __PYX_ERR(0, 6163, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, 7); __PYX_ERR(0, 6163, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, 8); __PYX_ERR(0, 6163, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_node_size)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, 9); __PYX_ERR(0, 6163, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classifier)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, 10); __PYX_ERR(0, 6163, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, 11); __PYX_ERR(0, 6163, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, 12); __PYX_ERR(0, 6163, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 13: + if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pi_level)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, 13); __PYX_ERR(0, 6163, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 14: + if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minimal)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, 14); __PYX_ERR(0, 6163, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 15: + if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, 15); __PYX_ERR(0, 6163, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 16: + if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_search_space)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, 16); __PYX_ERR(0, 6163, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "global_sdp_rf") < 0)) __PYX_ERR(0, 6163, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 17) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + values[15] = PyTuple_GET_ITEM(__pyx_args, 15); + values[16] = PyTuple_GET_ITEM(__pyx_args, 16); + } + __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 6163, __pyx_L3_error) + __pyx_v_y_X = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_X.memview)) __PYX_ERR(0, 6163, __pyx_L3_error) + __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 6163, __pyx_L3_error) + __pyx_v_y_data = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_data.memview)) __PYX_ERR(0, 6163, __pyx_L3_error) + __pyx_v_features = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_features.memview)) __PYX_ERR(0, 6164, __pyx_L3_error) + __pyx_v_thresholds = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_thresholds.memview)) __PYX_ERR(0, 6164, __pyx_L3_error) + __pyx_v_children_left = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_left.memview)) __PYX_ERR(0, 6164, __pyx_L3_error) + __pyx_v_children_right = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_right.memview)) __PYX_ERR(0, 6164, __pyx_L3_error) + __pyx_v_max_depth = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6165, __pyx_L3_error) + __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6165, __pyx_L3_error) + __pyx_v_classifier = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6165, __pyx_L3_error) + __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[11], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 6165, __pyx_L3_error) + __pyx_v_C = ((PyObject*)values[12]); + __pyx_v_pi_level = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_pi_level == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 6165, __pyx_L3_error) + __pyx_v_minimal = __Pyx_PyInt_As_int(values[14]); if (unlikely((__pyx_v_minimal == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6166, __pyx_L3_error) + __pyx_v_stop = __Pyx_PyObject_IsTrue(values[15]); if (unlikely((__pyx_v_stop == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6166, __pyx_L3_error) + __pyx_v_search_space = ((PyObject*)values[16]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6163, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cyext_acv.global_sdp_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_C), (&PyList_Type), 1, "C", 1))) __PYX_ERR(0, 6165, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_search_space), (&PyList_Type), 1, "search_space", 1))) __PYX_ERR(0, 6166, __pyx_L1_error) + __pyx_r = __pyx_pf_9cyext_acv_100global_sdp_rf(__pyx_self, __pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_v_C, __pyx_v_pi_level, __pyx_v_minimal, __pyx_v_stop, __pyx_v_search_space); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9cyext_acv_100global_sdp_rf(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t, PyObject *__pyx_v_C, double __pyx_v_pi_level, int __pyx_v_minimal, int __pyx_v_stop, PyObject *__pyx_v_search_space) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("global_sdp_rf", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundLocalError("X"); __PYX_ERR(0, 6163, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_X.memview)) { __Pyx_RaiseUnboundLocalError("y_X"); __PYX_ERR(0, 6163, __pyx_L1_error) } + if (unlikely(!__pyx_v_data.memview)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 6163, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_data.memview)) { __Pyx_RaiseUnboundLocalError("y_data"); __PYX_ERR(0, 6163, __pyx_L1_error) } + if (unlikely(!__pyx_v_features.memview)) { __Pyx_RaiseUnboundLocalError("features"); __PYX_ERR(0, 6163, __pyx_L1_error) } + if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 6163, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 6163, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 6163, __pyx_L1_error) } + if (unlikely(!__pyx_v_t.memview)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 6163, __pyx_L1_error) } + __pyx_t_1 = __pyx_f_9cyext_acv_global_sdp_rf(__pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_v_C, __pyx_v_pi_level, __pyx_v_minimal, __pyx_v_stop, __pyx_v_search_space, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cyext_acv.global_sdp_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_features, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_thresholds, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_left, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_right, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_t, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cyext_acv.pyx":6293 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef sufficient_expl_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * int max_depth, int min_node_size, int & classifier, double[:, :] & t, list C, double pi_level, + */ + +static PyObject *__pyx_pw_9cyext_acv_103sufficient_expl_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_sufficient_expl_rf(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, PyObject *__pyx_v_C, double __pyx_v_pi_level, int __pyx_v_minimal, CYTHON_UNUSED int __pyx_v_stop, PyObject *__pyx_v_search_space, CYTHON_UNUSED int __pyx_skip_dispatch) { + unsigned int __pyx_v_N; + unsigned int __pyx_v_m; + __Pyx_memviewslice __pyx_v_sdp = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_sdp_global = { 0, 0, { 0 }, { 0 }, { 0 } }; + double __pyx_v_K; + int __pyx_v_i; + int __pyx_v_s; + int __pyx_v_s_0; + int __pyx_v_s_1; + int __pyx_v_S_size; + int __pyx_v_j; + int __pyx_v_max_size; + int __pyx_v_size; + int __pyx_v_subset; + int __pyx_v_a; + int __pyx_v_k; + std::vector __pyx_v_S; + CYTHON_UNUSED std::vector __pyx_v_len_s_star; + PyObject *__pyx_v_power = 0; + PyObject *__pyx_v_va_id = 0; + PyObject *__pyx_v_remove_va = NULL; + Py_ssize_t __pyx_v_ci; + Py_ssize_t __pyx_v_cj; + PyObject *__pyx_v_power_b = NULL; + PyObject *__pyx_v_co = NULL; + std::vector > > __pyx_v_power_cpp; + CYTHON_UNUSED __Pyx_memviewslice __pyx_v_s_star = { 0, 0, { 0 }, { 0 }, { 0 } }; + CYTHON_UNUSED long __pyx_v_power_set_size; + std::vector > > __pyx_v_sufficient; + std::vector > __pyx_v_sufficient_sdp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_t_6 = NULL; + std::vector __pyx_t_7; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + long __pyx_t_17; + long __pyx_t_18; + int __pyx_t_19; + PyObject *(*__pyx_t_20)(PyObject *); + PyObject *__pyx_t_21 = NULL; + int __pyx_t_22; + std::vector > > __pyx_t_23; + __Pyx_memviewslice __pyx_t_24 = { 0, 0, { 0 }, { 0 }, { 0 } }; + unsigned int __pyx_t_25; + unsigned int __pyx_t_26; + std::vector > __pyx_t_27; + std::vector > ::size_type __pyx_t_28; + std::vector > ::size_type __pyx_t_29; + std::vector ::size_type __pyx_t_30; + std::vector ::size_type __pyx_t_31; + Py_ssize_t __pyx_t_32; + std::vector > ::size_type __pyx_t_33; + std::vector > ::size_type __pyx_t_34; + int __pyx_t_35; + int __pyx_t_36; + int __pyx_t_37; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sufficient_expl_rf", 0); + + /* "cyext_acv.pyx":6298 + * int minimal, bint stop, list search_space): + * + * cdef unsigned int N = X.shape[0] # <<<<<<<<<<<<<< + * cdef unsigned int m = X.shape[1] + * + */ + __pyx_v_N = (__pyx_v_X.shape[0]); + + /* "cyext_acv.pyx":6299 + * + * cdef unsigned int N = X.shape[0] + * cdef unsigned int m = X.shape[1] # <<<<<<<<<<<<<< + * + * cdef double[:] sdp, sdp_b, sdp_ba + */ + __pyx_v_m = (__pyx_v_X.shape[1]); + + /* "cyext_acv.pyx":6303 + * cdef double[:] sdp, sdp_b, sdp_ba + * cdef double[:] sdp_global + * sdp = np.zeros((N)) # <<<<<<<<<<<<<< + * sdp_global = np.zeros((m)) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6303, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6303, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6303, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6303, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 6303, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":6304 + * cdef double[:] sdp_global + * sdp = np.zeros((N)) + * sdp_global = np.zeros((m)) # <<<<<<<<<<<<<< + * + * cdef unsigned int it, it_s, a_it, b_it, o_all, p, p_s, nb_leaf, p_u, p_d, p_su, p_sd, down, up + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6304, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6304, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_m); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6304, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6304, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 6304, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp_global = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":6309 + * cdef double ss, ss_a, ss_u, ss_d, K + * cdef int b, leaf_numb, i, s, s_0, s_1, S_size, j, max_size, size, subset, a, k + * K = 0 # <<<<<<<<<<<<<< + * + * cdef vector[int] S, len_s_star + */ + __pyx_v_K = 0.0; + + /* "cyext_acv.pyx":6312 + * + * cdef vector[int] S, len_s_star + * len_s_star = np.zeros((N), dtype=np.int) # <<<<<<<<<<<<<< + * + * cdef list power, va_id + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6312, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6312, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6312, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6312, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6312, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6312, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6312, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 6312, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6312, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = __pyx_convert_vector_from_py_int(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6312, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_len_s_star = __pyx_t_7; + + /* "cyext_acv.pyx":6316 + * cdef list power, va_id + * + * if C[0] != []: # <<<<<<<<<<<<<< + * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] + * va_id = [[i] for i in search_space if i not in remove_va] + */ + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 6316, __pyx_L1_error) + } + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyObject_RichCompare(PyList_GET_ITEM(__pyx_v_C, 0), __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6316, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 6316, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_8) { + + /* "cyext_acv.pyx":6317 + * + * if C[0] != []: + * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] # <<<<<<<<<<<<<< + * va_id = [[i] for i in search_space if i not in remove_va] + * for ci in range(len(C)): + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 6317, __pyx_L1_error) + } + __pyx_t_9 = PyList_GET_SIZE(__pyx_v_C); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6317, __pyx_L1_error) + __pyx_t_10 = __pyx_t_9; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { + __pyx_v_ci = __pyx_t_11; + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 6317, __pyx_L1_error) + } + __pyx_t_6 = PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci); + __Pyx_INCREF(__pyx_t_6); + __pyx_t_12 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6317, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_13 = __pyx_t_12; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_cj = __pyx_t_14; + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 6317, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_GetItemInt(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci), __pyx_v_cj, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 6317, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + } + __pyx_v_remove_va = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "cyext_acv.pyx":6318 + * if C[0] != []: + * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] + * va_id = [[i] for i in search_space if i not in remove_va] # <<<<<<<<<<<<<< + * for ci in range(len(C)): + * i = 0 + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6318, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__pyx_v_search_space == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 6318, __pyx_L1_error) + } + __pyx_t_6 = __pyx_v_search_space; __Pyx_INCREF(__pyx_t_6); __pyx_t_9 = 0; + for (;;) { + if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_6)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 6318, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6318, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6318, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_i = __pyx_t_15; + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6318, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_t_3, __pyx_v_remove_va, Py_NE)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 6318, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_16 = (__pyx_t_8 != 0); + if (__pyx_t_16) { + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6318, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6318, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __pyx_t_3 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 6318, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_va_id = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "cyext_acv.pyx":6319 + * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] + * va_id = [[i] for i in search_space if i not in remove_va] + * for ci in range(len(C)): # <<<<<<<<<<<<<< + * i = 0 + * for cj in range(len(C[ci])): + */ + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 6319, __pyx_L1_error) + } + __pyx_t_9 = PyList_GET_SIZE(__pyx_v_C); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6319, __pyx_L1_error) + __pyx_t_10 = __pyx_t_9; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { + __pyx_v_ci = __pyx_t_11; + + /* "cyext_acv.pyx":6320 + * va_id = [[i] for i in search_space if i not in remove_va] + * for ci in range(len(C)): + * i = 0 # <<<<<<<<<<<<<< + * for cj in range(len(C[ci])): + * if C[ci][cj] in search_space: + */ + __pyx_v_i = 0; + + /* "cyext_acv.pyx":6321 + * for ci in range(len(C)): + * i = 0 + * for cj in range(len(C[ci])): # <<<<<<<<<<<<<< + * if C[ci][cj] in search_space: + * i += 1 + */ + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 6321, __pyx_L1_error) + } + __pyx_t_1 = PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_12 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6321, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_13 = __pyx_t_12; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_cj = __pyx_t_14; + + /* "cyext_acv.pyx":6322 + * i = 0 + * for cj in range(len(C[ci])): + * if C[ci][cj] in search_space: # <<<<<<<<<<<<<< + * i += 1 + * break + */ + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 6322, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci), __pyx_v_cj, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_16 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_search_space, Py_EQ)); if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(0, 6322, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = (__pyx_t_16 != 0); + if (__pyx_t_8) { + + /* "cyext_acv.pyx":6323 + * for cj in range(len(C[ci])): + * if C[ci][cj] in search_space: + * i += 1 # <<<<<<<<<<<<<< + * break + * if i != 0: + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "cyext_acv.pyx":6324 + * if C[ci][cj] in search_space: + * i += 1 + * break # <<<<<<<<<<<<<< + * if i != 0: + * va_id += [C[ci]] + */ + goto __pyx_L14_break; + + /* "cyext_acv.pyx":6322 + * i = 0 + * for cj in range(len(C[ci])): + * if C[ci][cj] in search_space: # <<<<<<<<<<<<<< + * i += 1 + * break + */ + } + } + __pyx_L14_break:; + + /* "cyext_acv.pyx":6325 + * i += 1 + * break + * if i != 0: # <<<<<<<<<<<<<< + * va_id += [C[ci]] + * else: + */ + __pyx_t_8 = ((__pyx_v_i != 0) != 0); + if (__pyx_t_8) { + + /* "cyext_acv.pyx":6326 + * break + * if i != 0: + * va_id += [C[ci]] # <<<<<<<<<<<<<< + * else: + * va_id = [[i] for i in search_space] + */ + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 6326, __pyx_L1_error) + } + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci)); + __Pyx_GIVEREF(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci)); + PyList_SET_ITEM(__pyx_t_1, 0, PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci)); + __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_va_id, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_va_id, ((PyObject*)__pyx_t_6)); + __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6325 + * i += 1 + * break + * if i != 0: # <<<<<<<<<<<<<< + * va_id += [C[ci]] + * else: + */ + } + } + + /* "cyext_acv.pyx":6316 + * cdef list power, va_id + * + * if C[0] != []: # <<<<<<<<<<<<<< + * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] + * va_id = [[i] for i in search_space if i not in remove_va] + */ + goto __pyx_L3; + } + + /* "cyext_acv.pyx":6328 + * va_id += [C[ci]] + * else: + * va_id = [[i] for i in search_space] # <<<<<<<<<<<<<< + * + * m = len(va_id) + */ + /*else*/ { + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6328, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__pyx_v_search_space == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 6328, __pyx_L1_error) + } + __pyx_t_1 = __pyx_v_search_space; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0; + for (;;) { + if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 6328, __pyx_L1_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6328, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6328, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_i = __pyx_t_15; + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6328, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6328, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __pyx_t_2 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 6328, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_va_id = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + } + __pyx_L3:; + + /* "cyext_acv.pyx":6330 + * va_id = [[i] for i in search_space] + * + * m = len(va_id) # <<<<<<<<<<<<<< + * power = [] + * max_size = 0 + */ + __pyx_t_9 = PyList_GET_SIZE(__pyx_v_va_id); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6330, __pyx_L1_error) + __pyx_v_m = __pyx_t_9; + + /* "cyext_acv.pyx":6331 + * + * m = len(va_id) + * power = [] # <<<<<<<<<<<<<< + * max_size = 0 + * for size in range(m + 1): + */ + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6331, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_power = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6332 + * m = len(va_id) + * power = [] + * max_size = 0 # <<<<<<<<<<<<<< + * for size in range(m + 1): + * power_b = [] + */ + __pyx_v_max_size = 0; + + /* "cyext_acv.pyx":6333 + * power = [] + * max_size = 0 + * for size in range(m + 1): # <<<<<<<<<<<<<< + * power_b = [] + * for co in itertools.combinations(va_id, size): + */ + __pyx_t_17 = (__pyx_v_m + 1); + __pyx_t_18 = __pyx_t_17; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_18; __pyx_t_15+=1) { + __pyx_v_size = __pyx_t_15; + + /* "cyext_acv.pyx":6334 + * max_size = 0 + * for size in range(m + 1): + * power_b = [] # <<<<<<<<<<<<<< + * for co in itertools.combinations(va_id, size): + * power_b.append(np.array(sum(list(co),[]))) + */ + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6334, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_power_b, ((PyObject*)__pyx_t_6)); + __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6335 + * for size in range(m + 1): + * power_b = [] + * for co in itertools.combinations(va_id, size): # <<<<<<<<<<<<<< + * power_b.append(np.array(sum(list(co),[]))) + * max_size += 1 + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_itertools); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6335, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_combinations); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6335, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6335, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = NULL; + __pyx_t_19 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_19 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_va_id, __pyx_t_1}; + __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_19, 2+__pyx_t_19); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6335, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_va_id, __pyx_t_1}; + __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_19, 2+__pyx_t_19); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6335, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + { + __pyx_t_4 = PyTuple_New(2+__pyx_t_19); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6335, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__pyx_t_2) { + __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL; + } + __Pyx_INCREF(__pyx_v_va_id); + __Pyx_GIVEREF(__pyx_v_va_id); + PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_19, __pyx_v_va_id); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_19, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6335, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) { + __pyx_t_3 = __pyx_t_6; __Pyx_INCREF(__pyx_t_3); __pyx_t_9 = 0; + __pyx_t_20 = NULL; + } else { + __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6335, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_20 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 6335, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + for (;;) { + if (likely(!__pyx_t_20)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 6335, __pyx_L1_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6335, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } else { + if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 6335, __pyx_L1_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6335, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } + } else { + __pyx_t_6 = __pyx_t_20(__pyx_t_3); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 6335, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_co, __pyx_t_6); + __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6336 + * power_b = [] + * for co in itertools.combinations(va_id, size): + * power_b.append(np.array(sum(list(co),[]))) # <<<<<<<<<<<<<< + * max_size += 1 + * power.append(power_b) + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PySequence_List(__pyx_v_co); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_21 = PyTuple_New(2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 6336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_2); + __pyx_t_4 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __pyx_t_21 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_21)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_21); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_6 = (__pyx_t_21) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_21, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_22 = __Pyx_PyList_Append(__pyx_v_power_b, __pyx_t_6); if (unlikely(__pyx_t_22 == ((int)-1))) __PYX_ERR(0, 6336, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6337 + * for co in itertools.combinations(va_id, size): + * power_b.append(np.array(sum(list(co),[]))) + * max_size += 1 # <<<<<<<<<<<<<< + * power.append(power_b) + * if max_size >= 2**15: + */ + __pyx_v_max_size = (__pyx_v_max_size + 1); + + /* "cyext_acv.pyx":6335 + * for size in range(m + 1): + * power_b = [] + * for co in itertools.combinations(va_id, size): # <<<<<<<<<<<<<< + * power_b.append(np.array(sum(list(co),[]))) + * max_size += 1 + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "cyext_acv.pyx":6338 + * power_b.append(np.array(sum(list(co),[]))) + * max_size += 1 + * power.append(power_b) # <<<<<<<<<<<<<< + * if max_size >= 2**15: + * break + */ + __pyx_t_22 = __Pyx_PyList_Append(__pyx_v_power, __pyx_v_power_b); if (unlikely(__pyx_t_22 == ((int)-1))) __PYX_ERR(0, 6338, __pyx_L1_error) + + /* "cyext_acv.pyx":6339 + * max_size += 1 + * power.append(power_b) + * if max_size >= 2**15: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_8 = ((__pyx_v_max_size >= 0x8000) != 0); + if (__pyx_t_8) { + + /* "cyext_acv.pyx":6340 + * power.append(power_b) + * if max_size >= 2**15: + * break # <<<<<<<<<<<<<< + * + * cdef vector[vector[vector[long]]] power_cpp = power + */ + goto __pyx_L20_break; + + /* "cyext_acv.pyx":6339 + * max_size += 1 + * power.append(power_b) + * if max_size >= 2**15: # <<<<<<<<<<<<<< + * break + * + */ + } + } + __pyx_L20_break:; + + /* "cyext_acv.pyx":6342 + * break + * + * cdef vector[vector[vector[long]]] power_cpp = power # <<<<<<<<<<<<<< + * cdef long[:, :] s_star + * s_star = -1*np.ones((N, X.shape[1]), dtype=np.int) + */ + __pyx_t_23 = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_std_3a__3a_vector_3c_long_3e____3e___(__pyx_v_power); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6342, __pyx_L1_error) + __pyx_v_power_cpp = __pyx_t_23; + + /* "cyext_acv.pyx":6344 + * cdef vector[vector[vector[long]]] power_cpp = power + * cdef long[:, :] s_star + * s_star = -1*np.ones((N, X.shape[1]), dtype=np.int) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ones); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_X.shape[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); + __pyx_t_3 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 6344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_21) < 0) __PYX_ERR(0, 6344, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __pyx_t_21 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 6344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Multiply(__pyx_int_neg_1, __pyx_t_21); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __pyx_t_24 = __Pyx_PyObject_to_MemoryviewSlice_dsds_long(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_24.memview)) __PYX_ERR(0, 6344, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_s_star = __pyx_t_24; + __pyx_t_24.memview = NULL; + __pyx_t_24.data = NULL; + + /* "cyext_acv.pyx":6347 + * + * + * cdef long power_set_size = 2**m # <<<<<<<<<<<<<< + * S = np.zeros((data.shape[1]), dtype=np.int) + * + */ + __pyx_v_power_set_size = __Pyx_pow_long(2, ((long)__pyx_v_m)); + + /* "cyext_acv.pyx":6348 + * + * cdef long power_set_size = 2**m + * S = np.zeros((data.shape[1]), dtype=np.int) # <<<<<<<<<<<<<< + * + * cdef vector[vector[vector[long]]] sufficient = [[[-1]] for i in range(N)] + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6348, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 6348, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_data.shape[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6348, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6348, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6348, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6348, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6348, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 6348, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_21, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6348, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __pyx_convert_vector_from_py_int(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6348, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_S = __pyx_t_7; + + /* "cyext_acv.pyx":6350 + * S = np.zeros((data.shape[1]), dtype=np.int) + * + * cdef vector[vector[vector[long]]] sufficient = [[[-1]] for i in range(N)] # <<<<<<<<<<<<<< + * cdef vector[vector[double]] sufficient_sdp = [[-1] for i in range(N)] + * + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6350, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_25 = __pyx_v_N; + __pyx_t_26 = __pyx_t_25; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_26; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6350, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_neg_1); + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6350, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __pyx_t_2 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 6350, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_t_23 = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_std_3a__3a_vector_3c_long_3e____3e___(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6350, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_sufficient = __pyx_t_23; + + /* "cyext_acv.pyx":6351 + * + * cdef vector[vector[vector[long]]] sufficient = [[[-1]] for i in range(N)] + * cdef vector[vector[double]] sufficient_sdp = [[-1] for i in range(N)] # <<<<<<<<<<<<<< + * + * for s_0 in tqdm(range(minimal, m + 1)): + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6351, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_25 = __pyx_v_N; + __pyx_t_26 = __pyx_t_25; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_26; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6351, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_neg_1); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 6351, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_t_27 = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6351, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_sufficient_sdp = __pyx_t_27; + + /* "cyext_acv.pyx":6353 + * cdef vector[vector[double]] sufficient_sdp = [[-1] for i in range(N)] + * + * for s_0 in tqdm(range(minimal, m + 1)): # <<<<<<<<<<<<<< + * for s_1 in range(0, power_cpp[s_0].size()): + * for i in range(power_cpp[s_0][s_1].size()): + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_tqdm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_minimal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_21 = __Pyx_PyInt_From_long((__pyx_v_m + 1)); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 6353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_21); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_21); + __pyx_t_2 = 0; + __pyx_t_21 = 0; + __pyx_t_21 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_6, NULL); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 6353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_21) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_21); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0; + __pyx_t_20 = NULL; + } else { + __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_20 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 6353, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (likely(!__pyx_t_20)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 6353, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } else { + if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 6353, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } + } else { + __pyx_t_3 = __pyx_t_20(__pyx_t_1); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 6353, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6353, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_s_0 = __pyx_t_15; + + /* "cyext_acv.pyx":6354 + * + * for s_0 in tqdm(range(minimal, m + 1)): + * for s_1 in range(0, power_cpp[s_0].size()): # <<<<<<<<<<<<<< + * for i in range(power_cpp[s_0][s_1].size()): + * S[i] = power_cpp[s_0][s_1][i] + */ + __pyx_t_28 = (__pyx_v_power_cpp[__pyx_v_s_0]).size(); + __pyx_t_29 = __pyx_t_28; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_29; __pyx_t_15+=1) { + __pyx_v_s_1 = __pyx_t_15; + + /* "cyext_acv.pyx":6355 + * for s_0 in tqdm(range(minimal, m + 1)): + * for s_1 in range(0, power_cpp[s_0].size()): + * for i in range(power_cpp[s_0][s_1].size()): # <<<<<<<<<<<<<< + * S[i] = power_cpp[s_0][s_1][i] + * + */ + __pyx_t_30 = ((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1]).size(); + __pyx_t_31 = __pyx_t_30; + for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_31; __pyx_t_19+=1) { + __pyx_v_i = __pyx_t_19; + + /* "cyext_acv.pyx":6356 + * for s_1 in range(0, power_cpp[s_0].size()): + * for i in range(power_cpp[s_0][s_1].size()): + * S[i] = power_cpp[s_0][s_1][i] # <<<<<<<<<<<<<< + * + * S_size = power_cpp[s_0][s_1].size() + */ + (__pyx_v_S[__pyx_v_i]) = (((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1])[__pyx_v_i]); + } + + /* "cyext_acv.pyx":6358 + * S[i] = power_cpp[s_0][s_1][i] + * + * S_size = power_cpp[s_0][s_1].size() # <<<<<<<<<<<<<< + * sdp = compute_sdp_rf_same_set(X, y_X, data, y_data, S[:S_size], features, thresholds, children_left, + * children_right, max_depth, min_node_size, classifier, t) + */ + __pyx_v_S_size = ((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1]).size(); + + /* "cyext_acv.pyx":6359 + * + * S_size = power_cpp[s_0][s_1].size() + * sdp = compute_sdp_rf_same_set(X, y_X, data, y_data, S[:S_size], features, thresholds, children_left, # <<<<<<<<<<<<<< + * children_right, max_depth, min_node_size, classifier, t) + * + */ + __pyx_t_3 = __pyx_convert_vector_to_py_int(__pyx_v_S); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_21 = __Pyx_PyObject_GetSlice(__pyx_t_3, 0, __pyx_v_S_size, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 6359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = __pyx_convert_vector_from_py_int(__pyx_t_21); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6359, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + + /* "cyext_acv.pyx":6360 + * S_size = power_cpp[s_0][s_1].size() + * sdp = compute_sdp_rf_same_set(X, y_X, data, y_data, S[:S_size], features, thresholds, children_left, + * children_right, max_depth, min_node_size, classifier, t) # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_21 = __pyx_f_9cyext_acv_compute_sdp_rf_same_set(__pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_t_7, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, 0); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 6359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); + + /* "cyext_acv.pyx":6359 + * + * S_size = power_cpp[s_0][s_1].size() + * sdp = compute_sdp_rf_same_set(X, y_X, data, y_data, S[:S_size], features, thresholds, children_left, # <<<<<<<<<<<<<< + * children_right, max_depth, min_node_size, classifier, t) + * + */ + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_21, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 6359, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp, 1); + __pyx_v_sdp = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":6362 + * children_right, max_depth, min_node_size, classifier, t) + * + * for i in range(N): # <<<<<<<<<<<<<< + * if sdp[i] >= pi_level: + * subset = 0 + */ + __pyx_t_25 = __pyx_v_N; + __pyx_t_26 = __pyx_t_25; + for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_26; __pyx_t_19+=1) { + __pyx_v_i = __pyx_t_19; + + /* "cyext_acv.pyx":6363 + * + * for i in range(N): + * if sdp[i] >= pi_level: # <<<<<<<<<<<<<< + * subset = 0 + * for j in range(sufficient[i].size()): + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_8 = (((*((double *) ( /* dim=0 */ (__pyx_v_sdp.data + __pyx_t_32 * __pyx_v_sdp.strides[0]) ))) >= __pyx_v_pi_level) != 0); + if (__pyx_t_8) { + + /* "cyext_acv.pyx":6364 + * for i in range(N): + * if sdp[i] >= pi_level: + * subset = 0 # <<<<<<<<<<<<<< + * for j in range(sufficient[i].size()): + * a = 0 + */ + __pyx_v_subset = 0; + + /* "cyext_acv.pyx":6365 + * if sdp[i] >= pi_level: + * subset = 0 + * for j in range(sufficient[i].size()): # <<<<<<<<<<<<<< + * a = 0 + * for k in range(sufficient[i][j].size()): + */ + __pyx_t_33 = (__pyx_v_sufficient[__pyx_v_i]).size(); + __pyx_t_34 = __pyx_t_33; + for (__pyx_t_35 = 0; __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) { + __pyx_v_j = __pyx_t_35; + + /* "cyext_acv.pyx":6366 + * subset = 0 + * for j in range(sufficient[i].size()): + * a = 0 # <<<<<<<<<<<<<< + * for k in range(sufficient[i][j].size()): + * if std_find[vector[long].iterator, long](power_cpp[s_0][s_1].begin(), power_cpp[s_0][s_1].end(), sufficient[i][j][k]) != power_cpp[s_0][s_1].end(): + */ + __pyx_v_a = 0; + + /* "cyext_acv.pyx":6367 + * for j in range(sufficient[i].size()): + * a = 0 + * for k in range(sufficient[i][j].size()): # <<<<<<<<<<<<<< + * if std_find[vector[long].iterator, long](power_cpp[s_0][s_1].begin(), power_cpp[s_0][s_1].end(), sufficient[i][j][k]) != power_cpp[s_0][s_1].end(): + * a += 1 + */ + __pyx_t_30 = ((__pyx_v_sufficient[__pyx_v_i])[__pyx_v_j]).size(); + __pyx_t_31 = __pyx_t_30; + for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_31; __pyx_t_36+=1) { + __pyx_v_k = __pyx_t_36; + + /* "cyext_acv.pyx":6368 + * a = 0 + * for k in range(sufficient[i][j].size()): + * if std_find[vector[long].iterator, long](power_cpp[s_0][s_1].begin(), power_cpp[s_0][s_1].end(), sufficient[i][j][k]) != power_cpp[s_0][s_1].end(): # <<<<<<<<<<<<<< + * a += 1 + * if a == sufficient[i][j].size(): + */ + __pyx_t_8 = ((std::find ::iterator,long>(((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1]).begin(), ((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1]).end(), (((__pyx_v_sufficient[__pyx_v_i])[__pyx_v_j])[__pyx_v_k])) != ((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1]).end()) != 0); + if (__pyx_t_8) { + + /* "cyext_acv.pyx":6369 + * for k in range(sufficient[i][j].size()): + * if std_find[vector[long].iterator, long](power_cpp[s_0][s_1].begin(), power_cpp[s_0][s_1].end(), sufficient[i][j][k]) != power_cpp[s_0][s_1].end(): + * a += 1 # <<<<<<<<<<<<<< + * if a == sufficient[i][j].size(): + * subset = 1 + */ + __pyx_v_a = (__pyx_v_a + 1); + + /* "cyext_acv.pyx":6368 + * a = 0 + * for k in range(sufficient[i][j].size()): + * if std_find[vector[long].iterator, long](power_cpp[s_0][s_1].begin(), power_cpp[s_0][s_1].end(), sufficient[i][j][k]) != power_cpp[s_0][s_1].end(): # <<<<<<<<<<<<<< + * a += 1 + * if a == sufficient[i][j].size(): + */ + } + } + + /* "cyext_acv.pyx":6370 + * if std_find[vector[long].iterator, long](power_cpp[s_0][s_1].begin(), power_cpp[s_0][s_1].end(), sufficient[i][j][k]) != power_cpp[s_0][s_1].end(): + * a += 1 + * if a == sufficient[i][j].size(): # <<<<<<<<<<<<<< + * subset = 1 + * break + */ + __pyx_t_8 = ((__pyx_v_a == ((__pyx_v_sufficient[__pyx_v_i])[__pyx_v_j]).size()) != 0); + if (__pyx_t_8) { + + /* "cyext_acv.pyx":6371 + * a += 1 + * if a == sufficient[i][j].size(): + * subset = 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_subset = 1; + + /* "cyext_acv.pyx":6372 + * if a == sufficient[i][j].size(): + * subset = 1 + * break # <<<<<<<<<<<<<< + * + * if subset == 0: + */ + goto __pyx_L38_break; + + /* "cyext_acv.pyx":6370 + * if std_find[vector[long].iterator, long](power_cpp[s_0][s_1].begin(), power_cpp[s_0][s_1].end(), sufficient[i][j][k]) != power_cpp[s_0][s_1].end(): + * a += 1 + * if a == sufficient[i][j].size(): # <<<<<<<<<<<<<< + * subset = 1 + * break + */ + } + } + __pyx_L38_break:; + + /* "cyext_acv.pyx":6374 + * break + * + * if subset == 0: # <<<<<<<<<<<<<< + * sufficient[i].push_back(power_cpp[s_0][s_1]) + * sufficient_sdp[i].push_back(sdp[i]) + */ + __pyx_t_8 = ((__pyx_v_subset == 0) != 0); + if (__pyx_t_8) { + + /* "cyext_acv.pyx":6375 + * + * if subset == 0: + * sufficient[i].push_back(power_cpp[s_0][s_1]) # <<<<<<<<<<<<<< + * sufficient_sdp[i].push_back(sdp[i]) + * for s in range(S_size): + */ + try { + (__pyx_v_sufficient[__pyx_v_i]).push_back(((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1])); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 6375, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6376 + * if subset == 0: + * sufficient[i].push_back(power_cpp[s_0][s_1]) + * sufficient_sdp[i].push_back(sdp[i]) # <<<<<<<<<<<<<< + * for s in range(S_size): + * sdp_global[S[s]] += 1 + */ + __pyx_t_32 = __pyx_v_i; + try { + (__pyx_v_sufficient_sdp[__pyx_v_i]).push_back((*((double *) ( /* dim=0 */ (__pyx_v_sdp.data + __pyx_t_32 * __pyx_v_sdp.strides[0]) )))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 6376, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6377 + * sufficient[i].push_back(power_cpp[s_0][s_1]) + * sufficient_sdp[i].push_back(sdp[i]) + * for s in range(S_size): # <<<<<<<<<<<<<< + * sdp_global[S[s]] += 1 + * K += 1 + */ + __pyx_t_35 = __pyx_v_S_size; + __pyx_t_36 = __pyx_t_35; + for (__pyx_t_37 = 0; __pyx_t_37 < __pyx_t_36; __pyx_t_37+=1) { + __pyx_v_s = __pyx_t_37; + + /* "cyext_acv.pyx":6378 + * sufficient_sdp[i].push_back(sdp[i]) + * for s in range(S_size): + * sdp_global[S[s]] += 1 # <<<<<<<<<<<<<< + * K += 1 + * + */ + __pyx_t_32 = (__pyx_v_S[__pyx_v_s]); + *((double *) ( /* dim=0 */ (__pyx_v_sdp_global.data + __pyx_t_32 * __pyx_v_sdp_global.strides[0]) )) += 1.0; + } + + /* "cyext_acv.pyx":6379 + * for s in range(S_size): + * sdp_global[S[s]] += 1 + * K += 1 # <<<<<<<<<<<<<< + * + * return sufficient, sufficient_sdp, np.asarray(sdp_global)/K + */ + __pyx_v_K = (__pyx_v_K + 1.0); + + /* "cyext_acv.pyx":6374 + * break + * + * if subset == 0: # <<<<<<<<<<<<<< + * sufficient[i].push_back(power_cpp[s_0][s_1]) + * sufficient_sdp[i].push_back(sdp[i]) + */ + } + + /* "cyext_acv.pyx":6363 + * + * for i in range(N): + * if sdp[i] >= pi_level: # <<<<<<<<<<<<<< + * subset = 0 + * for j in range(sufficient[i].size()): + */ + } + } + } + + /* "cyext_acv.pyx":6353 + * cdef vector[vector[double]] sufficient_sdp = [[-1] for i in range(N)] + * + * for s_0 in tqdm(range(minimal, m + 1)): # <<<<<<<<<<<<<< + * for s_1 in range(0, power_cpp[s_0].size()): + * for i in range(power_cpp[s_0][s_1].size()): + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "cyext_acv.pyx":6381 + * K += 1 + * + * return sufficient, sufficient_sdp, np.asarray(sdp_global)/K # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_convert_vector_to_py_std_3a__3a_vector_3c_std_3a__3a_vector_3c_long_3e____3e___(__pyx_v_sufficient); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_21 = __pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___(__pyx_v_sufficient_sdp); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 6381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_sdp_global, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_K); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_21); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_21); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_6); + __pyx_t_1 = 0; + __pyx_t_21 = 0; + __pyx_t_6 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "cyext_acv.pyx":6293 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef sufficient_expl_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * int max_depth, int min_node_size, int & classifier, double[:, :] & t, list C, double pi_level, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_21); + __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1); + __Pyx_AddTraceback("cyext_acv.sufficient_expl_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp_global, 1); + __Pyx_XDECREF(__pyx_v_power); + __Pyx_XDECREF(__pyx_v_va_id); + __Pyx_XDECREF(__pyx_v_remove_va); + __Pyx_XDECREF(__pyx_v_power_b); + __Pyx_XDECREF(__pyx_v_co); + __PYX_XDEC_MEMVIEW(&__pyx_v_s_star, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_9cyext_acv_103sufficient_expl_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_9cyext_acv_103sufficient_expl_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_features = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_thresholds = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_left = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_right = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_max_depth; + int __pyx_v_min_node_size; + int __pyx_v_classifier; + __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_C = 0; + double __pyx_v_pi_level; + int __pyx_v_minimal; + int __pyx_v_stop; + PyObject *__pyx_v_search_space = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sufficient_expl_rf (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_y_X,&__pyx_n_s_data,&__pyx_n_s_y_data,&__pyx_n_s_features,&__pyx_n_s_thresholds,&__pyx_n_s_children_left,&__pyx_n_s_children_right,&__pyx_n_s_max_depth,&__pyx_n_s_min_node_size,&__pyx_n_s_classifier,&__pyx_n_s_t,&__pyx_n_s_C,&__pyx_n_s_pi_level,&__pyx_n_s_minimal,&__pyx_n_s_stop,&__pyx_n_s_search_space,0}; + PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16); + CYTHON_FALLTHROUGH; + case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15); + CYTHON_FALLTHROUGH; + case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_X)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, 1); __PYX_ERR(0, 6293, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, 2); __PYX_ERR(0, 6293, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, 3); __PYX_ERR(0, 6293, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_features)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, 4); __PYX_ERR(0, 6293, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thresholds)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, 5); __PYX_ERR(0, 6293, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_left)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, 6); __PYX_ERR(0, 6293, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, 7); __PYX_ERR(0, 6293, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, 8); __PYX_ERR(0, 6293, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_node_size)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, 9); __PYX_ERR(0, 6293, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classifier)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, 10); __PYX_ERR(0, 6293, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, 11); __PYX_ERR(0, 6293, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, 12); __PYX_ERR(0, 6293, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 13: + if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pi_level)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, 13); __PYX_ERR(0, 6293, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 14: + if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minimal)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, 14); __PYX_ERR(0, 6293, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 15: + if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, 15); __PYX_ERR(0, 6293, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 16: + if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_search_space)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, 16); __PYX_ERR(0, 6293, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sufficient_expl_rf") < 0)) __PYX_ERR(0, 6293, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 17) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + values[15] = PyTuple_GET_ITEM(__pyx_args, 15); + values[16] = PyTuple_GET_ITEM(__pyx_args, 16); + } + __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 6293, __pyx_L3_error) + __pyx_v_y_X = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_X.memview)) __PYX_ERR(0, 6293, __pyx_L3_error) + __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 6293, __pyx_L3_error) + __pyx_v_y_data = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_data.memview)) __PYX_ERR(0, 6293, __pyx_L3_error) + __pyx_v_features = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_features.memview)) __PYX_ERR(0, 6294, __pyx_L3_error) + __pyx_v_thresholds = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_thresholds.memview)) __PYX_ERR(0, 6294, __pyx_L3_error) + __pyx_v_children_left = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_left.memview)) __PYX_ERR(0, 6294, __pyx_L3_error) + __pyx_v_children_right = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_right.memview)) __PYX_ERR(0, 6294, __pyx_L3_error) + __pyx_v_max_depth = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6295, __pyx_L3_error) + __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6295, __pyx_L3_error) + __pyx_v_classifier = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6295, __pyx_L3_error) + __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[11], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 6295, __pyx_L3_error) + __pyx_v_C = ((PyObject*)values[12]); + __pyx_v_pi_level = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_pi_level == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 6295, __pyx_L3_error) + __pyx_v_minimal = __Pyx_PyInt_As_int(values[14]); if (unlikely((__pyx_v_minimal == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6296, __pyx_L3_error) + __pyx_v_stop = __Pyx_PyObject_IsTrue(values[15]); if (unlikely((__pyx_v_stop == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6296, __pyx_L3_error) + __pyx_v_search_space = ((PyObject*)values[16]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6293, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cyext_acv.sufficient_expl_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_C), (&PyList_Type), 1, "C", 1))) __PYX_ERR(0, 6295, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_search_space), (&PyList_Type), 1, "search_space", 1))) __PYX_ERR(0, 6296, __pyx_L1_error) + __pyx_r = __pyx_pf_9cyext_acv_102sufficient_expl_rf(__pyx_self, __pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_v_C, __pyx_v_pi_level, __pyx_v_minimal, __pyx_v_stop, __pyx_v_search_space); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9cyext_acv_102sufficient_expl_rf(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t, PyObject *__pyx_v_C, double __pyx_v_pi_level, int __pyx_v_minimal, int __pyx_v_stop, PyObject *__pyx_v_search_space) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sufficient_expl_rf", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundLocalError("X"); __PYX_ERR(0, 6293, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_X.memview)) { __Pyx_RaiseUnboundLocalError("y_X"); __PYX_ERR(0, 6293, __pyx_L1_error) } + if (unlikely(!__pyx_v_data.memview)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 6293, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_data.memview)) { __Pyx_RaiseUnboundLocalError("y_data"); __PYX_ERR(0, 6293, __pyx_L1_error) } + if (unlikely(!__pyx_v_features.memview)) { __Pyx_RaiseUnboundLocalError("features"); __PYX_ERR(0, 6293, __pyx_L1_error) } + if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 6293, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 6293, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 6293, __pyx_L1_error) } + if (unlikely(!__pyx_v_t.memview)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 6293, __pyx_L1_error) } + __pyx_t_1 = __pyx_f_9cyext_acv_sufficient_expl_rf(__pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_v_C, __pyx_v_pi_level, __pyx_v_minimal, __pyx_v_stop, __pyx_v_search_space, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cyext_acv.sufficient_expl_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_features, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_thresholds, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_left, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_right, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_t, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cyext_acv.pyx":6388 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef sufficient_cxpl_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * int max_depth, int min_node_size, int & classifier, double[:, :] & t, list C, double pi_level, + */ + +static PyObject *__pyx_pw_9cyext_acv_105sufficient_cxpl_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_sufficient_cxpl_rf(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, PyObject *__pyx_v_C, double __pyx_v_pi_level, int __pyx_v_minimal, CYTHON_UNUSED int __pyx_v_stop, PyObject *__pyx_v_search_space, CYTHON_UNUSED int __pyx_skip_dispatch) { + unsigned int __pyx_v_N; + unsigned int __pyx_v_m; + __Pyx_memviewslice __pyx_v_sdp = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_sdp_global = { 0, 0, { 0 }, { 0 }, { 0 } }; + double __pyx_v_K; + int __pyx_v_i; + int __pyx_v_s; + int __pyx_v_s_0; + int __pyx_v_s_1; + int __pyx_v_S_size; + int __pyx_v_j; + int __pyx_v_max_size; + int __pyx_v_size; + int __pyx_v_subset; + int __pyx_v_a; + int __pyx_v_k; + std::vector __pyx_v_S; + CYTHON_UNUSED std::vector __pyx_v_len_s_star; + PyObject *__pyx_v_power = 0; + PyObject *__pyx_v_va_id = 0; + PyObject *__pyx_v_remove_va = NULL; + Py_ssize_t __pyx_v_ci; + Py_ssize_t __pyx_v_cj; + PyObject *__pyx_v_power_b = NULL; + PyObject *__pyx_v_co = NULL; + std::vector > > __pyx_v_power_cpp; + CYTHON_UNUSED __Pyx_memviewslice __pyx_v_s_star = { 0, 0, { 0 }, { 0 }, { 0 } }; + CYTHON_UNUSED long __pyx_v_power_set_size; + std::vector > > __pyx_v_sufficient; + std::vector > __pyx_v_sufficient_sdp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_t_6 = NULL; + std::vector __pyx_t_7; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + long __pyx_t_17; + long __pyx_t_18; + int __pyx_t_19; + PyObject *(*__pyx_t_20)(PyObject *); + PyObject *__pyx_t_21 = NULL; + int __pyx_t_22; + std::vector > > __pyx_t_23; + __Pyx_memviewslice __pyx_t_24 = { 0, 0, { 0 }, { 0 }, { 0 } }; + unsigned int __pyx_t_25; + unsigned int __pyx_t_26; + std::vector > __pyx_t_27; + std::vector > ::size_type __pyx_t_28; + std::vector > ::size_type __pyx_t_29; + std::vector ::size_type __pyx_t_30; + std::vector ::size_type __pyx_t_31; + Py_ssize_t __pyx_t_32; + std::vector > ::size_type __pyx_t_33; + std::vector > ::size_type __pyx_t_34; + int __pyx_t_35; + int __pyx_t_36; + int __pyx_t_37; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sufficient_cxpl_rf", 0); + + /* "cyext_acv.pyx":6393 + * int minimal, bint stop, list search_space): + * + * cdef unsigned int N = X.shape[0] # <<<<<<<<<<<<<< + * cdef unsigned int m = X.shape[1] + * + */ + __pyx_v_N = (__pyx_v_X.shape[0]); + + /* "cyext_acv.pyx":6394 + * + * cdef unsigned int N = X.shape[0] + * cdef unsigned int m = X.shape[1] # <<<<<<<<<<<<<< + * + * cdef double[:] sdp, sdp_b, sdp_ba + */ + __pyx_v_m = (__pyx_v_X.shape[1]); + + /* "cyext_acv.pyx":6398 + * cdef double[:] sdp, sdp_b, sdp_ba + * cdef double[:] sdp_global + * sdp = np.zeros((N)) # <<<<<<<<<<<<<< + * sdp_global = np.zeros((m)) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6398, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6398, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6398, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6398, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 6398, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":6399 + * cdef double[:] sdp_global + * sdp = np.zeros((N)) + * sdp_global = np.zeros((m)) # <<<<<<<<<<<<<< + * + * cdef unsigned int it, it_s, a_it, b_it, o_all, p, p_s, nb_leaf, p_u, p_d, p_su, p_sd, down, up + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_m); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 6399, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp_global = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":6404 + * cdef double ss, ss_a, ss_u, ss_d, K + * cdef int b, leaf_numb, i, s, s_0, s_1, S_size, j, max_size, size, subset, a, k + * K = 0 # <<<<<<<<<<<<<< + * + * cdef vector[int] S, len_s_star + */ + __pyx_v_K = 0.0; + + /* "cyext_acv.pyx":6407 + * + * cdef vector[int] S, len_s_star + * len_s_star = np.zeros((N), dtype=np.int) # <<<<<<<<<<<<<< + * + * cdef list power, va_id + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 6407, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = __pyx_convert_vector_from_py_int(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6407, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_len_s_star = __pyx_t_7; + + /* "cyext_acv.pyx":6411 + * cdef list power, va_id + * + * if C[0] != []: # <<<<<<<<<<<<<< + * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] + * va_id = [[i] for i in search_space if i not in remove_va] + */ + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 6411, __pyx_L1_error) + } + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6411, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyObject_RichCompare(PyList_GET_ITEM(__pyx_v_C, 0), __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6411, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 6411, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_8) { + + /* "cyext_acv.pyx":6412 + * + * if C[0] != []: + * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] # <<<<<<<<<<<<<< + * va_id = [[i] for i in search_space if i not in remove_va] + * for ci in range(len(C)): + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6412, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 6412, __pyx_L1_error) + } + __pyx_t_9 = PyList_GET_SIZE(__pyx_v_C); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6412, __pyx_L1_error) + __pyx_t_10 = __pyx_t_9; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { + __pyx_v_ci = __pyx_t_11; + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 6412, __pyx_L1_error) + } + __pyx_t_6 = PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci); + __Pyx_INCREF(__pyx_t_6); + __pyx_t_12 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6412, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_13 = __pyx_t_12; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_cj = __pyx_t_14; + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 6412, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_GetItemInt(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci), __pyx_v_cj, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6412, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 6412, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + } + __pyx_v_remove_va = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "cyext_acv.pyx":6413 + * if C[0] != []: + * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] + * va_id = [[i] for i in search_space if i not in remove_va] # <<<<<<<<<<<<<< + * for ci in range(len(C)): + * i = 0 + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__pyx_v_search_space == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 6413, __pyx_L1_error) + } + __pyx_t_6 = __pyx_v_search_space; __Pyx_INCREF(__pyx_t_6); __pyx_t_9 = 0; + for (;;) { + if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_6)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 6413, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6413, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_i = __pyx_t_15; + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_t_3, __pyx_v_remove_va, Py_NE)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 6413, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_16 = (__pyx_t_8 != 0); + if (__pyx_t_16) { + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __pyx_t_3 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 6413, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_va_id = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "cyext_acv.pyx":6414 + * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] + * va_id = [[i] for i in search_space if i not in remove_va] + * for ci in range(len(C)): # <<<<<<<<<<<<<< + * i = 0 + * for cj in range(len(C[ci])): + */ + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 6414, __pyx_L1_error) + } + __pyx_t_9 = PyList_GET_SIZE(__pyx_v_C); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6414, __pyx_L1_error) + __pyx_t_10 = __pyx_t_9; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { + __pyx_v_ci = __pyx_t_11; + + /* "cyext_acv.pyx":6415 + * va_id = [[i] for i in search_space if i not in remove_va] + * for ci in range(len(C)): + * i = 0 # <<<<<<<<<<<<<< + * for cj in range(len(C[ci])): + * if C[ci][cj] in search_space: + */ + __pyx_v_i = 0; + + /* "cyext_acv.pyx":6416 + * for ci in range(len(C)): + * i = 0 + * for cj in range(len(C[ci])): # <<<<<<<<<<<<<< + * if C[ci][cj] in search_space: + * i += 1 + */ + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 6416, __pyx_L1_error) + } + __pyx_t_1 = PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_12 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6416, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_13 = __pyx_t_12; + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_cj = __pyx_t_14; + + /* "cyext_acv.pyx":6417 + * i = 0 + * for cj in range(len(C[ci])): + * if C[ci][cj] in search_space: # <<<<<<<<<<<<<< + * i += 1 + * break + */ + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 6417, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci), __pyx_v_cj, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6417, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_16 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_search_space, Py_EQ)); if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(0, 6417, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = (__pyx_t_16 != 0); + if (__pyx_t_8) { + + /* "cyext_acv.pyx":6418 + * for cj in range(len(C[ci])): + * if C[ci][cj] in search_space: + * i += 1 # <<<<<<<<<<<<<< + * break + * if i != 0: + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "cyext_acv.pyx":6419 + * if C[ci][cj] in search_space: + * i += 1 + * break # <<<<<<<<<<<<<< + * if i != 0: + * va_id += [C[ci]] + */ + goto __pyx_L14_break; + + /* "cyext_acv.pyx":6417 + * i = 0 + * for cj in range(len(C[ci])): + * if C[ci][cj] in search_space: # <<<<<<<<<<<<<< + * i += 1 + * break + */ + } + } + __pyx_L14_break:; + + /* "cyext_acv.pyx":6420 + * i += 1 + * break + * if i != 0: # <<<<<<<<<<<<<< + * va_id += [C[ci]] + * else: + */ + __pyx_t_8 = ((__pyx_v_i != 0) != 0); + if (__pyx_t_8) { + + /* "cyext_acv.pyx":6421 + * break + * if i != 0: + * va_id += [C[ci]] # <<<<<<<<<<<<<< + * else: + * va_id = [[i] for i in search_space] + */ + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 6421, __pyx_L1_error) + } + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6421, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci)); + __Pyx_GIVEREF(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci)); + PyList_SET_ITEM(__pyx_t_1, 0, PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci)); + __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_va_id, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6421, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_va_id, ((PyObject*)__pyx_t_6)); + __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6420 + * i += 1 + * break + * if i != 0: # <<<<<<<<<<<<<< + * va_id += [C[ci]] + * else: + */ + } + } + + /* "cyext_acv.pyx":6411 + * cdef list power, va_id + * + * if C[0] != []: # <<<<<<<<<<<<<< + * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] + * va_id = [[i] for i in search_space if i not in remove_va] + */ + goto __pyx_L3; + } + + /* "cyext_acv.pyx":6423 + * va_id += [C[ci]] + * else: + * va_id = [[i] for i in search_space] # <<<<<<<<<<<<<< + * + * m = len(va_id) + */ + /*else*/ { + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6423, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__pyx_v_search_space == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 6423, __pyx_L1_error) + } + __pyx_t_1 = __pyx_v_search_space; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0; + for (;;) { + if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 6423, __pyx_L1_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6423, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6423, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_i = __pyx_t_15; + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6423, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6423, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __pyx_t_2 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 6423, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_va_id = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + } + __pyx_L3:; + + /* "cyext_acv.pyx":6425 + * va_id = [[i] for i in search_space] + * + * m = len(va_id) # <<<<<<<<<<<<<< + * power = [] + * max_size = 0 + */ + __pyx_t_9 = PyList_GET_SIZE(__pyx_v_va_id); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6425, __pyx_L1_error) + __pyx_v_m = __pyx_t_9; + + /* "cyext_acv.pyx":6426 + * + * m = len(va_id) + * power = [] # <<<<<<<<<<<<<< + * max_size = 0 + * for size in range(m + 1): + */ + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6426, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_power = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6427 + * m = len(va_id) + * power = [] + * max_size = 0 # <<<<<<<<<<<<<< + * for size in range(m + 1): + * power_b = [] + */ + __pyx_v_max_size = 0; + + /* "cyext_acv.pyx":6428 + * power = [] + * max_size = 0 + * for size in range(m + 1): # <<<<<<<<<<<<<< + * power_b = [] + * for co in itertools.combinations(va_id, size): + */ + __pyx_t_17 = (__pyx_v_m + 1); + __pyx_t_18 = __pyx_t_17; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_18; __pyx_t_15+=1) { + __pyx_v_size = __pyx_t_15; + + /* "cyext_acv.pyx":6429 + * max_size = 0 + * for size in range(m + 1): + * power_b = [] # <<<<<<<<<<<<<< + * for co in itertools.combinations(va_id, size): + * power_b.append(np.array(sum(list(co),[]))) + */ + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6429, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_power_b, ((PyObject*)__pyx_t_6)); + __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6430 + * for size in range(m + 1): + * power_b = [] + * for co in itertools.combinations(va_id, size): # <<<<<<<<<<<<<< + * power_b.append(np.array(sum(list(co),[]))) + * max_size += 1 + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_itertools); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_combinations); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = NULL; + __pyx_t_19 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_19 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_va_id, __pyx_t_1}; + __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_19, 2+__pyx_t_19); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6430, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_va_id, __pyx_t_1}; + __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_19, 2+__pyx_t_19); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6430, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + { + __pyx_t_4 = PyTuple_New(2+__pyx_t_19); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__pyx_t_2) { + __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL; + } + __Pyx_INCREF(__pyx_v_va_id); + __Pyx_GIVEREF(__pyx_v_va_id); + PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_19, __pyx_v_va_id); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_19, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) { + __pyx_t_3 = __pyx_t_6; __Pyx_INCREF(__pyx_t_3); __pyx_t_9 = 0; + __pyx_t_20 = NULL; + } else { + __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_20 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 6430, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + for (;;) { + if (likely(!__pyx_t_20)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 6430, __pyx_L1_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } else { + if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 6430, __pyx_L1_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } + } else { + __pyx_t_6 = __pyx_t_20(__pyx_t_3); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 6430, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_co, __pyx_t_6); + __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6431 + * power_b = [] + * for co in itertools.combinations(va_id, size): + * power_b.append(np.array(sum(list(co),[]))) # <<<<<<<<<<<<<< + * max_size += 1 + * power.append(power_b) + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PySequence_List(__pyx_v_co); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_21 = PyTuple_New(2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 6431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_2); + __pyx_t_4 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __pyx_t_21 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_21)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_21); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_6 = (__pyx_t_21) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_21, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_22 = __Pyx_PyList_Append(__pyx_v_power_b, __pyx_t_6); if (unlikely(__pyx_t_22 == ((int)-1))) __PYX_ERR(0, 6431, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6432 + * for co in itertools.combinations(va_id, size): + * power_b.append(np.array(sum(list(co),[]))) + * max_size += 1 # <<<<<<<<<<<<<< + * power.append(power_b) + * if max_size >= 2**15: + */ + __pyx_v_max_size = (__pyx_v_max_size + 1); + + /* "cyext_acv.pyx":6430 + * for size in range(m + 1): + * power_b = [] + * for co in itertools.combinations(va_id, size): # <<<<<<<<<<<<<< + * power_b.append(np.array(sum(list(co),[]))) + * max_size += 1 + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "cyext_acv.pyx":6433 + * power_b.append(np.array(sum(list(co),[]))) + * max_size += 1 + * power.append(power_b) # <<<<<<<<<<<<<< + * if max_size >= 2**15: + * break + */ + __pyx_t_22 = __Pyx_PyList_Append(__pyx_v_power, __pyx_v_power_b); if (unlikely(__pyx_t_22 == ((int)-1))) __PYX_ERR(0, 6433, __pyx_L1_error) + + /* "cyext_acv.pyx":6434 + * max_size += 1 + * power.append(power_b) + * if max_size >= 2**15: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_8 = ((__pyx_v_max_size >= 0x8000) != 0); + if (__pyx_t_8) { + + /* "cyext_acv.pyx":6435 + * power.append(power_b) + * if max_size >= 2**15: + * break # <<<<<<<<<<<<<< + * + * cdef vector[vector[vector[long]]] power_cpp = power + */ + goto __pyx_L20_break; + + /* "cyext_acv.pyx":6434 + * max_size += 1 + * power.append(power_b) + * if max_size >= 2**15: # <<<<<<<<<<<<<< + * break + * + */ + } + } + __pyx_L20_break:; + + /* "cyext_acv.pyx":6437 + * break + * + * cdef vector[vector[vector[long]]] power_cpp = power # <<<<<<<<<<<<<< + * cdef long[:, :] s_star + * s_star = -1*np.ones((N, X.shape[1]), dtype=np.int) + */ + __pyx_t_23 = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_std_3a__3a_vector_3c_long_3e____3e___(__pyx_v_power); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6437, __pyx_L1_error) + __pyx_v_power_cpp = __pyx_t_23; + + /* "cyext_acv.pyx":6439 + * cdef vector[vector[vector[long]]] power_cpp = power + * cdef long[:, :] s_star + * s_star = -1*np.ones((N, X.shape[1]), dtype=np.int) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ones); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_X.shape[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); + __pyx_t_3 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 6439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_21) < 0) __PYX_ERR(0, 6439, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __pyx_t_21 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 6439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Multiply(__pyx_int_neg_1, __pyx_t_21); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __pyx_t_24 = __Pyx_PyObject_to_MemoryviewSlice_dsds_long(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_24.memview)) __PYX_ERR(0, 6439, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_s_star = __pyx_t_24; + __pyx_t_24.memview = NULL; + __pyx_t_24.data = NULL; + + /* "cyext_acv.pyx":6442 + * + * + * cdef long power_set_size = 2**m # <<<<<<<<<<<<<< + * S = np.zeros((data.shape[1]), dtype=np.int) + * + */ + __pyx_v_power_set_size = __Pyx_pow_long(2, ((long)__pyx_v_m)); + + /* "cyext_acv.pyx":6443 + * + * cdef long power_set_size = 2**m + * S = np.zeros((data.shape[1]), dtype=np.int) # <<<<<<<<<<<<<< + * + * cdef vector[vector[vector[long]]] sufficient = [[[-1]] for i in range(N)] + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 6443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_data.shape[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 6443, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_21, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __pyx_convert_vector_from_py_int(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6443, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_S = __pyx_t_7; + + /* "cyext_acv.pyx":6445 + * S = np.zeros((data.shape[1]), dtype=np.int) + * + * cdef vector[vector[vector[long]]] sufficient = [[[-1]] for i in range(N)] # <<<<<<<<<<<<<< + * cdef vector[vector[double]] sufficient_sdp = [[-1] for i in range(N)] + * + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_25 = __pyx_v_N; + __pyx_t_26 = __pyx_t_25; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_26; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_neg_1); + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __pyx_t_2 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 6445, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_t_23 = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_std_3a__3a_vector_3c_long_3e____3e___(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6445, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_sufficient = __pyx_t_23; + + /* "cyext_acv.pyx":6446 + * + * cdef vector[vector[vector[long]]] sufficient = [[[-1]] for i in range(N)] + * cdef vector[vector[double]] sufficient_sdp = [[-1] for i in range(N)] # <<<<<<<<<<<<<< + * + * for s_0 in tqdm(range(minimal, m + 1)): + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6446, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_25 = __pyx_v_N; + __pyx_t_26 = __pyx_t_25; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_26; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6446, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_neg_1); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 6446, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_t_27 = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6446, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_sufficient_sdp = __pyx_t_27; + + /* "cyext_acv.pyx":6448 + * cdef vector[vector[double]] sufficient_sdp = [[-1] for i in range(N)] + * + * for s_0 in tqdm(range(minimal, m + 1)): # <<<<<<<<<<<<<< + * for s_1 in range(0, power_cpp[s_0].size()): + * for i in range(power_cpp[s_0][s_1].size()): + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_tqdm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_minimal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_21 = __Pyx_PyInt_From_long((__pyx_v_m + 1)); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 6448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_21); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_21); + __pyx_t_2 = 0; + __pyx_t_21 = 0; + __pyx_t_21 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_6, NULL); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 6448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_21) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_21); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0; + __pyx_t_20 = NULL; + } else { + __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_20 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 6448, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (likely(!__pyx_t_20)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 6448, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } else { + if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 6448, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } + } else { + __pyx_t_3 = __pyx_t_20(__pyx_t_1); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 6448, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6448, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_s_0 = __pyx_t_15; + + /* "cyext_acv.pyx":6449 + * + * for s_0 in tqdm(range(minimal, m + 1)): + * for s_1 in range(0, power_cpp[s_0].size()): # <<<<<<<<<<<<<< + * for i in range(power_cpp[s_0][s_1].size()): + * S[i] = power_cpp[s_0][s_1][i] + */ + __pyx_t_28 = (__pyx_v_power_cpp[__pyx_v_s_0]).size(); + __pyx_t_29 = __pyx_t_28; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_29; __pyx_t_15+=1) { + __pyx_v_s_1 = __pyx_t_15; + + /* "cyext_acv.pyx":6450 + * for s_0 in tqdm(range(minimal, m + 1)): + * for s_1 in range(0, power_cpp[s_0].size()): + * for i in range(power_cpp[s_0][s_1].size()): # <<<<<<<<<<<<<< + * S[i] = power_cpp[s_0][s_1][i] + * + */ + __pyx_t_30 = ((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1]).size(); + __pyx_t_31 = __pyx_t_30; + for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_31; __pyx_t_19+=1) { + __pyx_v_i = __pyx_t_19; + + /* "cyext_acv.pyx":6451 + * for s_1 in range(0, power_cpp[s_0].size()): + * for i in range(power_cpp[s_0][s_1].size()): + * S[i] = power_cpp[s_0][s_1][i] # <<<<<<<<<<<<<< + * + * S_size = power_cpp[s_0][s_1].size() + */ + (__pyx_v_S[__pyx_v_i]) = (((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1])[__pyx_v_i]); + } + + /* "cyext_acv.pyx":6453 + * S[i] = power_cpp[s_0][s_1][i] + * + * S_size = power_cpp[s_0][s_1].size() # <<<<<<<<<<<<<< + * sdp = compute_ddp_rf_same_set(X, y_X, data, y_data, S[:S_size], features, thresholds, children_left, + * children_right, max_depth, min_node_size, classifier, t) + */ + __pyx_v_S_size = ((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1]).size(); + + /* "cyext_acv.pyx":6454 + * + * S_size = power_cpp[s_0][s_1].size() + * sdp = compute_ddp_rf_same_set(X, y_X, data, y_data, S[:S_size], features, thresholds, children_left, # <<<<<<<<<<<<<< + * children_right, max_depth, min_node_size, classifier, t) + * + */ + __pyx_t_3 = __pyx_convert_vector_to_py_int(__pyx_v_S); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6454, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_21 = __Pyx_PyObject_GetSlice(__pyx_t_3, 0, __pyx_v_S_size, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 6454, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = __pyx_convert_vector_from_py_int(__pyx_t_21); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6454, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + + /* "cyext_acv.pyx":6455 + * S_size = power_cpp[s_0][s_1].size() + * sdp = compute_ddp_rf_same_set(X, y_X, data, y_data, S[:S_size], features, thresholds, children_left, + * children_right, max_depth, min_node_size, classifier, t) # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_21 = __pyx_f_9cyext_acv_compute_ddp_rf_same_set(__pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_t_7, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, 0); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 6454, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); + + /* "cyext_acv.pyx":6454 + * + * S_size = power_cpp[s_0][s_1].size() + * sdp = compute_ddp_rf_same_set(X, y_X, data, y_data, S[:S_size], features, thresholds, children_left, # <<<<<<<<<<<<<< + * children_right, max_depth, min_node_size, classifier, t) + * + */ + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_21, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 6454, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp, 1); + __pyx_v_sdp = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":6457 + * children_right, max_depth, min_node_size, classifier, t) + * + * for i in range(N): # <<<<<<<<<<<<<< + * if sdp[i] >= pi_level: + * subset = 0 + */ + __pyx_t_25 = __pyx_v_N; + __pyx_t_26 = __pyx_t_25; + for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_26; __pyx_t_19+=1) { + __pyx_v_i = __pyx_t_19; + + /* "cyext_acv.pyx":6458 + * + * for i in range(N): + * if sdp[i] >= pi_level: # <<<<<<<<<<<<<< + * subset = 0 + * for j in range(sufficient[i].size()): + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_8 = (((*((double *) ( /* dim=0 */ (__pyx_v_sdp.data + __pyx_t_32 * __pyx_v_sdp.strides[0]) ))) >= __pyx_v_pi_level) != 0); + if (__pyx_t_8) { + + /* "cyext_acv.pyx":6459 + * for i in range(N): + * if sdp[i] >= pi_level: + * subset = 0 # <<<<<<<<<<<<<< + * for j in range(sufficient[i].size()): + * a = 0 + */ + __pyx_v_subset = 0; + + /* "cyext_acv.pyx":6460 + * if sdp[i] >= pi_level: + * subset = 0 + * for j in range(sufficient[i].size()): # <<<<<<<<<<<<<< + * a = 0 + * for k in range(sufficient[i][j].size()): + */ + __pyx_t_33 = (__pyx_v_sufficient[__pyx_v_i]).size(); + __pyx_t_34 = __pyx_t_33; + for (__pyx_t_35 = 0; __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) { + __pyx_v_j = __pyx_t_35; + + /* "cyext_acv.pyx":6461 + * subset = 0 + * for j in range(sufficient[i].size()): + * a = 0 # <<<<<<<<<<<<<< + * for k in range(sufficient[i][j].size()): + * if std_find[vector[long].iterator, long](power_cpp[s_0][s_1].begin(), power_cpp[s_0][s_1].end(), sufficient[i][j][k]) != power_cpp[s_0][s_1].end(): + */ + __pyx_v_a = 0; + + /* "cyext_acv.pyx":6462 + * for j in range(sufficient[i].size()): + * a = 0 + * for k in range(sufficient[i][j].size()): # <<<<<<<<<<<<<< + * if std_find[vector[long].iterator, long](power_cpp[s_0][s_1].begin(), power_cpp[s_0][s_1].end(), sufficient[i][j][k]) != power_cpp[s_0][s_1].end(): + * a += 1 + */ + __pyx_t_30 = ((__pyx_v_sufficient[__pyx_v_i])[__pyx_v_j]).size(); + __pyx_t_31 = __pyx_t_30; + for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_31; __pyx_t_36+=1) { + __pyx_v_k = __pyx_t_36; + + /* "cyext_acv.pyx":6463 + * a = 0 + * for k in range(sufficient[i][j].size()): + * if std_find[vector[long].iterator, long](power_cpp[s_0][s_1].begin(), power_cpp[s_0][s_1].end(), sufficient[i][j][k]) != power_cpp[s_0][s_1].end(): # <<<<<<<<<<<<<< + * a += 1 + * if a == sufficient[i][j].size(): + */ + __pyx_t_8 = ((std::find ::iterator,long>(((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1]).begin(), ((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1]).end(), (((__pyx_v_sufficient[__pyx_v_i])[__pyx_v_j])[__pyx_v_k])) != ((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1]).end()) != 0); + if (__pyx_t_8) { + + /* "cyext_acv.pyx":6464 + * for k in range(sufficient[i][j].size()): + * if std_find[vector[long].iterator, long](power_cpp[s_0][s_1].begin(), power_cpp[s_0][s_1].end(), sufficient[i][j][k]) != power_cpp[s_0][s_1].end(): + * a += 1 # <<<<<<<<<<<<<< + * if a == sufficient[i][j].size(): + * subset = 1 + */ + __pyx_v_a = (__pyx_v_a + 1); + + /* "cyext_acv.pyx":6463 + * a = 0 + * for k in range(sufficient[i][j].size()): + * if std_find[vector[long].iterator, long](power_cpp[s_0][s_1].begin(), power_cpp[s_0][s_1].end(), sufficient[i][j][k]) != power_cpp[s_0][s_1].end(): # <<<<<<<<<<<<<< + * a += 1 + * if a == sufficient[i][j].size(): + */ + } + } + + /* "cyext_acv.pyx":6465 + * if std_find[vector[long].iterator, long](power_cpp[s_0][s_1].begin(), power_cpp[s_0][s_1].end(), sufficient[i][j][k]) != power_cpp[s_0][s_1].end(): + * a += 1 + * if a == sufficient[i][j].size(): # <<<<<<<<<<<<<< + * subset = 1 + * break + */ + __pyx_t_8 = ((__pyx_v_a == ((__pyx_v_sufficient[__pyx_v_i])[__pyx_v_j]).size()) != 0); + if (__pyx_t_8) { + + /* "cyext_acv.pyx":6466 + * a += 1 + * if a == sufficient[i][j].size(): + * subset = 1 # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_subset = 1; + + /* "cyext_acv.pyx":6467 + * if a == sufficient[i][j].size(): + * subset = 1 + * break # <<<<<<<<<<<<<< + * + * if subset == 0: + */ + goto __pyx_L38_break; + + /* "cyext_acv.pyx":6465 + * if std_find[vector[long].iterator, long](power_cpp[s_0][s_1].begin(), power_cpp[s_0][s_1].end(), sufficient[i][j][k]) != power_cpp[s_0][s_1].end(): + * a += 1 + * if a == sufficient[i][j].size(): # <<<<<<<<<<<<<< + * subset = 1 + * break + */ + } + } + __pyx_L38_break:; + + /* "cyext_acv.pyx":6469 + * break + * + * if subset == 0: # <<<<<<<<<<<<<< + * sufficient[i].push_back(power_cpp[s_0][s_1]) + * sufficient_sdp[i].push_back(sdp[i]) + */ + __pyx_t_8 = ((__pyx_v_subset == 0) != 0); + if (__pyx_t_8) { + + /* "cyext_acv.pyx":6470 + * + * if subset == 0: + * sufficient[i].push_back(power_cpp[s_0][s_1]) # <<<<<<<<<<<<<< + * sufficient_sdp[i].push_back(sdp[i]) + * for s in range(S_size): + */ + try { + (__pyx_v_sufficient[__pyx_v_i]).push_back(((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1])); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 6470, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6471 + * if subset == 0: + * sufficient[i].push_back(power_cpp[s_0][s_1]) + * sufficient_sdp[i].push_back(sdp[i]) # <<<<<<<<<<<<<< + * for s in range(S_size): + * sdp_global[S[s]] += 1 + */ + __pyx_t_32 = __pyx_v_i; + try { + (__pyx_v_sufficient_sdp[__pyx_v_i]).push_back((*((double *) ( /* dim=0 */ (__pyx_v_sdp.data + __pyx_t_32 * __pyx_v_sdp.strides[0]) )))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 6471, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6472 + * sufficient[i].push_back(power_cpp[s_0][s_1]) + * sufficient_sdp[i].push_back(sdp[i]) + * for s in range(S_size): # <<<<<<<<<<<<<< + * sdp_global[S[s]] += 1 + * K += 1 + */ + __pyx_t_35 = __pyx_v_S_size; + __pyx_t_36 = __pyx_t_35; + for (__pyx_t_37 = 0; __pyx_t_37 < __pyx_t_36; __pyx_t_37+=1) { + __pyx_v_s = __pyx_t_37; + + /* "cyext_acv.pyx":6473 + * sufficient_sdp[i].push_back(sdp[i]) + * for s in range(S_size): + * sdp_global[S[s]] += 1 # <<<<<<<<<<<<<< + * K += 1 + * + */ + __pyx_t_32 = (__pyx_v_S[__pyx_v_s]); + *((double *) ( /* dim=0 */ (__pyx_v_sdp_global.data + __pyx_t_32 * __pyx_v_sdp_global.strides[0]) )) += 1.0; + } + + /* "cyext_acv.pyx":6474 + * for s in range(S_size): + * sdp_global[S[s]] += 1 + * K += 1 # <<<<<<<<<<<<<< + * + * return sufficient, sufficient_sdp, np.asarray(sdp_global)/K + */ + __pyx_v_K = (__pyx_v_K + 1.0); + + /* "cyext_acv.pyx":6469 + * break + * + * if subset == 0: # <<<<<<<<<<<<<< + * sufficient[i].push_back(power_cpp[s_0][s_1]) + * sufficient_sdp[i].push_back(sdp[i]) + */ + } + + /* "cyext_acv.pyx":6458 + * + * for i in range(N): + * if sdp[i] >= pi_level: # <<<<<<<<<<<<<< + * subset = 0 + * for j in range(sufficient[i].size()): + */ + } + } + } + + /* "cyext_acv.pyx":6448 + * cdef vector[vector[double]] sufficient_sdp = [[-1] for i in range(N)] + * + * for s_0 in tqdm(range(minimal, m + 1)): # <<<<<<<<<<<<<< + * for s_1 in range(0, power_cpp[s_0].size()): + * for i in range(power_cpp[s_0][s_1].size()): + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "cyext_acv.pyx":6476 + * K += 1 + * + * return sufficient, sufficient_sdp, np.asarray(sdp_global)/K # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_convert_vector_to_py_std_3a__3a_vector_3c_std_3a__3a_vector_3c_long_3e____3e___(__pyx_v_sufficient); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6476, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_21 = __pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___(__pyx_v_sufficient_sdp); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 6476, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6476, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6476, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_sdp_global, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6476, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6476, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_K); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6476, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6476, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6476, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_21); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_21); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_6); + __pyx_t_1 = 0; + __pyx_t_21 = 0; + __pyx_t_6 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "cyext_acv.pyx":6388 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef sufficient_cxpl_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * int max_depth, int min_node_size, int & classifier, double[:, :] & t, list C, double pi_level, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_21); + __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1); + __Pyx_AddTraceback("cyext_acv.sufficient_cxpl_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp_global, 1); + __Pyx_XDECREF(__pyx_v_power); + __Pyx_XDECREF(__pyx_v_va_id); + __Pyx_XDECREF(__pyx_v_remove_va); + __Pyx_XDECREF(__pyx_v_power_b); + __Pyx_XDECREF(__pyx_v_co); + __PYX_XDEC_MEMVIEW(&__pyx_v_s_star, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_9cyext_acv_105sufficient_cxpl_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_9cyext_acv_105sufficient_cxpl_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_features = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_thresholds = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_left = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_right = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_max_depth; + int __pyx_v_min_node_size; + int __pyx_v_classifier; + __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_C = 0; + double __pyx_v_pi_level; + int __pyx_v_minimal; + int __pyx_v_stop; + PyObject *__pyx_v_search_space = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sufficient_cxpl_rf (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_y_X,&__pyx_n_s_data,&__pyx_n_s_y_data,&__pyx_n_s_features,&__pyx_n_s_thresholds,&__pyx_n_s_children_left,&__pyx_n_s_children_right,&__pyx_n_s_max_depth,&__pyx_n_s_min_node_size,&__pyx_n_s_classifier,&__pyx_n_s_t,&__pyx_n_s_C,&__pyx_n_s_pi_level,&__pyx_n_s_minimal,&__pyx_n_s_stop,&__pyx_n_s_search_space,0}; + PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16); + CYTHON_FALLTHROUGH; + case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15); + CYTHON_FALLTHROUGH; + case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_X)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sufficient_cxpl_rf", 1, 17, 17, 1); __PYX_ERR(0, 6388, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sufficient_cxpl_rf", 1, 17, 17, 2); __PYX_ERR(0, 6388, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sufficient_cxpl_rf", 1, 17, 17, 3); __PYX_ERR(0, 6388, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_features)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sufficient_cxpl_rf", 1, 17, 17, 4); __PYX_ERR(0, 6388, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thresholds)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sufficient_cxpl_rf", 1, 17, 17, 5); __PYX_ERR(0, 6388, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_left)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sufficient_cxpl_rf", 1, 17, 17, 6); __PYX_ERR(0, 6388, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sufficient_cxpl_rf", 1, 17, 17, 7); __PYX_ERR(0, 6388, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sufficient_cxpl_rf", 1, 17, 17, 8); __PYX_ERR(0, 6388, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_node_size)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sufficient_cxpl_rf", 1, 17, 17, 9); __PYX_ERR(0, 6388, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classifier)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sufficient_cxpl_rf", 1, 17, 17, 10); __PYX_ERR(0, 6388, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sufficient_cxpl_rf", 1, 17, 17, 11); __PYX_ERR(0, 6388, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sufficient_cxpl_rf", 1, 17, 17, 12); __PYX_ERR(0, 6388, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 13: + if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pi_level)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sufficient_cxpl_rf", 1, 17, 17, 13); __PYX_ERR(0, 6388, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 14: + if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minimal)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sufficient_cxpl_rf", 1, 17, 17, 14); __PYX_ERR(0, 6388, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 15: + if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sufficient_cxpl_rf", 1, 17, 17, 15); __PYX_ERR(0, 6388, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 16: + if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_search_space)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sufficient_cxpl_rf", 1, 17, 17, 16); __PYX_ERR(0, 6388, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sufficient_cxpl_rf") < 0)) __PYX_ERR(0, 6388, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 17) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + values[15] = PyTuple_GET_ITEM(__pyx_args, 15); + values[16] = PyTuple_GET_ITEM(__pyx_args, 16); + } + __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 6388, __pyx_L3_error) + __pyx_v_y_X = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_X.memview)) __PYX_ERR(0, 6388, __pyx_L3_error) + __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 6388, __pyx_L3_error) + __pyx_v_y_data = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_data.memview)) __PYX_ERR(0, 6388, __pyx_L3_error) + __pyx_v_features = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_features.memview)) __PYX_ERR(0, 6389, __pyx_L3_error) + __pyx_v_thresholds = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_thresholds.memview)) __PYX_ERR(0, 6389, __pyx_L3_error) + __pyx_v_children_left = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_left.memview)) __PYX_ERR(0, 6389, __pyx_L3_error) + __pyx_v_children_right = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_right.memview)) __PYX_ERR(0, 6389, __pyx_L3_error) + __pyx_v_max_depth = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6390, __pyx_L3_error) + __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6390, __pyx_L3_error) + __pyx_v_classifier = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6390, __pyx_L3_error) + __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[11], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 6390, __pyx_L3_error) + __pyx_v_C = ((PyObject*)values[12]); + __pyx_v_pi_level = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_pi_level == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 6390, __pyx_L3_error) + __pyx_v_minimal = __Pyx_PyInt_As_int(values[14]); if (unlikely((__pyx_v_minimal == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6391, __pyx_L3_error) + __pyx_v_stop = __Pyx_PyObject_IsTrue(values[15]); if (unlikely((__pyx_v_stop == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6391, __pyx_L3_error) + __pyx_v_search_space = ((PyObject*)values[16]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sufficient_cxpl_rf", 1, 17, 17, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6388, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cyext_acv.sufficient_cxpl_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_C), (&PyList_Type), 1, "C", 1))) __PYX_ERR(0, 6390, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_search_space), (&PyList_Type), 1, "search_space", 1))) __PYX_ERR(0, 6391, __pyx_L1_error) + __pyx_r = __pyx_pf_9cyext_acv_104sufficient_cxpl_rf(__pyx_self, __pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_v_C, __pyx_v_pi_level, __pyx_v_minimal, __pyx_v_stop, __pyx_v_search_space); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9cyext_acv_104sufficient_cxpl_rf(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t, PyObject *__pyx_v_C, double __pyx_v_pi_level, int __pyx_v_minimal, int __pyx_v_stop, PyObject *__pyx_v_search_space) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sufficient_cxpl_rf", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundLocalError("X"); __PYX_ERR(0, 6388, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_X.memview)) { __Pyx_RaiseUnboundLocalError("y_X"); __PYX_ERR(0, 6388, __pyx_L1_error) } + if (unlikely(!__pyx_v_data.memview)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 6388, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_data.memview)) { __Pyx_RaiseUnboundLocalError("y_data"); __PYX_ERR(0, 6388, __pyx_L1_error) } + if (unlikely(!__pyx_v_features.memview)) { __Pyx_RaiseUnboundLocalError("features"); __PYX_ERR(0, 6388, __pyx_L1_error) } + if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 6388, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 6388, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 6388, __pyx_L1_error) } + if (unlikely(!__pyx_v_t.memview)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 6388, __pyx_L1_error) } + __pyx_t_1 = __pyx_f_9cyext_acv_sufficient_cxpl_rf(__pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_v_C, __pyx_v_pi_level, __pyx_v_minimal, __pyx_v_stop, __pyx_v_search_space, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6388, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cyext_acv.sufficient_cxpl_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_features, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_thresholds, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_left, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_right, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_t, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cyext_acv.pyx":6482 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cdef double single_compute_ddp_intv_rule_weights(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, # <<<<<<<<<<<<<< + * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + * int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition, + */ + +static double __pyx_f_9cyext_acv_single_compute_ddp_intv_rule_weights(CYTHON_UNUSED __Pyx_memviewslice &__pyx_v_x, double &__pyx_v_y_x, __Pyx_memviewslice &__pyx_v_data, __Pyx_memviewslice &__pyx_v_y_data, std::vector &__pyx_v_S, __Pyx_memviewslice &__pyx_v_features, __Pyx_memviewslice &__pyx_v_thresholds, __Pyx_memviewslice &__pyx_v_children_left, __Pyx_memviewslice &__pyx_v_children_right, int &__pyx_v_max_depth, int &__pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, __Pyx_memviewslice &__pyx_v_partition, __Pyx_memviewslice &__pyx_v_w, __Pyx_memviewslice &__pyx_v_cond) { + unsigned int __pyx_v_n_trees; + unsigned int __pyx_v_N; + double __pyx_v_sdp; + int __pyx_v_b; + CYTHON_UNUSED int __pyx_v_level; + int __pyx_v_i; + int __pyx_v_it_node; + std::set __pyx_v_nodes_level; + std::set __pyx_v_nodes_child; + std::set __pyx_v_in_data; + std::set __pyx_v_in_data_b; + std::set ::iterator __pyx_v_it; + std::set ::iterator __pyx_v_it_point; + double __pyx_r; + unsigned int __pyx_t_1; + unsigned int __pyx_t_2; + int __pyx_t_3; + unsigned int __pyx_t_4; + unsigned int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "cyext_acv.pyx":6487 + * double[:] & w, const double[:, :] & cond) nogil: + * + * cdef unsigned int n_trees = features.shape[0] # <<<<<<<<<<<<<< + * cdef unsigned int N = data.shape[0] + * cdef double s, sdp + */ + __pyx_v_n_trees = (__pyx_v_features.shape[0]); + + /* "cyext_acv.pyx":6488 + * + * cdef unsigned int n_trees = features.shape[0] + * cdef unsigned int N = data.shape[0] # <<<<<<<<<<<<<< + * cdef double s, sdp + * cdef int o + */ + __pyx_v_N = (__pyx_v_data.shape[0]); + + /* "cyext_acv.pyx":6491 + * cdef double s, sdp + * cdef int o + * sdp = 0 # <<<<<<<<<<<<<< + * + * cdef int b, level, i, it_node + */ + __pyx_v_sdp = 0.0; + + /* "cyext_acv.pyx":6497 + * cdef set[int].iterator it, it_point + * + * for b in range(n_trees): # <<<<<<<<<<<<<< + * nodes_child.clear() + * nodes_level.clear() + */ + __pyx_t_1 = __pyx_v_n_trees; + __pyx_t_2 = __pyx_t_1; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_b = __pyx_t_3; + + /* "cyext_acv.pyx":6498 + * + * for b in range(n_trees): + * nodes_child.clear() # <<<<<<<<<<<<<< + * nodes_level.clear() + * nodes_level.insert(0) + */ + __pyx_v_nodes_child.clear(); + + /* "cyext_acv.pyx":6499 + * for b in range(n_trees): + * nodes_child.clear() + * nodes_level.clear() # <<<<<<<<<<<<<< + * nodes_level.insert(0) + * + */ + __pyx_v_nodes_level.clear(); + + /* "cyext_acv.pyx":6500 + * nodes_child.clear() + * nodes_level.clear() + * nodes_level.insert(0) # <<<<<<<<<<<<<< + * + * in_data.clear() + */ + try { + __pyx_v_nodes_level.insert(0); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 6500, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6502 + * nodes_level.insert(0) + * + * in_data.clear() # <<<<<<<<<<<<<< + * in_data_b.clear() + * for i in range(N): + */ + __pyx_v_in_data.clear(); + + /* "cyext_acv.pyx":6503 + * + * in_data.clear() + * in_data_b.clear() # <<<<<<<<<<<<<< + * for i in range(N): + * in_data.insert(i) + */ + __pyx_v_in_data_b.clear(); + + /* "cyext_acv.pyx":6504 + * in_data.clear() + * in_data_b.clear() + * for i in range(N): # <<<<<<<<<<<<<< + * in_data.insert(i) + * in_data_b.insert(i) + */ + __pyx_t_4 = __pyx_v_N; + __pyx_t_5 = __pyx_t_4; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "cyext_acv.pyx":6505 + * in_data_b.clear() + * for i in range(N): + * in_data.insert(i) # <<<<<<<<<<<<<< + * in_data_b.insert(i) + * + */ + try { + __pyx_v_in_data.insert(__pyx_v_i); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 6505, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6506 + * for i in range(N): + * in_data.insert(i) + * in_data_b.insert(i) # <<<<<<<<<<<<<< + * + * for level in range(max_depth): + */ + try { + __pyx_v_in_data_b.insert(__pyx_v_i); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 6506, __pyx_L1_error) + } + } + + /* "cyext_acv.pyx":6508 + * in_data_b.insert(i) + * + * for level in range(max_depth): # <<<<<<<<<<<<<< + * it_point = nodes_level.begin() + * while(it_point != nodes_level.end()): + */ + __pyx_t_6 = __pyx_v_max_depth; + __pyx_t_7 = __pyx_t_6; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_level = __pyx_t_8; + + /* "cyext_acv.pyx":6509 + * + * for level in range(max_depth): + * it_point = nodes_level.begin() # <<<<<<<<<<<<<< + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) + */ + __pyx_v_it_point = __pyx_v_nodes_level.begin(); + + /* "cyext_acv.pyx":6510 + * for level in range(max_depth): + * it_point = nodes_level.begin() + * while(it_point != nodes_level.end()): # <<<<<<<<<<<<<< + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it_point != __pyx_v_nodes_level.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":6511 + * it_point = nodes_level.begin() + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) # <<<<<<<<<<<<<< + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * nodes_child.insert(children_left[b, it_node]) + */ + __pyx_v_it_node = (*__pyx_v_it_point); + + /* "cyext_acv.pyx":6512 + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * nodes_child.insert(children_right[b, it_node]) + */ + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_9 = ((std::find ::iterator,int>(__pyx_v_S.begin(), __pyx_v_S.end(), (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_10 * __pyx_v_features.strides[0]) ) + __pyx_t_11 * __pyx_v_features.strides[1]) )))) != __pyx_v_S.end()) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6513 + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * nodes_child.insert(children_left[b, it_node]) # <<<<<<<<<<<<<< + * nodes_child.insert(children_right[b, it_node]) + * + */ + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_left.data + __pyx_t_11 * __pyx_v_children_left.strides[0]) ) + __pyx_t_10 * __pyx_v_children_left.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 6513, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6514 + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * nodes_child.insert(children_left[b, it_node]) + * nodes_child.insert(children_right[b, it_node]) # <<<<<<<<<<<<<< + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] <= thresholds[b, it_node]: + */ + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_right.data + __pyx_t_10 * __pyx_v_children_right.strides[0]) ) + __pyx_t_11 * __pyx_v_children_right.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 6514, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6512 + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * nodes_child.insert(children_right[b, it_node]) + */ + goto __pyx_L11; + } + + /* "cyext_acv.pyx":6516 + * nodes_child.insert(children_right[b, it_node]) + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * + */ + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_12 = (((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_11 * __pyx_v_features.strides[0]) ) + __pyx_t_10 * __pyx_v_features.strides[1]) ))) >= 0) != 0); + if (__pyx_t_12) { + } else { + __pyx_t_9 = __pyx_t_12; + goto __pyx_L12_bool_binop_done; + } + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_13 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_10 * __pyx_v_features.strides[0]) ) + __pyx_t_11 * __pyx_v_features.strides[1]) ))); + __pyx_t_14 = 1; + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = __pyx_v_it_node; + __pyx_t_12 = (((*((double const *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_cond.data + __pyx_t_13 * __pyx_v_cond.strides[0]) ) + __pyx_t_14 * __pyx_v_cond.strides[1]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_15 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_16 * __pyx_v_thresholds.strides[1]) )))) != 0); + __pyx_t_9 = __pyx_t_12; + __pyx_L12_bool_binop_done:; + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6517 + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) # <<<<<<<<<<<<<< + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + */ + __pyx_t_16 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_left.data + __pyx_t_16 * __pyx_v_children_left.strides[0]) ) + __pyx_t_15 * __pyx_v_children_left.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 6517, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6519 + * nodes_child.insert(children_left[b, it_node]) + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 1] = thresholds[b, it_node] + * + */ + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = __pyx_v_it_node; + __pyx_t_11 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_15 * __pyx_v_features.strides[0]) ) + __pyx_t_16 * __pyx_v_features.strides[1]) ))); + __pyx_t_10 = 1; + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_11 * __pyx_v_partition.strides[0]) ) + __pyx_t_10 * __pyx_v_partition.strides[1]) ))) >= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_14 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_13 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6520 + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + * partition[features[b, it_node], 1] = thresholds[b, it_node] # <<<<<<<<<<<<<< + * + * it = in_data.begin() + */ + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + __pyx_t_16 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_10 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_16 * __pyx_v_features.strides[0]) ) + __pyx_t_15 * __pyx_v_features.strides[1]) ))); + __pyx_t_11 = 1; + *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_10 * __pyx_v_partition.strides[0]) ) + __pyx_t_11 * __pyx_v_partition.strides[1]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_13 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_14 * __pyx_v_thresholds.strides[1]) ))); + + /* "cyext_acv.pyx":6519 + * nodes_child.insert(children_left[b, it_node]) + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 1] = thresholds[b, it_node] + * + */ + } + + /* "cyext_acv.pyx":6522 + * partition[features[b, it_node], 1] = thresholds[b, it_node] + * + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + */ + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":6523 + * + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":6524 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_15 = (*__pyx_v_it); + __pyx_t_16 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_14 * __pyx_v_features.strides[0]) ) + __pyx_t_13 * __pyx_v_features.strides[1]) ))); + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_data.data + __pyx_t_15 * __pyx_v_data.strides[0]) ) + __pyx_t_16 * __pyx_v_data.strides[1]) ))) > (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_11 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_10 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6525 + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) # <<<<<<<<<<<<<< + * inc(it) + * in_data = in_data_b + */ + (void)(__pyx_v_in_data_b.erase((*__pyx_v_it))); + + /* "cyext_acv.pyx":6524 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + } + + /* "cyext_acv.pyx":6526 + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + * inc(it) # <<<<<<<<<<<<<< + * in_data = in_data_b + * + */ + (void)((++__pyx_v_it)); + } + + /* "cyext_acv.pyx":6527 + * in_data_b.erase(deref(it)) + * inc(it) + * in_data = in_data_b # <<<<<<<<<<<<<< + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 0] > thresholds[b, it_node]: + */ + __pyx_v_in_data = __pyx_v_in_data_b; + + /* "cyext_acv.pyx":6516 + * nodes_child.insert(children_right[b, it_node]) + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * + */ + goto __pyx_L11; + } + + /* "cyext_acv.pyx":6529 + * in_data = in_data_b + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 0] > thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_right[b, it_node]) + * + */ + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_12 = (((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_10 * __pyx_v_features.strides[0]) ) + __pyx_t_11 * __pyx_v_features.strides[1]) ))) >= 0) != 0); + if (__pyx_t_12) { + } else { + __pyx_t_9 = __pyx_t_12; + goto __pyx_L18_bool_binop_done; + } + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_13 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_11 * __pyx_v_features.strides[0]) ) + __pyx_t_10 * __pyx_v_features.strides[1]) ))); + __pyx_t_14 = 0; + __pyx_t_16 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_12 = (((*((double const *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_cond.data + __pyx_t_13 * __pyx_v_cond.strides[0]) ) + __pyx_t_14 * __pyx_v_cond.strides[1]) ))) > (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_16 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_15 * __pyx_v_thresholds.strides[1]) )))) != 0); + __pyx_t_9 = __pyx_t_12; + __pyx_L18_bool_binop_done:; + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6530 + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 0] > thresholds[b, it_node]: + * nodes_child.insert(children_right[b, it_node]) # <<<<<<<<<<<<<< + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: + */ + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_right.data + __pyx_t_15 * __pyx_v_children_right.strides[0]) ) + __pyx_t_16 * __pyx_v_children_right.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 6530, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6532 + * nodes_child.insert(children_right[b, it_node]) + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 0] = thresholds[b, it_node] + * + */ + __pyx_t_16 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_10 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_16 * __pyx_v_features.strides[0]) ) + __pyx_t_15 * __pyx_v_features.strides[1]) ))); + __pyx_t_11 = 0; + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_10 * __pyx_v_partition.strides[0]) ) + __pyx_t_11 * __pyx_v_partition.strides[1]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_14 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_13 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6533 + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: + * partition[features[b, it_node], 0] = thresholds[b, it_node] # <<<<<<<<<<<<<< + * + * it = in_data.begin() + */ + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = __pyx_v_it_node; + __pyx_t_11 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_15 * __pyx_v_features.strides[0]) ) + __pyx_t_16 * __pyx_v_features.strides[1]) ))); + __pyx_t_10 = 0; + *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_11 * __pyx_v_partition.strides[0]) ) + __pyx_t_10 * __pyx_v_partition.strides[1]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_13 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_14 * __pyx_v_thresholds.strides[1]) ))); + + /* "cyext_acv.pyx":6532 + * nodes_child.insert(children_right[b, it_node]) + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 0] = thresholds[b, it_node] + * + */ + } + + /* "cyext_acv.pyx":6535 + * partition[features[b, it_node], 0] = thresholds[b, it_node] + * + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + */ + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":6536 + * + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":6537 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_16 = (*__pyx_v_it); + __pyx_t_15 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_14 * __pyx_v_features.strides[0]) ) + __pyx_t_13 * __pyx_v_features.strides[1]) ))); + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_data.data + __pyx_t_16 * __pyx_v_data.strides[0]) ) + __pyx_t_15 * __pyx_v_data.strides[1]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_10 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_11 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6538 + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) # <<<<<<<<<<<<<< + * inc(it) + * in_data = in_data_b + */ + (void)(__pyx_v_in_data_b.erase((*__pyx_v_it))); + + /* "cyext_acv.pyx":6537 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + } + + /* "cyext_acv.pyx":6539 + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + * inc(it) # <<<<<<<<<<<<<< + * in_data = in_data_b + * + */ + (void)((++__pyx_v_it)); + } + + /* "cyext_acv.pyx":6540 + * in_data_b.erase(deref(it)) + * inc(it) + * in_data = in_data_b # <<<<<<<<<<<<<< + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] >= thresholds[b, it_node] and cond[features[b, it_node], 0] <= thresholds[b, it_node]: + */ + __pyx_v_in_data = __pyx_v_in_data_b; + + /* "cyext_acv.pyx":6529 + * in_data = in_data_b + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 0] > thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_right[b, it_node]) + * + */ + goto __pyx_L11; + } + + /* "cyext_acv.pyx":6542 + * in_data = in_data_b + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] >= thresholds[b, it_node] and cond[features[b, it_node], 0] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * nodes_child.insert(children_right[b, it_node]) + */ + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_12 = (((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_11 * __pyx_v_features.strides[0]) ) + __pyx_t_10 * __pyx_v_features.strides[1]) ))) >= 0) != 0); + if (__pyx_t_12) { + } else { + __pyx_t_9 = __pyx_t_12; + goto __pyx_L24_bool_binop_done; + } + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_13 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_10 * __pyx_v_features.strides[0]) ) + __pyx_t_11 * __pyx_v_features.strides[1]) ))); + __pyx_t_14 = 1; + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = __pyx_v_it_node; + __pyx_t_12 = (((*((double const *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_cond.data + __pyx_t_13 * __pyx_v_cond.strides[0]) ) + __pyx_t_14 * __pyx_v_cond.strides[1]) ))) >= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_15 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_16 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_12) { + } else { + __pyx_t_9 = __pyx_t_12; + goto __pyx_L24_bool_binop_done; + } + __pyx_t_16 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_11 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_16 * __pyx_v_features.strides[0]) ) + __pyx_t_15 * __pyx_v_features.strides[1]) ))); + __pyx_t_10 = 0; + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_12 = (((*((double const *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_cond.data + __pyx_t_11 * __pyx_v_cond.strides[0]) ) + __pyx_t_10 * __pyx_v_cond.strides[1]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_14 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_13 * __pyx_v_thresholds.strides[1]) )))) != 0); + __pyx_t_9 = __pyx_t_12; + __pyx_L24_bool_binop_done:; + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6543 + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] >= thresholds[b, it_node] and cond[features[b, it_node], 0] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) # <<<<<<<<<<<<<< + * nodes_child.insert(children_right[b, it_node]) + * + */ + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_left.data + __pyx_t_13 * __pyx_v_children_left.strides[0]) ) + __pyx_t_14 * __pyx_v_children_left.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 6543, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6544 + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] >= thresholds[b, it_node] and cond[features[b, it_node], 0] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) + * nodes_child.insert(children_right[b, it_node]) # <<<<<<<<<<<<<< + * + * # if partition[features[b, it_node], 0] <= thresholds[b, it_node]: # TO DO: compute correctly the partition in this case + */ + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_right.data + __pyx_t_14 * __pyx_v_children_right.strides[0]) ) + __pyx_t_13 * __pyx_v_children_right.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 6544, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6542 + * in_data = in_data_b + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] >= thresholds[b, it_node] and cond[features[b, it_node], 0] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * nodes_child.insert(children_right[b, it_node]) + */ + goto __pyx_L11; + } + + /* "cyext_acv.pyx":6560 + * + * else: + * nodes_child.insert(children_left[b, it_node]) # <<<<<<<<<<<<<< + * nodes_child.insert(children_right[b, it_node]) + * + */ + /*else*/ { + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_left.data + __pyx_t_13 * __pyx_v_children_left.strides[0]) ) + __pyx_t_14 * __pyx_v_children_left.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 6560, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6561 + * else: + * nodes_child.insert(children_left[b, it_node]) + * nodes_child.insert(children_right[b, it_node]) # <<<<<<<<<<<<<< + * + * if in_data.size() < min_node_size: + */ + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_right.data + __pyx_t_14 * __pyx_v_children_right.strides[0]) ) + __pyx_t_13 * __pyx_v_children_right.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 6561, __pyx_L1_error) + } + } + __pyx_L11:; + + /* "cyext_acv.pyx":6563 + * nodes_child.insert(children_right[b, it_node]) + * + * if in_data.size() < min_node_size: # <<<<<<<<<<<<<< + * break + * inc(it_point) + */ + __pyx_t_9 = ((__pyx_v_in_data.size() < __pyx_v_min_node_size) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6564 + * + * if in_data.size() < min_node_size: + * break # <<<<<<<<<<<<<< + * inc(it_point) + * + */ + goto __pyx_L10_break; + + /* "cyext_acv.pyx":6563 + * nodes_child.insert(children_right[b, it_node]) + * + * if in_data.size() < min_node_size: # <<<<<<<<<<<<<< + * break + * inc(it_point) + */ + } + + /* "cyext_acv.pyx":6565 + * if in_data.size() < min_node_size: + * break + * inc(it_point) # <<<<<<<<<<<<<< + * + * nodes_level = nodes_child + */ + (void)((++__pyx_v_it_point)); + } + __pyx_L10_break:; + + /* "cyext_acv.pyx":6567 + * inc(it_point) + * + * nodes_level = nodes_child # <<<<<<<<<<<<<< + * + * if classifier == 1: + */ + __pyx_v_nodes_level = __pyx_v_nodes_child; + } + + /* "cyext_acv.pyx":6569 + * nodes_level = nodes_child + * + * if classifier == 1: # <<<<<<<<<<<<<< + * it = in_data.begin() + * while(it != in_data.end()): + */ + __pyx_t_9 = ((__pyx_v_classifier == 1) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6570 + * + * if classifier == 1: + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) + */ + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":6571 + * if classifier == 1: + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) + * w[deref(it)] += (1./(n_trees*in_data.size())) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":6572 + * it = in_data.begin() + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) # <<<<<<<<<<<<<< + * w[deref(it)] += (1./(n_trees*in_data.size())) + * inc(it) + */ + __pyx_t_13 = (*__pyx_v_it); + __pyx_v_sdp = (__pyx_v_sdp + ((1. / (__pyx_v_n_trees * __pyx_v_in_data.size())) * (__pyx_v_y_x != (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_13)) )))))); + + /* "cyext_acv.pyx":6573 + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) + * w[deref(it)] += (1./(n_trees*in_data.size())) # <<<<<<<<<<<<<< + * inc(it) + * else: + */ + __pyx_t_13 = (*__pyx_v_it); + *((double *) ( /* dim=0 */ (__pyx_v_w.data + __pyx_t_13 * __pyx_v_w.strides[0]) )) += (1. / (__pyx_v_n_trees * __pyx_v_in_data.size())); + + /* "cyext_acv.pyx":6574 + * sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) + * w[deref(it)] += (1./(n_trees*in_data.size())) + * inc(it) # <<<<<<<<<<<<<< + * else: + * it = in_data.begin() + */ + (void)((++__pyx_v_it)); + } + + /* "cyext_acv.pyx":6569 + * nodes_level = nodes_child + * + * if classifier == 1: # <<<<<<<<<<<<<< + * it = in_data.begin() + * while(it != in_data.end()): + */ + goto __pyx_L28; + } + + /* "cyext_acv.pyx":6576 + * inc(it) + * else: + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (1-(t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) + */ + /*else*/ { + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":6577 + * else: + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * sdp += (1./(n_trees*in_data.size())) * (1-(t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) + * w[deref(it)] += (1./(n_trees*in_data.size())) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":6578 + * it = in_data.begin() + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (1-(t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) # <<<<<<<<<<<<<< + * w[deref(it)] += (1./(n_trees*in_data.size())) + * inc(it) + */ + __pyx_t_13 = 0; + __pyx_t_14 = (*__pyx_v_it); + __pyx_t_15 = (*__pyx_v_it); + __pyx_t_16 = 1; + __pyx_v_sdp = (__pyx_v_sdp + ((1. / (__pyx_v_n_trees * __pyx_v_in_data.size())) * (1 - (((*((double *) ( /* dim=0 */ (__pyx_v_t.data + __pyx_t_13 * __pyx_v_t.strides[0]) ))) <= (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_14)) )))) * ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_15)) ))) <= (*((double *) ( /* dim=0 */ (__pyx_v_t.data + __pyx_t_16 * __pyx_v_t.strides[0]) )))))))); + + /* "cyext_acv.pyx":6579 + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (1-(t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) + * w[deref(it)] += (1./(n_trees*in_data.size())) # <<<<<<<<<<<<<< + * inc(it) + * + */ + __pyx_t_16 = (*__pyx_v_it); + *((double *) ( /* dim=0 */ (__pyx_v_w.data + __pyx_t_16 * __pyx_v_w.strides[0]) )) += (1. / (__pyx_v_n_trees * __pyx_v_in_data.size())); + + /* "cyext_acv.pyx":6580 + * sdp += (1./(n_trees*in_data.size())) * (1-(t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) + * w[deref(it)] += (1./(n_trees*in_data.size())) + * inc(it) # <<<<<<<<<<<<<< + * + * return sdp + */ + (void)((++__pyx_v_it)); + } + } + __pyx_L28:; + } + + /* "cyext_acv.pyx":6582 + * inc(it) + * + * return sdp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_sdp; + goto __pyx_L0; + + /* "cyext_acv.pyx":6482 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cdef double single_compute_ddp_intv_rule_weights(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, # <<<<<<<<<<<<<< + * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + * int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("cyext_acv.single_compute_ddp_intv_rule_weights", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_r = 0; + __pyx_L0:; + return __pyx_r; +} + +/* "cyext_acv.pyx":6589 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_ddp_intv_weights(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * const double [:, :, :] & cond, + */ + +static PyObject *__pyx_pw_9cyext_acv_107compute_ddp_intv_weights(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_ddp_intv_weights(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, __Pyx_memviewslice &__pyx_v_cond, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_buffer = NULL; + __Pyx_memviewslice __pyx_v_partition_byobs = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_N; + __Pyx_memviewslice __pyx_v_sdp = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_weights = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_13; + __Pyx_memviewslice __pyx_t_14 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_15 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_16 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_ddp_intv_weights", 0); + + /* "cyext_acv.pyx":6594 + * int max_depth, int min_node_size, int & classifier, double[:, :] & t): + * + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) # <<<<<<<<<<<<<< + * buffer[:, :, 0] = -1e+10 + * cdef double [:, :, :] partition_byobs = buffer + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6594, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ones); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6594, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6594, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_X.shape[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6594, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_X.shape[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6594, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6594, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_INCREF(__pyx_int_2); + __Pyx_GIVEREF(__pyx_int_2); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_2); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 6594, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6594, __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 = PyNumber_Multiply(__pyx_float_1e_10, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6594, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_buffer = __pyx_t_1; + __pyx_t_1 = 0; + + /* "cyext_acv.pyx":6595 + * + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + * buffer[:, :, 0] = -1e+10 # <<<<<<<<<<<<<< + * cdef double [:, :, :] partition_byobs = buffer + * + */ + if (unlikely(PyObject_SetItem(__pyx_v_buffer, __pyx_tuple__3, __pyx_float_neg_1e_10) < 0)) __PYX_ERR(0, 6595, __pyx_L1_error) + + /* "cyext_acv.pyx":6596 + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + * buffer[:, :, 0] = -1e+10 + * cdef double [:, :, :] partition_byobs = buffer # <<<<<<<<<<<<<< + * + * cdef int N = X.shape[0] + */ + __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_v_buffer, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 6596, __pyx_L1_error) + __pyx_v_partition_byobs = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "cyext_acv.pyx":6598 + * cdef double [:, :, :] partition_byobs = buffer + * + * cdef int N = X.shape[0] # <<<<<<<<<<<<<< + * cdef double[::1] sdp = np.zeros(N) + * cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + */ + __pyx_v_N = (__pyx_v_X.shape[0]); + + /* "cyext_acv.pyx":6599 + * + * cdef int N = X.shape[0] + * cdef double[::1] sdp = np.zeros(N) # <<<<<<<<<<<<<< + * cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + * cdef int i, j + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 6599, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp = __pyx_t_7; + __pyx_t_7.memview = NULL; + __pyx_t_7.data = NULL; + + /* "cyext_acv.pyx":6600 + * cdef int N = X.shape[0] + * cdef double[::1] sdp = np.zeros(N) + * cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) # <<<<<<<<<<<<<< + * cdef int i, j + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_data.shape[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __pyx_t_5 = 0; + __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_3) < 0) __PYX_ERR(0, 6600, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 6600, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_weights = __pyx_t_8; + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; + + /* "cyext_acv.pyx":6603 + * cdef int i, j + * + * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_ddp_intv_rule_weights(X[i], y_X[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + __pyx_t_9 = __pyx_v_N; + if ((1 == 0)) abort(); + { + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) (x) + #define unlikely(x) (x) + #endif + __pyx_t_11 = (__pyx_t_9 - 0 + 1 - 1/abs(1)) / 1; + if (__pyx_t_11 > 0) + { + #ifdef _OPENMP + #pragma omp parallel private(__pyx_t_13, __pyx_t_17) firstprivate(__pyx_t_12, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_8) + #endif /* _OPENMP */ + { + #ifdef _OPENMP + #pragma omp for firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) schedule(dynamic) + #endif /* _OPENMP */ + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_11; __pyx_t_10++){ + { + __pyx_v_i = (int)(0 + 1 * __pyx_t_10); + + /* "cyext_acv.pyx":6604 + * + * for i in prange(N, nogil=True, schedule='dynamic'): + * sdp[i] = single_compute_ddp_intv_rule_weights(X[i], y_X[i], data, y_data, S[i], # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i], cond[i]) + */ + __pyx_t_12.data = __pyx_v_X.data; + __pyx_t_12.memview = __pyx_v_X.memview; + __PYX_INC_MEMVIEW(&__pyx_t_12, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_X.strides[0]; + __pyx_t_12.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_12.shape[0] = __pyx_v_X.shape[1]; +__pyx_t_12.strides[0] = __pyx_v_X.strides[1]; + __pyx_t_12.suboffsets[0] = -1; + +__pyx_t_13 = __pyx_v_i; + + /* "cyext_acv.pyx":6606 + * sdp[i] = single_compute_ddp_intv_rule_weights(X[i], y_X[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i], cond[i]) # <<<<<<<<<<<<<< + * + * return np.array(sdp), np.array(weights) + */ + __pyx_t_14.data = __pyx_v_t.data; + __pyx_t_14.memview = __pyx_v_t.memview; + __PYX_INC_MEMVIEW(&__pyx_t_14, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_t.strides[0]; + __pyx_t_14.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_14.shape[0] = __pyx_v_t.shape[1]; +__pyx_t_14.strides[0] = __pyx_v_t.strides[1]; + __pyx_t_14.suboffsets[0] = -1; + +__pyx_t_8.data = __pyx_v_partition_byobs.data; + __pyx_t_8.memview = __pyx_v_partition_byobs.memview; + __PYX_INC_MEMVIEW(&__pyx_t_8, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_partition_byobs.strides[0]; + __pyx_t_8.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_8.shape[0] = __pyx_v_partition_byobs.shape[1]; +__pyx_t_8.strides[0] = __pyx_v_partition_byobs.strides[1]; + __pyx_t_8.suboffsets[0] = -1; + +__pyx_t_8.shape[1] = __pyx_v_partition_byobs.shape[2]; +__pyx_t_8.strides[1] = __pyx_v_partition_byobs.strides[2]; + __pyx_t_8.suboffsets[1] = -1; + +__pyx_t_15.data = __pyx_v_weights.data; + __pyx_t_15.memview = __pyx_v_weights.memview; + __PYX_INC_MEMVIEW(&__pyx_t_15, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_weights.strides[0]; + __pyx_t_15.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_15.shape[0] = __pyx_v_weights.shape[1]; +__pyx_t_15.strides[0] = __pyx_v_weights.strides[1]; + __pyx_t_15.suboffsets[0] = -1; + +__pyx_t_16.data = __pyx_v_cond.data; + __pyx_t_16.memview = __pyx_v_cond.memview; + __PYX_INC_MEMVIEW(&__pyx_t_16, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_cond.strides[0]; + __pyx_t_16.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_16.shape[0] = __pyx_v_cond.shape[1]; +__pyx_t_16.strides[0] = __pyx_v_cond.strides[1]; + __pyx_t_16.suboffsets[0] = -1; + +__pyx_t_16.shape[1] = __pyx_v_cond.shape[2]; +__pyx_t_16.strides[1] = __pyx_v_cond.strides[2]; + __pyx_t_16.suboffsets[1] = -1; + +__pyx_t_17 = __pyx_v_i; + + /* "cyext_acv.pyx":6604 + * + * for i in prange(N, nogil=True, schedule='dynamic'): + * sdp[i] = single_compute_ddp_intv_rule_weights(X[i], y_X[i], data, y_data, S[i], # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i], cond[i]) + */ + *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_sdp.data) + __pyx_t_17)) )) = __pyx_f_9cyext_acv_single_compute_ddp_intv_rule_weights(__pyx_t_12, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_13)) ))), __pyx_v_data, __pyx_v_y_data, (__pyx_v_S[__pyx_v_i]), __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_t_14, __pyx_t_8, __pyx_t_15, __pyx_t_16); + __PYX_XDEC_MEMVIEW(&__pyx_t_12, 0); + __pyx_t_12.memview = NULL; + __pyx_t_12.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_14, 0); + __pyx_t_14.memview = NULL; + __pyx_t_14.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_8, 0); + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_15, 0); + __pyx_t_15.memview = NULL; + __pyx_t_15.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_16, 0); + __pyx_t_16.memview = NULL; + __pyx_t_16.data = NULL; + } + } + } + } + } + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #endif + } + + /* "cyext_acv.pyx":6603 + * cdef int i, j + * + * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_ddp_intv_rule_weights(X[i], y_X[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "cyext_acv.pyx":6608 + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i], cond[i]) + * + * return np.array(sdp), np.array(weights) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_sdp, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_weights, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __pyx_t_3 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "cyext_acv.pyx":6589 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_ddp_intv_weights(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * const double [:, :, :] & cond, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_15, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1); + __Pyx_AddTraceback("cyext_acv.compute_ddp_intv_weights", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_buffer); + __PYX_XDEC_MEMVIEW(&__pyx_v_partition_byobs, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_weights, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_9cyext_acv_107compute_ddp_intv_weights(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_9cyext_acv_107compute_ddp_intv_weights(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + std::vector > __pyx_v_S; + __Pyx_memviewslice __pyx_v_features = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_thresholds = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_left = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_right = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_cond = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_max_depth; + int __pyx_v_min_node_size; + int __pyx_v_classifier; + __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("compute_ddp_intv_weights (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_y_X,&__pyx_n_s_data,&__pyx_n_s_y_data,&__pyx_n_s_S,&__pyx_n_s_features,&__pyx_n_s_thresholds,&__pyx_n_s_children_left,&__pyx_n_s_children_right,&__pyx_n_s_cond,&__pyx_n_s_max_depth,&__pyx_n_s_min_node_size,&__pyx_n_s_classifier,&__pyx_n_s_t,0}; + PyObject* values[14] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_X)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_intv_weights", 1, 14, 14, 1); __PYX_ERR(0, 6589, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_intv_weights", 1, 14, 14, 2); __PYX_ERR(0, 6589, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_intv_weights", 1, 14, 14, 3); __PYX_ERR(0, 6589, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_S)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_intv_weights", 1, 14, 14, 4); __PYX_ERR(0, 6589, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_features)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_intv_weights", 1, 14, 14, 5); __PYX_ERR(0, 6589, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thresholds)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_intv_weights", 1, 14, 14, 6); __PYX_ERR(0, 6589, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_left)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_intv_weights", 1, 14, 14, 7); __PYX_ERR(0, 6589, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_intv_weights", 1, 14, 14, 8); __PYX_ERR(0, 6589, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_intv_weights", 1, 14, 14, 9); __PYX_ERR(0, 6589, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_intv_weights", 1, 14, 14, 10); __PYX_ERR(0, 6589, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_node_size)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_intv_weights", 1, 14, 14, 11); __PYX_ERR(0, 6589, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classifier)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_intv_weights", 1, 14, 14, 12); __PYX_ERR(0, 6589, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 13: + if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_intv_weights", 1, 14, 14, 13); __PYX_ERR(0, 6589, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_ddp_intv_weights") < 0)) __PYX_ERR(0, 6589, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 14) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + } + __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 6589, __pyx_L3_error) + __pyx_v_y_X = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_X.memview)) __PYX_ERR(0, 6589, __pyx_L3_error) + __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 6589, __pyx_L3_error) + __pyx_v_y_data = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_data.memview)) __PYX_ERR(0, 6589, __pyx_L3_error) + __pyx_v_S = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_int_3e___(values[4]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6589, __pyx_L3_error) + __pyx_v_features = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_features.memview)) __PYX_ERR(0, 6590, __pyx_L3_error) + __pyx_v_thresholds = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_thresholds.memview)) __PYX_ERR(0, 6590, __pyx_L3_error) + __pyx_v_children_left = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_left.memview)) __PYX_ERR(0, 6590, __pyx_L3_error) + __pyx_v_children_right = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_right.memview)) __PYX_ERR(0, 6590, __pyx_L3_error) + __pyx_v_cond = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double__const__(values[9], 0); if (unlikely(!__pyx_v_cond.memview)) __PYX_ERR(0, 6591, __pyx_L3_error) + __pyx_v_max_depth = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6592, __pyx_L3_error) + __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6592, __pyx_L3_error) + __pyx_v_classifier = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6592, __pyx_L3_error) + __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[13], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 6592, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("compute_ddp_intv_weights", 1, 14, 14, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6589, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cyext_acv.compute_ddp_intv_weights", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_9cyext_acv_106compute_ddp_intv_weights(__pyx_self, __pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_cond, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9cyext_acv_106compute_ddp_intv_weights(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, __Pyx_memviewslice __pyx_v_cond, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_ddp_intv_weights", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundLocalError("X"); __PYX_ERR(0, 6589, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_X.memview)) { __Pyx_RaiseUnboundLocalError("y_X"); __PYX_ERR(0, 6589, __pyx_L1_error) } + if (unlikely(!__pyx_v_data.memview)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 6589, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_data.memview)) { __Pyx_RaiseUnboundLocalError("y_data"); __PYX_ERR(0, 6589, __pyx_L1_error) } + if (unlikely(!__pyx_v_features.memview)) { __Pyx_RaiseUnboundLocalError("features"); __PYX_ERR(0, 6589, __pyx_L1_error) } + if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 6589, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 6589, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 6589, __pyx_L1_error) } + if (unlikely(!__pyx_v_cond.memview)) { __Pyx_RaiseUnboundLocalError("cond"); __PYX_ERR(0, 6589, __pyx_L1_error) } + if (unlikely(!__pyx_v_t.memview)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 6589, __pyx_L1_error) } + __pyx_t_1 = __pyx_f_9cyext_acv_compute_ddp_intv_weights(__pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_cond, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cyext_acv.compute_ddp_intv_weights", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_features, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_thresholds, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_left, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_right, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_cond, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_t, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cyext_acv.pyx":6615 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_ddp_intv_same_set(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[int] S, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * const double [:, :, :] & cond, + */ + +static PyObject *__pyx_pw_9cyext_acv_109compute_ddp_intv_same_set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_ddp_intv_same_set(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, __Pyx_memviewslice &__pyx_v_cond, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_buffer = NULL; + __Pyx_memviewslice __pyx_v_partition_byobs = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_N; + __Pyx_memviewslice __pyx_v_sdp = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_weights = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_13; + __Pyx_memviewslice __pyx_t_14 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_15 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_16 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_ddp_intv_same_set", 0); + + /* "cyext_acv.pyx":6620 + * int max_depth, int min_node_size, int & classifier, double[:, :] & t): + * + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) # <<<<<<<<<<<<<< + * buffer[:, :, 0] = -1e+10 + * cdef double [:, :, :] partition_byobs = buffer + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ones); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_X.shape[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_X.shape[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_INCREF(__pyx_int_2); + __Pyx_GIVEREF(__pyx_int_2); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_2); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 6620, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6620, __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 = PyNumber_Multiply(__pyx_float_1e_10, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_buffer = __pyx_t_1; + __pyx_t_1 = 0; + + /* "cyext_acv.pyx":6621 + * + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + * buffer[:, :, 0] = -1e+10 # <<<<<<<<<<<<<< + * cdef double [:, :, :] partition_byobs = buffer + * + */ + if (unlikely(PyObject_SetItem(__pyx_v_buffer, __pyx_tuple__3, __pyx_float_neg_1e_10) < 0)) __PYX_ERR(0, 6621, __pyx_L1_error) + + /* "cyext_acv.pyx":6622 + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + * buffer[:, :, 0] = -1e+10 + * cdef double [:, :, :] partition_byobs = buffer # <<<<<<<<<<<<<< + * + * cdef int N = X.shape[0] + */ + __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_v_buffer, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 6622, __pyx_L1_error) + __pyx_v_partition_byobs = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "cyext_acv.pyx":6624 + * cdef double [:, :, :] partition_byobs = buffer + * + * cdef int N = X.shape[0] # <<<<<<<<<<<<<< + * cdef double[::1] sdp = np.zeros(N) + * cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + */ + __pyx_v_N = (__pyx_v_X.shape[0]); + + /* "cyext_acv.pyx":6625 + * + * cdef int N = X.shape[0] + * cdef double[::1] sdp = np.zeros(N) # <<<<<<<<<<<<<< + * cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + * cdef int i, j + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6625, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6625, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6625, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6625, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 6625, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp = __pyx_t_7; + __pyx_t_7.memview = NULL; + __pyx_t_7.data = NULL; + + /* "cyext_acv.pyx":6626 + * cdef int N = X.shape[0] + * cdef double[::1] sdp = np.zeros(N) + * cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) # <<<<<<<<<<<<<< + * cdef int i, j + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6626, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6626, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6626, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6626, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_data.shape[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6626, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6626, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __pyx_t_5 = 0; + __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_3) < 0) __PYX_ERR(0, 6626, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6626, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 6626, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_weights = __pyx_t_8; + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; + + /* "cyext_acv.pyx":6629 + * cdef int i, j + * + * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_ddp_intv_rule_weights(X[i], y_X[i], data, y_data, S, + * features, thresholds, children_left, children_right, + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + __pyx_t_9 = __pyx_v_N; + if ((1 == 0)) abort(); + { + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) (x) + #define unlikely(x) (x) + #endif + __pyx_t_11 = (__pyx_t_9 - 0 + 1 - 1/abs(1)) / 1; + if (__pyx_t_11 > 0) + { + #ifdef _OPENMP + #pragma omp parallel private(__pyx_t_13, __pyx_t_17) firstprivate(__pyx_t_12, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_8) + #endif /* _OPENMP */ + { + #ifdef _OPENMP + #pragma omp for firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) schedule(dynamic) + #endif /* _OPENMP */ + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_11; __pyx_t_10++){ + { + __pyx_v_i = (int)(0 + 1 * __pyx_t_10); + + /* "cyext_acv.pyx":6630 + * + * for i in prange(N, nogil=True, schedule='dynamic'): + * sdp[i] = single_compute_ddp_intv_rule_weights(X[i], y_X[i], data, y_data, S, # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i], cond[i]) + */ + __pyx_t_12.data = __pyx_v_X.data; + __pyx_t_12.memview = __pyx_v_X.memview; + __PYX_INC_MEMVIEW(&__pyx_t_12, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_X.strides[0]; + __pyx_t_12.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_12.shape[0] = __pyx_v_X.shape[1]; +__pyx_t_12.strides[0] = __pyx_v_X.strides[1]; + __pyx_t_12.suboffsets[0] = -1; + +__pyx_t_13 = __pyx_v_i; + + /* "cyext_acv.pyx":6632 + * sdp[i] = single_compute_ddp_intv_rule_weights(X[i], y_X[i], data, y_data, S, + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i], cond[i]) # <<<<<<<<<<<<<< + * + * return np.array(sdp) + */ + __pyx_t_14.data = __pyx_v_t.data; + __pyx_t_14.memview = __pyx_v_t.memview; + __PYX_INC_MEMVIEW(&__pyx_t_14, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_t.strides[0]; + __pyx_t_14.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_14.shape[0] = __pyx_v_t.shape[1]; +__pyx_t_14.strides[0] = __pyx_v_t.strides[1]; + __pyx_t_14.suboffsets[0] = -1; + +__pyx_t_8.data = __pyx_v_partition_byobs.data; + __pyx_t_8.memview = __pyx_v_partition_byobs.memview; + __PYX_INC_MEMVIEW(&__pyx_t_8, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_partition_byobs.strides[0]; + __pyx_t_8.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_8.shape[0] = __pyx_v_partition_byobs.shape[1]; +__pyx_t_8.strides[0] = __pyx_v_partition_byobs.strides[1]; + __pyx_t_8.suboffsets[0] = -1; + +__pyx_t_8.shape[1] = __pyx_v_partition_byobs.shape[2]; +__pyx_t_8.strides[1] = __pyx_v_partition_byobs.strides[2]; + __pyx_t_8.suboffsets[1] = -1; + +__pyx_t_15.data = __pyx_v_weights.data; + __pyx_t_15.memview = __pyx_v_weights.memview; + __PYX_INC_MEMVIEW(&__pyx_t_15, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_weights.strides[0]; + __pyx_t_15.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_15.shape[0] = __pyx_v_weights.shape[1]; +__pyx_t_15.strides[0] = __pyx_v_weights.strides[1]; + __pyx_t_15.suboffsets[0] = -1; + +__pyx_t_16.data = __pyx_v_cond.data; + __pyx_t_16.memview = __pyx_v_cond.memview; + __PYX_INC_MEMVIEW(&__pyx_t_16, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_cond.strides[0]; + __pyx_t_16.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_16.shape[0] = __pyx_v_cond.shape[1]; +__pyx_t_16.strides[0] = __pyx_v_cond.strides[1]; + __pyx_t_16.suboffsets[0] = -1; + +__pyx_t_16.shape[1] = __pyx_v_cond.shape[2]; +__pyx_t_16.strides[1] = __pyx_v_cond.strides[2]; + __pyx_t_16.suboffsets[1] = -1; + +__pyx_t_17 = __pyx_v_i; + + /* "cyext_acv.pyx":6630 + * + * for i in prange(N, nogil=True, schedule='dynamic'): + * sdp[i] = single_compute_ddp_intv_rule_weights(X[i], y_X[i], data, y_data, S, # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i], cond[i]) + */ + *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_sdp.data) + __pyx_t_17)) )) = __pyx_f_9cyext_acv_single_compute_ddp_intv_rule_weights(__pyx_t_12, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_13)) ))), __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_t_14, __pyx_t_8, __pyx_t_15, __pyx_t_16); + __PYX_XDEC_MEMVIEW(&__pyx_t_12, 0); + __pyx_t_12.memview = NULL; + __pyx_t_12.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_14, 0); + __pyx_t_14.memview = NULL; + __pyx_t_14.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_8, 0); + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_15, 0); + __pyx_t_15.memview = NULL; + __pyx_t_15.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_16, 0); + __pyx_t_16.memview = NULL; + __pyx_t_16.data = NULL; + } + } + } + } + } + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #endif + } + + /* "cyext_acv.pyx":6629 + * cdef int i, j + * + * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_ddp_intv_rule_weights(X[i], y_X[i], data, y_data, S, + * features, thresholds, children_left, children_right, + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "cyext_acv.pyx":6634 + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i], cond[i]) + * + * return np.array(sdp) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_sdp, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "cyext_acv.pyx":6615 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_ddp_intv_same_set(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[int] S, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * const double [:, :, :] & cond, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_15, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1); + __Pyx_AddTraceback("cyext_acv.compute_ddp_intv_same_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_buffer); + __PYX_XDEC_MEMVIEW(&__pyx_v_partition_byobs, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_weights, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_9cyext_acv_109compute_ddp_intv_same_set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_9cyext_acv_109compute_ddp_intv_same_set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + std::vector __pyx_v_S; + __Pyx_memviewslice __pyx_v_features = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_thresholds = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_left = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_right = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_cond = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_max_depth; + int __pyx_v_min_node_size; + int __pyx_v_classifier; + __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("compute_ddp_intv_same_set (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_y_X,&__pyx_n_s_data,&__pyx_n_s_y_data,&__pyx_n_s_S,&__pyx_n_s_features,&__pyx_n_s_thresholds,&__pyx_n_s_children_left,&__pyx_n_s_children_right,&__pyx_n_s_cond,&__pyx_n_s_max_depth,&__pyx_n_s_min_node_size,&__pyx_n_s_classifier,&__pyx_n_s_t,0}; + PyObject* values[14] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_X)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_intv_same_set", 1, 14, 14, 1); __PYX_ERR(0, 6615, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_intv_same_set", 1, 14, 14, 2); __PYX_ERR(0, 6615, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_intv_same_set", 1, 14, 14, 3); __PYX_ERR(0, 6615, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_S)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_intv_same_set", 1, 14, 14, 4); __PYX_ERR(0, 6615, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_features)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_intv_same_set", 1, 14, 14, 5); __PYX_ERR(0, 6615, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thresholds)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_intv_same_set", 1, 14, 14, 6); __PYX_ERR(0, 6615, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_left)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_intv_same_set", 1, 14, 14, 7); __PYX_ERR(0, 6615, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_intv_same_set", 1, 14, 14, 8); __PYX_ERR(0, 6615, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_intv_same_set", 1, 14, 14, 9); __PYX_ERR(0, 6615, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_intv_same_set", 1, 14, 14, 10); __PYX_ERR(0, 6615, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_node_size)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_intv_same_set", 1, 14, 14, 11); __PYX_ERR(0, 6615, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classifier)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_intv_same_set", 1, 14, 14, 12); __PYX_ERR(0, 6615, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 13: + if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_ddp_intv_same_set", 1, 14, 14, 13); __PYX_ERR(0, 6615, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_ddp_intv_same_set") < 0)) __PYX_ERR(0, 6615, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 14) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + } + __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 6615, __pyx_L3_error) + __pyx_v_y_X = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_X.memview)) __PYX_ERR(0, 6615, __pyx_L3_error) + __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 6615, __pyx_L3_error) + __pyx_v_y_data = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_data.memview)) __PYX_ERR(0, 6615, __pyx_L3_error) + __pyx_v_S = __pyx_convert_vector_from_py_int(values[4]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6615, __pyx_L3_error) + __pyx_v_features = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_features.memview)) __PYX_ERR(0, 6616, __pyx_L3_error) + __pyx_v_thresholds = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_thresholds.memview)) __PYX_ERR(0, 6616, __pyx_L3_error) + __pyx_v_children_left = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_left.memview)) __PYX_ERR(0, 6616, __pyx_L3_error) + __pyx_v_children_right = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_right.memview)) __PYX_ERR(0, 6616, __pyx_L3_error) + __pyx_v_cond = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double__const__(values[9], 0); if (unlikely(!__pyx_v_cond.memview)) __PYX_ERR(0, 6617, __pyx_L3_error) + __pyx_v_max_depth = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6618, __pyx_L3_error) + __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6618, __pyx_L3_error) + __pyx_v_classifier = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6618, __pyx_L3_error) + __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[13], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 6618, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("compute_ddp_intv_same_set", 1, 14, 14, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6615, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cyext_acv.compute_ddp_intv_same_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_9cyext_acv_108compute_ddp_intv_same_set(__pyx_self, __pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_cond, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9cyext_acv_108compute_ddp_intv_same_set(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, __Pyx_memviewslice __pyx_v_cond, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_ddp_intv_same_set", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundLocalError("X"); __PYX_ERR(0, 6615, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_X.memview)) { __Pyx_RaiseUnboundLocalError("y_X"); __PYX_ERR(0, 6615, __pyx_L1_error) } + if (unlikely(!__pyx_v_data.memview)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 6615, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_data.memview)) { __Pyx_RaiseUnboundLocalError("y_data"); __PYX_ERR(0, 6615, __pyx_L1_error) } + if (unlikely(!__pyx_v_features.memview)) { __Pyx_RaiseUnboundLocalError("features"); __PYX_ERR(0, 6615, __pyx_L1_error) } + if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 6615, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 6615, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 6615, __pyx_L1_error) } + if (unlikely(!__pyx_v_cond.memview)) { __Pyx_RaiseUnboundLocalError("cond"); __PYX_ERR(0, 6615, __pyx_L1_error) } + if (unlikely(!__pyx_v_t.memview)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 6615, __pyx_L1_error) } + __pyx_t_1 = __pyx_f_9cyext_acv_compute_ddp_intv_same_set(__pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_cond, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cyext_acv.compute_ddp_intv_same_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_features, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_thresholds, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_left, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_right, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_cond, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_t, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cyext_acv.pyx":6641 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef global_ddp_intv(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * const double [:, :, :] & cond, + */ + +static PyObject *__pyx_pw_9cyext_acv_111global_ddp_intv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_global_ddp_intv(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, __Pyx_memviewslice &__pyx_v_cond, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, PyObject *__pyx_v_C, double __pyx_v_pi_level, int __pyx_v_minimal, int __pyx_v_stop, PyObject *__pyx_v_search_space, CYTHON_UNUSED int __pyx_skip_dispatch) { + unsigned int __pyx_v_N; + unsigned int __pyx_v_m; + __Pyx_memviewslice __pyx_v_sdp = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_sdp_b = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_sdp_ba = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_sdp_global = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_in_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_i; + int __pyx_v_s; + int __pyx_v_s_0; + int __pyx_v_s_1; + int __pyx_v_S_size; + int __pyx_v_max_size; + int __pyx_v_size; + std::vector __pyx_v_S; + std::vector __pyx_v_len_s_star; + PyObject *__pyx_v_power = 0; + PyObject *__pyx_v_va_id = 0; + std::vector __pyx_v_R; + std::vector __pyx_v_r; + __Pyx_memviewslice __pyx_v_R_buf = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_X_arr = NULL; + PyObject *__pyx_v_y_X_arr = NULL; + PyObject *__pyx_v_cond_arr = NULL; + PyObject *__pyx_v_t_arr = NULL; + PyObject *__pyx_v_remove_va = NULL; + Py_ssize_t __pyx_v_ci; + Py_ssize_t __pyx_v_cj; + PyObject *__pyx_v_power_b = NULL; + PyObject *__pyx_v_co = NULL; + std::vector > > __pyx_v_power_cpp; + __Pyx_memviewslice __pyx_v_s_star = { 0, 0, { 0 }, { 0 }, { 0 } }; + CYTHON_UNUSED long __pyx_v_power_set_size; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_t_6 = NULL; + std::vector __pyx_t_7; + unsigned int __pyx_t_8; + unsigned int __pyx_t_9; + int __pyx_t_10; + __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_t_19; + long __pyx_t_20; + long __pyx_t_21; + int __pyx_t_22; + PyObject *(*__pyx_t_23)(PyObject *); + PyObject *__pyx_t_24 = NULL; + int __pyx_t_25; + std::vector > > __pyx_t_26; + __Pyx_memviewslice __pyx_t_27 = { 0, 0, { 0 }, { 0 }, { 0 } }; + std::vector > ::size_type __pyx_t_28; + std::vector > ::size_type __pyx_t_29; + std::vector ::size_type __pyx_t_30; + std::vector ::size_type __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + __Pyx_memviewslice __pyx_t_34 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_35 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_36 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_37 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + int __pyx_t_40; + int __pyx_t_41; + int __pyx_t_42; + PyObject *__pyx_t_43 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("global_ddp_intv", 0); + + /* "cyext_acv.pyx":6647 + * int minimal, bint stop, list search_space): + * + * cdef unsigned int N = X.shape[0] # <<<<<<<<<<<<<< + * cdef unsigned int m = X.shape[1] + * + */ + __pyx_v_N = (__pyx_v_X.shape[0]); + + /* "cyext_acv.pyx":6648 + * + * cdef unsigned int N = X.shape[0] + * cdef unsigned int m = X.shape[1] # <<<<<<<<<<<<<< + * + * cdef double[:] sdp, sdp_b, sdp_ba + */ + __pyx_v_m = (__pyx_v_X.shape[1]); + + /* "cyext_acv.pyx":6653 + * cdef double[:] sdp_global + * cdef double[:] in_data + * sdp = np.zeros((N)) # <<<<<<<<<<<<<< + * sdp_b = np.zeros((N)) + * sdp_global = np.zeros((m)) + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 6653, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":6654 + * cdef double[:] in_data + * sdp = np.zeros((N)) + * sdp_b = np.zeros((N)) # <<<<<<<<<<<<<< + * sdp_global = np.zeros((m)) + * in_data = np.zeros(N) + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6654, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6654, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6654, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6654, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 6654, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp_b = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":6655 + * sdp = np.zeros((N)) + * sdp_b = np.zeros((N)) + * sdp_global = np.zeros((m)) # <<<<<<<<<<<<<< + * in_data = np.zeros(N) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6655, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6655, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_m); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6655, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6655, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 6655, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp_global = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":6656 + * sdp_b = np.zeros((N)) + * sdp_global = np.zeros((m)) + * in_data = np.zeros(N) # <<<<<<<<<<<<<< + * + * cdef unsigned int it, it_s, a_it, b_it, o_all, p, p_s, nb_leaf, p_u, p_d, p_su, p_sd, down, up + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6656, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6656, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6656, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6656, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 6656, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_in_data = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":6663 + * + * cdef vector[int] S, len_s_star + * len_s_star = np.zeros((N), dtype=np.int) # <<<<<<<<<<<<<< + * + * cdef list power, va_id + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6663, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6663, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6663, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6663, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6663, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6663, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6663, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 6663, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6663, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = __pyx_convert_vector_from_py_int(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6663, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_len_s_star = __pyx_t_7; + + /* "cyext_acv.pyx":6668 + * + * cdef vector[long] R, r + * R.resize(N) # <<<<<<<<<<<<<< + * for i in range(N): + * R[i] = i + */ + try { + __pyx_v_R.resize(__pyx_v_N); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 6668, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6669 + * cdef vector[long] R, r + * R.resize(N) + * for i in range(N): # <<<<<<<<<<<<<< + * R[i] = i + * r.resize(N) + */ + __pyx_t_8 = __pyx_v_N; + __pyx_t_9 = __pyx_t_8; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "cyext_acv.pyx":6670 + * R.resize(N) + * for i in range(N): + * R[i] = i # <<<<<<<<<<<<<< + * r.resize(N) + * + */ + (__pyx_v_R[__pyx_v_i]) = __pyx_v_i; + } + + /* "cyext_acv.pyx":6671 + * for i in range(N): + * R[i] = i + * r.resize(N) # <<<<<<<<<<<<<< + * + * cdef long[:] R_buf + */ + try { + __pyx_v_r.resize(__pyx_v_N); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 6671, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6674 + * + * cdef long[:] R_buf + * R_buf = np.zeros((N), dtype=np.int) # <<<<<<<<<<<<<< + * + * X_arr = np.array(X, dtype=np.double) + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 6674, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6674, __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(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_long(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 6674, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_R_buf = __pyx_t_11; + __pyx_t_11.memview = NULL; + __pyx_t_11.data = NULL; + + /* "cyext_acv.pyx":6676 + * R_buf = np.zeros((N), dtype=np.int) + * + * X_arr = np.array(X, dtype=np.double) # <<<<<<<<<<<<<< + * y_X_arr = np.array(y_X, dtype=np.double) + * cond_arr = np.array(cond) + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6676, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6676, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_X, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6676, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6676, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6676, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6676, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_double); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6676, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 6676, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6676, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_X_arr = __pyx_t_2; + __pyx_t_2 = 0; + + /* "cyext_acv.pyx":6677 + * + * X_arr = np.array(X, dtype=np.double) + * y_X_arr = np.array(y_X, dtype=np.double) # <<<<<<<<<<<<<< + * cond_arr = np.array(cond) + * t_arr = np.array(t, dtype=np.double) + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6677, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6677, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_y_X, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6677, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6677, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6677, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6677, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_double); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6677, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 6677, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6677, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_y_X_arr = __pyx_t_1; + __pyx_t_1 = 0; + + /* "cyext_acv.pyx":6678 + * X_arr = np.array(X, dtype=np.double) + * y_X_arr = np.array(y_X, dtype=np.double) + * cond_arr = np.array(cond) # <<<<<<<<<<<<<< + * t_arr = np.array(t, dtype=np.double) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6678, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6678, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_cond, 3, (PyObject *(*)(char *)) __pyx_memview_get_double__const__, (int (*)(char *, PyObject *)) NULL, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6678, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6678, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_cond_arr = __pyx_t_1; + __pyx_t_1 = 0; + + /* "cyext_acv.pyx":6679 + * y_X_arr = np.array(y_X, dtype=np.double) + * cond_arr = np.array(cond) + * t_arr = np.array(t, dtype=np.double) # <<<<<<<<<<<<<< + * + * # buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_t, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 6679, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_t_arr = __pyx_t_6; + __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6686 + * # cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + * + * if C[0] != []: # <<<<<<<<<<<<<< + * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] + * va_id = [[i] for i in search_space if i not in remove_va] + */ + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 6686, __pyx_L1_error) + } + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6686, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyObject_RichCompare(PyList_GET_ITEM(__pyx_v_C, 0), __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6686, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 6686, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_12) { + + /* "cyext_acv.pyx":6687 + * + * if C[0] != []: + * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] # <<<<<<<<<<<<<< + * va_id = [[i] for i in search_space if i not in remove_va] + * for ci in range(len(C)): + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 6687, __pyx_L1_error) + } + __pyx_t_13 = PyList_GET_SIZE(__pyx_v_C); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6687, __pyx_L1_error) + __pyx_t_14 = __pyx_t_13; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_ci = __pyx_t_15; + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 6687, __pyx_L1_error) + } + __pyx_t_6 = PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci); + __Pyx_INCREF(__pyx_t_6); + __pyx_t_16 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6687, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_17 = __pyx_t_16; + for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { + __pyx_v_cj = __pyx_t_18; + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 6687, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_GetItemInt(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci), __pyx_v_cj, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 6687, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + } + __pyx_v_remove_va = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "cyext_acv.pyx":6688 + * if C[0] != []: + * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] + * va_id = [[i] for i in search_space if i not in remove_va] # <<<<<<<<<<<<<< + * for ci in range(len(C)): + * i = 0 + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6688, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__pyx_v_search_space == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 6688, __pyx_L1_error) + } + __pyx_t_6 = __pyx_v_search_space; __Pyx_INCREF(__pyx_t_6); __pyx_t_13 = 0; + for (;;) { + if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_6)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 6688, __pyx_L1_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6688, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6688, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_i = __pyx_t_10; + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6688, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_v_remove_va, Py_NE)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 6688, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_19 = (__pyx_t_12 != 0); + if (__pyx_t_19) { + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6688, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6688, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __pyx_t_2 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 6688, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_va_id = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "cyext_acv.pyx":6689 + * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] + * va_id = [[i] for i in search_space if i not in remove_va] + * for ci in range(len(C)): # <<<<<<<<<<<<<< + * i = 0 + * for cj in range(len(C[ci])): + */ + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 6689, __pyx_L1_error) + } + __pyx_t_13 = PyList_GET_SIZE(__pyx_v_C); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6689, __pyx_L1_error) + __pyx_t_14 = __pyx_t_13; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_ci = __pyx_t_15; + + /* "cyext_acv.pyx":6690 + * va_id = [[i] for i in search_space if i not in remove_va] + * for ci in range(len(C)): + * i = 0 # <<<<<<<<<<<<<< + * for cj in range(len(C[ci])): + * if C[ci][cj] in search_space: + */ + __pyx_v_i = 0; + + /* "cyext_acv.pyx":6691 + * for ci in range(len(C)): + * i = 0 + * for cj in range(len(C[ci])): # <<<<<<<<<<<<<< + * if C[ci][cj] in search_space: + * i += 1 + */ + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 6691, __pyx_L1_error) + } + __pyx_t_1 = PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_16 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6691, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_17 = __pyx_t_16; + for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { + __pyx_v_cj = __pyx_t_18; + + /* "cyext_acv.pyx":6692 + * i = 0 + * for cj in range(len(C[ci])): + * if C[ci][cj] in search_space: # <<<<<<<<<<<<<< + * i += 1 + * break + */ + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 6692, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci), __pyx_v_cj, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6692, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_19 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_search_space, Py_EQ)); if (unlikely(__pyx_t_19 < 0)) __PYX_ERR(0, 6692, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_12 = (__pyx_t_19 != 0); + if (__pyx_t_12) { + + /* "cyext_acv.pyx":6693 + * for cj in range(len(C[ci])): + * if C[ci][cj] in search_space: + * i += 1 # <<<<<<<<<<<<<< + * break + * if i != 0: + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "cyext_acv.pyx":6694 + * if C[ci][cj] in search_space: + * i += 1 + * break # <<<<<<<<<<<<<< + * if i != 0: + * va_id += [C[ci]] + */ + goto __pyx_L16_break; + + /* "cyext_acv.pyx":6692 + * i = 0 + * for cj in range(len(C[ci])): + * if C[ci][cj] in search_space: # <<<<<<<<<<<<<< + * i += 1 + * break + */ + } + } + __pyx_L16_break:; + + /* "cyext_acv.pyx":6695 + * i += 1 + * break + * if i != 0: # <<<<<<<<<<<<<< + * va_id += [C[ci]] + * else: + */ + __pyx_t_12 = ((__pyx_v_i != 0) != 0); + if (__pyx_t_12) { + + /* "cyext_acv.pyx":6696 + * break + * if i != 0: + * va_id += [C[ci]] # <<<<<<<<<<<<<< + * else: + * va_id = [[i] for i in search_space] + */ + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 6696, __pyx_L1_error) + } + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6696, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci)); + __Pyx_GIVEREF(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci)); + PyList_SET_ITEM(__pyx_t_1, 0, PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci)); + __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_va_id, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6696, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_va_id, ((PyObject*)__pyx_t_6)); + __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6695 + * i += 1 + * break + * if i != 0: # <<<<<<<<<<<<<< + * va_id += [C[ci]] + * else: + */ + } + } + + /* "cyext_acv.pyx":6686 + * # cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + * + * if C[0] != []: # <<<<<<<<<<<<<< + * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] + * va_id = [[i] for i in search_space if i not in remove_va] + */ + goto __pyx_L5; + } + + /* "cyext_acv.pyx":6698 + * va_id += [C[ci]] + * else: + * va_id = [[i] for i in search_space] # <<<<<<<<<<<<<< + * + * m = len(va_id) + */ + /*else*/ { + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__pyx_v_search_space == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 6698, __pyx_L1_error) + } + __pyx_t_1 = __pyx_v_search_space; __Pyx_INCREF(__pyx_t_1); __pyx_t_13 = 0; + for (;;) { + if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 6698, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6698, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_i = __pyx_t_10; + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __pyx_t_3 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 6698, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_va_id = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + } + __pyx_L5:; + + /* "cyext_acv.pyx":6700 + * va_id = [[i] for i in search_space] + * + * m = len(va_id) # <<<<<<<<<<<<<< + * power = [] + * max_size = 0 + */ + __pyx_t_13 = PyList_GET_SIZE(__pyx_v_va_id); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 6700, __pyx_L1_error) + __pyx_v_m = __pyx_t_13; + + /* "cyext_acv.pyx":6701 + * + * m = len(va_id) + * power = [] # <<<<<<<<<<<<<< + * max_size = 0 + * for size in range(m + 1): + */ + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6701, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_power = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6702 + * m = len(va_id) + * power = [] + * max_size = 0 # <<<<<<<<<<<<<< + * for size in range(m + 1): + * power_b = [] + */ + __pyx_v_max_size = 0; + + /* "cyext_acv.pyx":6703 + * power = [] + * max_size = 0 + * for size in range(m + 1): # <<<<<<<<<<<<<< + * power_b = [] + * for co in itertools.combinations(va_id, size): + */ + __pyx_t_20 = (__pyx_v_m + 1); + __pyx_t_21 = __pyx_t_20; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_21; __pyx_t_10+=1) { + __pyx_v_size = __pyx_t_10; + + /* "cyext_acv.pyx":6704 + * max_size = 0 + * for size in range(m + 1): + * power_b = [] # <<<<<<<<<<<<<< + * for co in itertools.combinations(va_id, size): + * power_b.append(np.array(sum(list(co),[]))) + */ + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6704, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_power_b, ((PyObject*)__pyx_t_6)); + __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6705 + * for size in range(m + 1): + * power_b = [] + * for co in itertools.combinations(va_id, size): # <<<<<<<<<<<<<< + * power_b.append(np.array(sum(list(co),[]))) + * max_size += 1 + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_itertools); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6705, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_combinations); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6705, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6705, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = NULL; + __pyx_t_22 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_22 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_va_id, __pyx_t_1}; + __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6705, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_va_id, __pyx_t_1}; + __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6705, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + { + __pyx_t_4 = PyTuple_New(2+__pyx_t_22); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6705, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(__pyx_v_va_id); + __Pyx_GIVEREF(__pyx_v_va_id); + PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_22, __pyx_v_va_id); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_22, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6705, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) { + __pyx_t_2 = __pyx_t_6; __Pyx_INCREF(__pyx_t_2); __pyx_t_13 = 0; + __pyx_t_23 = NULL; + } else { + __pyx_t_13 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6705, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_23 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 6705, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + for (;;) { + if (likely(!__pyx_t_23)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 6705, __pyx_L1_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6705, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } else { + if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 6705, __pyx_L1_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6705, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } + } else { + __pyx_t_6 = __pyx_t_23(__pyx_t_2); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 6705, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_co, __pyx_t_6); + __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6706 + * power_b = [] + * for co in itertools.combinations(va_id, size): + * power_b.append(np.array(sum(list(co),[]))) # <<<<<<<<<<<<<< + * max_size += 1 + * power.append(power_b) + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6706, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6706, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PySequence_List(__pyx_v_co); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6706, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6706, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_24 = PyTuple_New(2); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6706, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_3); + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_24, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6706, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_24 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_24)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_24); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_6 = (__pyx_t_24) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_24, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6706, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_25 = __Pyx_PyList_Append(__pyx_v_power_b, __pyx_t_6); if (unlikely(__pyx_t_25 == ((int)-1))) __PYX_ERR(0, 6706, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6707 + * for co in itertools.combinations(va_id, size): + * power_b.append(np.array(sum(list(co),[]))) + * max_size += 1 # <<<<<<<<<<<<<< + * power.append(power_b) + * if max_size >= 2**15: + */ + __pyx_v_max_size = (__pyx_v_max_size + 1); + + /* "cyext_acv.pyx":6705 + * for size in range(m + 1): + * power_b = [] + * for co in itertools.combinations(va_id, size): # <<<<<<<<<<<<<< + * power_b.append(np.array(sum(list(co),[]))) + * max_size += 1 + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "cyext_acv.pyx":6708 + * power_b.append(np.array(sum(list(co),[]))) + * max_size += 1 + * power.append(power_b) # <<<<<<<<<<<<<< + * if max_size >= 2**15: + * break + */ + __pyx_t_25 = __Pyx_PyList_Append(__pyx_v_power, __pyx_v_power_b); if (unlikely(__pyx_t_25 == ((int)-1))) __PYX_ERR(0, 6708, __pyx_L1_error) + + /* "cyext_acv.pyx":6709 + * max_size += 1 + * power.append(power_b) + * if max_size >= 2**15: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_12 = ((__pyx_v_max_size >= 0x8000) != 0); + if (__pyx_t_12) { + + /* "cyext_acv.pyx":6710 + * power.append(power_b) + * if max_size >= 2**15: + * break # <<<<<<<<<<<<<< + * + * cdef vector[vector[vector[long]]] power_cpp = power + */ + goto __pyx_L22_break; + + /* "cyext_acv.pyx":6709 + * max_size += 1 + * power.append(power_b) + * if max_size >= 2**15: # <<<<<<<<<<<<<< + * break + * + */ + } + } + __pyx_L22_break:; + + /* "cyext_acv.pyx":6712 + * break + * + * cdef vector[vector[vector[long]]] power_cpp = power # <<<<<<<<<<<<<< + * cdef long[:, :] s_star + * s_star = -1*np.ones((N, X.shape[1]), dtype=np.int) + */ + __pyx_t_26 = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_std_3a__3a_vector_3c_long_3e____3e___(__pyx_v_power); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6712, __pyx_L1_error) + __pyx_v_power_cpp = __pyx_t_26; + + /* "cyext_acv.pyx":6714 + * cdef vector[vector[vector[long]]] power_cpp = power + * cdef long[:, :] s_star + * s_star = -1*np.ones((N, X.shape[1]), dtype=np.int) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6714, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ones); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6714, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6714, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_X.shape[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6714, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6714, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6714, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6714, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6714, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6714, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_24) < 0) __PYX_ERR(0, 6714, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6714, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Multiply(__pyx_int_neg_1, __pyx_t_24); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6714, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_27 = __Pyx_PyObject_to_MemoryviewSlice_dsds_long(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_27.memview)) __PYX_ERR(0, 6714, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_s_star = __pyx_t_27; + __pyx_t_27.memview = NULL; + __pyx_t_27.data = NULL; + + /* "cyext_acv.pyx":6717 + * + * + * cdef long power_set_size = 2**m # <<<<<<<<<<<<<< + * S = np.zeros((data.shape[1]), dtype=np.int) + * + */ + __pyx_v_power_set_size = __Pyx_pow_long(2, ((long)__pyx_v_m)); + + /* "cyext_acv.pyx":6718 + * + * cdef long power_set_size = 2**m + * S = np.zeros((data.shape[1]), dtype=np.int) # <<<<<<<<<<<<<< + * + * for s_0 in tqdm(range(minimal, m + 1)): + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6718, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6718, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_data.shape[1])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6718, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6718, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6718, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6718, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6718, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 6718, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_24, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6718, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = __pyx_convert_vector_from_py_int(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6718, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_S = __pyx_t_7; + + /* "cyext_acv.pyx":6720 + * S = np.zeros((data.shape[1]), dtype=np.int) + * + * for s_0 in tqdm(range(minimal, m + 1)): # <<<<<<<<<<<<<< + * for s_1 in range(0, power_cpp[s_0].size()): + * for i in range(power_cpp[s_0][s_1].size()): + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_tqdm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6720, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_minimal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6720, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_24 = __Pyx_PyInt_From_long((__pyx_v_m + 1)); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6720, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6720, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_24); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_24); + __pyx_t_1 = 0; + __pyx_t_24 = 0; + __pyx_t_24 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_6, NULL); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6720, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_t_24) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_24); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6720, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_13 = 0; + __pyx_t_23 = NULL; + } else { + __pyx_t_13 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6720, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_23 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 6720, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (likely(!__pyx_t_23)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 6720, __pyx_L1_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6720, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } else { + if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 6720, __pyx_L1_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6720, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } + } else { + __pyx_t_2 = __pyx_t_23(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 6720, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6720, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_s_0 = __pyx_t_10; + + /* "cyext_acv.pyx":6721 + * + * for s_0 in tqdm(range(minimal, m + 1)): + * for s_1 in range(0, power_cpp[s_0].size()): # <<<<<<<<<<<<<< + * for i in range(power_cpp[s_0][s_1].size()): + * S[i] = power_cpp[s_0][s_1][i] + */ + __pyx_t_28 = (__pyx_v_power_cpp[__pyx_v_s_0]).size(); + __pyx_t_29 = __pyx_t_28; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_29; __pyx_t_10+=1) { + __pyx_v_s_1 = __pyx_t_10; + + /* "cyext_acv.pyx":6722 + * for s_0 in tqdm(range(minimal, m + 1)): + * for s_1 in range(0, power_cpp[s_0].size()): + * for i in range(power_cpp[s_0][s_1].size()): # <<<<<<<<<<<<<< + * S[i] = power_cpp[s_0][s_1][i] + * + */ + __pyx_t_30 = ((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1]).size(); + __pyx_t_31 = __pyx_t_30; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_31; __pyx_t_22+=1) { + __pyx_v_i = __pyx_t_22; + + /* "cyext_acv.pyx":6723 + * for s_1 in range(0, power_cpp[s_0].size()): + * for i in range(power_cpp[s_0][s_1].size()): + * S[i] = power_cpp[s_0][s_1][i] # <<<<<<<<<<<<<< + * + * S_size = power_cpp[s_0][s_1].size() + */ + (__pyx_v_S[__pyx_v_i]) = (((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1])[__pyx_v_i]); + } + + /* "cyext_acv.pyx":6725 + * S[i] = power_cpp[s_0][s_1][i] + * + * S_size = power_cpp[s_0][s_1].size() # <<<<<<<<<<<<<< + * r.clear() + * N = R.size() + */ + __pyx_v_S_size = ((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1]).size(); + + /* "cyext_acv.pyx":6726 + * + * S_size = power_cpp[s_0][s_1].size() + * r.clear() # <<<<<<<<<<<<<< + * N = R.size() + * in_data = np.zeros(X.shape[0]) + */ + __pyx_v_r.clear(); + + /* "cyext_acv.pyx":6727 + * S_size = power_cpp[s_0][s_1].size() + * r.clear() + * N = R.size() # <<<<<<<<<<<<<< + * in_data = np.zeros(X.shape[0]) + * + */ + __pyx_v_N = __pyx_v_R.size(); + + /* "cyext_acv.pyx":6728 + * r.clear() + * N = R.size() + * in_data = np.zeros(X.shape[0]) # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __Pyx_GetModuleGlobalName(__pyx_t_24, __pyx_n_s_np); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6728, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_24, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6728, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = PyInt_FromSsize_t((__pyx_v_X.shape[0])); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6728, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_1, __pyx_t_24) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_24); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6728, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 6728, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_in_data, 1); + __pyx_v_in_data = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":6730 + * in_data = np.zeros(X.shape[0]) + * + * for i in range(N): # <<<<<<<<<<<<<< + * R_buf[i] = R[i] + * in_data[R_buf[i]] = 1 + */ + __pyx_t_8 = __pyx_v_N; + __pyx_t_9 = __pyx_t_8; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_9; __pyx_t_22+=1) { + __pyx_v_i = __pyx_t_22; + + /* "cyext_acv.pyx":6731 + * + * for i in range(N): + * R_buf[i] = R[i] # <<<<<<<<<<<<<< + * in_data[R_buf[i]] = 1 + * + */ + __pyx_t_32 = __pyx_v_i; + *((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_32 * __pyx_v_R_buf.strides[0]) )) = (__pyx_v_R[__pyx_v_i]); + + /* "cyext_acv.pyx":6732 + * for i in range(N): + * R_buf[i] = R[i] + * in_data[R_buf[i]] = 1 # <<<<<<<<<<<<<< + * + * # sdp_b[R_buf[i]] = single_compute_ddp_intv_rule_weights(X[R_buf[i]], y_X[R_buf[i]], data, y_data, S[:S_size], + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_32 * __pyx_v_R_buf.strides[0]) ))); + *((double *) ( /* dim=0 */ (__pyx_v_in_data.data + __pyx_t_33 * __pyx_v_in_data.strides[0]) )) = 1.0; + } + + /* "cyext_acv.pyx":6739 + * # partition_byobs[R_buf[i]], weights[R_buf[i]], cond[R_buf[i]]) + * + * sdp_ba = compute_ddp_intv_same_set(X_arr[np.array(in_data, dtype=bool)], # <<<<<<<<<<<<<< + * y_X_arr[np.array(in_data, dtype=bool)], + * data, y_data, S[:S_size], features, thresholds, children_left, + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6739, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6739, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_in_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6739, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_24 = PyTuple_New(1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6739, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6739, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 6739, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_24, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6739, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_X_arr, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6739, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_34 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_34.memview)) __PYX_ERR(0, 6739, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "cyext_acv.pyx":6740 + * + * sdp_ba = compute_ddp_intv_same_set(X_arr[np.array(in_data, dtype=bool)], + * y_X_arr[np.array(in_data, dtype=bool)], # <<<<<<<<<<<<<< + * data, y_data, S[:S_size], features, thresholds, children_left, + * children_right, cond_arr[np.array(in_data, dtype=bool)], max_depth, min_node_size, classifier, t_arr[np.array(in_data, dtype=bool)]) + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6740, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6740, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_in_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6740, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_24 = PyTuple_New(1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6740, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6740, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 6740, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_24, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6740, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_y_X_arr, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6740, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_35 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_35.memview)) __PYX_ERR(0, 6740, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "cyext_acv.pyx":6741 + * sdp_ba = compute_ddp_intv_same_set(X_arr[np.array(in_data, dtype=bool)], + * y_X_arr[np.array(in_data, dtype=bool)], + * data, y_data, S[:S_size], features, thresholds, children_left, # <<<<<<<<<<<<<< + * children_right, cond_arr[np.array(in_data, dtype=bool)], max_depth, min_node_size, classifier, t_arr[np.array(in_data, dtype=bool)]) + * + */ + __pyx_t_2 = __pyx_convert_vector_to_py_int(__pyx_v_S); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6741, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, __pyx_v_S_size, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6741, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __pyx_convert_vector_from_py_int(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6741, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6742 + * y_X_arr[np.array(in_data, dtype=bool)], + * data, y_data, S[:S_size], features, thresholds, children_left, + * children_right, cond_arr[np.array(in_data, dtype=bool)], max_depth, min_node_size, classifier, t_arr[np.array(in_data, dtype=bool)]) # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6742, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6742, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_in_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6742, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_24 = PyTuple_New(1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6742, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6742, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 6742, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_24, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6742, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_cond_arr, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6742, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_36 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double__const__(__pyx_t_6, 0); if (unlikely(!__pyx_t_36.memview)) __PYX_ERR(0, 6742, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6742, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6742, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_in_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6742, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_24 = PyTuple_New(1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6742, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6742, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 6742, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_24, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6742, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_t_arr, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6742, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_37 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_37.memview)) __PYX_ERR(0, 6742, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "cyext_acv.pyx":6739 + * # partition_byobs[R_buf[i]], weights[R_buf[i]], cond[R_buf[i]]) + * + * sdp_ba = compute_ddp_intv_same_set(X_arr[np.array(in_data, dtype=bool)], # <<<<<<<<<<<<<< + * y_X_arr[np.array(in_data, dtype=bool)], + * data, y_data, S[:S_size], features, thresholds, children_left, + */ + __pyx_t_6 = __pyx_f_9cyext_acv_compute_ddp_intv_same_set(__pyx_t_34, __pyx_t_35, __pyx_v_data, __pyx_v_y_data, __pyx_t_7, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_t_36, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_t_37, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6739, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __PYX_XDEC_MEMVIEW(&__pyx_t_34, 1); + __pyx_t_34.memview = NULL; + __pyx_t_34.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_35, 1); + __pyx_t_35.memview = NULL; + __pyx_t_35.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_36, 1); + __pyx_t_36.memview = NULL; + __pyx_t_36.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_37, 1); + __pyx_t_37.memview = NULL; + __pyx_t_37.data = NULL; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 6739, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp_ba, 1); + __pyx_v_sdp_ba = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":6744 + * children_right, cond_arr[np.array(in_data, dtype=bool)], max_depth, min_node_size, classifier, t_arr[np.array(in_data, dtype=bool)]) + * + * for i in range(N): # <<<<<<<<<<<<<< + * sdp_b[R_buf[i]] = sdp_ba[i] + * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: + */ + __pyx_t_8 = __pyx_v_N; + __pyx_t_9 = __pyx_t_8; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_9; __pyx_t_22+=1) { + __pyx_v_i = __pyx_t_22; + + /* "cyext_acv.pyx":6745 + * + * for i in range(N): + * sdp_b[R_buf[i]] = sdp_ba[i] # <<<<<<<<<<<<<< + * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: + * sdp[R_buf[i]] = sdp_b[R_buf[i]] + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = __pyx_v_i; + __pyx_t_38 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_33 * __pyx_v_R_buf.strides[0]) ))); + *((double *) ( /* dim=0 */ (__pyx_v_sdp_b.data + __pyx_t_38 * __pyx_v_sdp_b.strides[0]) )) = (*((double *) ( /* dim=0 */ (__pyx_v_sdp_ba.data + __pyx_t_32 * __pyx_v_sdp_ba.strides[0]) ))); + + /* "cyext_acv.pyx":6746 + * for i in range(N): + * sdp_b[R_buf[i]] = sdp_ba[i] + * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: # <<<<<<<<<<<<<< + * sdp[R_buf[i]] = sdp_b[R_buf[i]] + * len_s_star[R_buf[i]] = S_size + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_32 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_38 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_12 = (((*((double *) ( /* dim=0 */ (__pyx_v_sdp_b.data + __pyx_t_33 * __pyx_v_sdp_b.strides[0]) ))) >= (*((double *) ( /* dim=0 */ (__pyx_v_sdp.data + __pyx_t_39 * __pyx_v_sdp.strides[0]) )))) != 0); + if (__pyx_t_12) { + + /* "cyext_acv.pyx":6747 + * sdp_b[R_buf[i]] = sdp_ba[i] + * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: + * sdp[R_buf[i]] = sdp_b[R_buf[i]] # <<<<<<<<<<<<<< + * len_s_star[R_buf[i]] = S_size + * for s in range(S_size): + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_38 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_32 * __pyx_v_R_buf.strides[0]) ))); + *((double *) ( /* dim=0 */ (__pyx_v_sdp.data + __pyx_t_33 * __pyx_v_sdp.strides[0]) )) = (*((double *) ( /* dim=0 */ (__pyx_v_sdp_b.data + __pyx_t_39 * __pyx_v_sdp_b.strides[0]) ))); + + /* "cyext_acv.pyx":6748 + * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: + * sdp[R_buf[i]] = sdp_b[R_buf[i]] + * len_s_star[R_buf[i]] = S_size # <<<<<<<<<<<<<< + * for s in range(S_size): + * s_star[R_buf[i], s] = S[s] + */ + __pyx_t_38 = __pyx_v_i; + (__pyx_v_len_s_star[(*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_38 * __pyx_v_R_buf.strides[0]) )))]) = __pyx_v_S_size; + + /* "cyext_acv.pyx":6749 + * sdp[R_buf[i]] = sdp_b[R_buf[i]] + * len_s_star[R_buf[i]] = S_size + * for s in range(S_size): # <<<<<<<<<<<<<< + * s_star[R_buf[i], s] = S[s] + * + */ + __pyx_t_40 = __pyx_v_S_size; + __pyx_t_41 = __pyx_t_40; + for (__pyx_t_42 = 0; __pyx_t_42 < __pyx_t_41; __pyx_t_42+=1) { + __pyx_v_s = __pyx_t_42; + + /* "cyext_acv.pyx":6750 + * len_s_star[R_buf[i]] = S_size + * for s in range(S_size): + * s_star[R_buf[i], s] = S[s] # <<<<<<<<<<<<<< + * + * if S_size == X.shape[1]: + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_38 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_32 = __pyx_v_s; + *((long *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_s_star.data + __pyx_t_39 * __pyx_v_s_star.strides[0]) ) + __pyx_t_32 * __pyx_v_s_star.strides[1]) )) = (__pyx_v_S[__pyx_v_s]); + } + + /* "cyext_acv.pyx":6746 + * for i in range(N): + * sdp_b[R_buf[i]] = sdp_ba[i] + * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: # <<<<<<<<<<<<<< + * sdp[R_buf[i]] = sdp_b[R_buf[i]] + * len_s_star[R_buf[i]] = S_size + */ + } + + /* "cyext_acv.pyx":6752 + * s_star[R_buf[i], s] = S[s] + * + * if S_size == X.shape[1]: # <<<<<<<<<<<<<< + * sdp[R_buf[i]] = 1 + * len_s_star[R_buf[i]] = S_size + */ + __pyx_t_12 = ((__pyx_v_S_size == (__pyx_v_X.shape[1])) != 0); + if (__pyx_t_12) { + + /* "cyext_acv.pyx":6753 + * + * if S_size == X.shape[1]: + * sdp[R_buf[i]] = 1 # <<<<<<<<<<<<<< + * len_s_star[R_buf[i]] = S_size + * for s in range(S_size): + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_32 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_38 * __pyx_v_R_buf.strides[0]) ))); + *((double *) ( /* dim=0 */ (__pyx_v_sdp.data + __pyx_t_32 * __pyx_v_sdp.strides[0]) )) = 1.0; + + /* "cyext_acv.pyx":6754 + * if S_size == X.shape[1]: + * sdp[R_buf[i]] = 1 + * len_s_star[R_buf[i]] = S_size # <<<<<<<<<<<<<< + * for s in range(S_size): + * s_star[R_buf[i], s] = S[s] + */ + __pyx_t_38 = __pyx_v_i; + (__pyx_v_len_s_star[(*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_38 * __pyx_v_R_buf.strides[0]) )))]) = __pyx_v_S_size; + + /* "cyext_acv.pyx":6755 + * sdp[R_buf[i]] = 1 + * len_s_star[R_buf[i]] = S_size + * for s in range(S_size): # <<<<<<<<<<<<<< + * s_star[R_buf[i], s] = S[s] + * for s in range(len_s_star[R_buf[i]], X.shape[1]): # to filter (important for coalition) + */ + __pyx_t_40 = __pyx_v_S_size; + __pyx_t_41 = __pyx_t_40; + for (__pyx_t_42 = 0; __pyx_t_42 < __pyx_t_41; __pyx_t_42+=1) { + __pyx_v_s = __pyx_t_42; + + /* "cyext_acv.pyx":6756 + * len_s_star[R_buf[i]] = S_size + * for s in range(S_size): + * s_star[R_buf[i], s] = S[s] # <<<<<<<<<<<<<< + * for s in range(len_s_star[R_buf[i]], X.shape[1]): # to filter (important for coalition) + * s_star[R_buf[i], s] = -1 + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_32 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_38 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_39 = __pyx_v_s; + *((long *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_s_star.data + __pyx_t_32 * __pyx_v_s_star.strides[0]) ) + __pyx_t_39 * __pyx_v_s_star.strides[1]) )) = (__pyx_v_S[__pyx_v_s]); + } + + /* "cyext_acv.pyx":6757 + * for s in range(S_size): + * s_star[R_buf[i], s] = S[s] + * for s in range(len_s_star[R_buf[i]], X.shape[1]): # to filter (important for coalition) # <<<<<<<<<<<<<< + * s_star[R_buf[i], s] = -1 + * + */ + __pyx_t_14 = (__pyx_v_X.shape[1]); + __pyx_t_38 = __pyx_v_i; + __pyx_t_15 = __pyx_t_14; + for (__pyx_t_40 = (__pyx_v_len_s_star[(*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_38 * __pyx_v_R_buf.strides[0]) )))]); __pyx_t_40 < __pyx_t_15; __pyx_t_40+=1) { + __pyx_v_s = __pyx_t_40; + + /* "cyext_acv.pyx":6758 + * s_star[R_buf[i], s] = S[s] + * for s in range(len_s_star[R_buf[i]], X.shape[1]): # to filter (important for coalition) + * s_star[R_buf[i], s] = -1 # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_39 = __pyx_v_i; + __pyx_t_32 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_39 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_33 = __pyx_v_s; + *((long *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_s_star.data + __pyx_t_32 * __pyx_v_s_star.strides[0]) ) + __pyx_t_33 * __pyx_v_s_star.strides[1]) )) = -1L; + } + + /* "cyext_acv.pyx":6752 + * s_star[R_buf[i], s] = S[s] + * + * if S_size == X.shape[1]: # <<<<<<<<<<<<<< + * sdp[R_buf[i]] = 1 + * len_s_star[R_buf[i]] = S_size + */ + } + } + } + + /* "cyext_acv.pyx":6760 + * s_star[R_buf[i], s] = -1 + * + * for i in range(N): # <<<<<<<<<<<<<< + * if sdp[R_buf[i]] >= pi_level: + * r.push_back(R[i]) + */ + __pyx_t_8 = __pyx_v_N; + __pyx_t_9 = __pyx_t_8; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "cyext_acv.pyx":6761 + * + * for i in range(N): + * if sdp[R_buf[i]] >= pi_level: # <<<<<<<<<<<<<< + * r.push_back(R[i]) + * for s in range(len_s_star[R_buf[i]]): + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_38 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_12 = (((*((double *) ( /* dim=0 */ (__pyx_v_sdp.data + __pyx_t_39 * __pyx_v_sdp.strides[0]) ))) >= __pyx_v_pi_level) != 0); + if (__pyx_t_12) { + + /* "cyext_acv.pyx":6762 + * for i in range(N): + * if sdp[R_buf[i]] >= pi_level: + * r.push_back(R[i]) # <<<<<<<<<<<<<< + * for s in range(len_s_star[R_buf[i]]): + * sdp_global[s_star[R_buf[i], s]] += 1 + */ + try { + __pyx_v_r.push_back((__pyx_v_R[__pyx_v_i])); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 6762, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6763 + * if sdp[R_buf[i]] >= pi_level: + * r.push_back(R[i]) + * for s in range(len_s_star[R_buf[i]]): # <<<<<<<<<<<<<< + * sdp_global[s_star[R_buf[i], s]] += 1 + * + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_22 = (__pyx_v_len_s_star[(*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_38 * __pyx_v_R_buf.strides[0]) )))]); + __pyx_t_40 = __pyx_t_22; + for (__pyx_t_41 = 0; __pyx_t_41 < __pyx_t_40; __pyx_t_41+=1) { + __pyx_v_s = __pyx_t_41; + + /* "cyext_acv.pyx":6764 + * r.push_back(R[i]) + * for s in range(len_s_star[R_buf[i]]): + * sdp_global[s_star[R_buf[i], s]] += 1 # <<<<<<<<<<<<<< + * + * for i in range(r.size()): + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_38 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_33 = __pyx_v_s; + __pyx_t_32 = (*((long *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_s_star.data + __pyx_t_39 * __pyx_v_s_star.strides[0]) ) + __pyx_t_33 * __pyx_v_s_star.strides[1]) ))); + *((double *) ( /* dim=0 */ (__pyx_v_sdp_global.data + __pyx_t_32 * __pyx_v_sdp_global.strides[0]) )) += 1.0; + } + + /* "cyext_acv.pyx":6761 + * + * for i in range(N): + * if sdp[R_buf[i]] >= pi_level: # <<<<<<<<<<<<<< + * r.push_back(R[i]) + * for s in range(len_s_star[R_buf[i]]): + */ + } + } + + /* "cyext_acv.pyx":6766 + * sdp_global[s_star[R_buf[i], s]] += 1 + * + * for i in range(r.size()): # <<<<<<<<<<<<<< + * std_remove[vector[long].iterator, long](R.begin(), R.end(), r[i]) + * R.pop_back() + */ + __pyx_t_30 = __pyx_v_r.size(); + __pyx_t_31 = __pyx_t_30; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_31; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "cyext_acv.pyx":6767 + * + * for i in range(r.size()): + * std_remove[vector[long].iterator, long](R.begin(), R.end(), r[i]) # <<<<<<<<<<<<<< + * R.pop_back() + * + */ + (void)(std::remove ::iterator,long>(__pyx_v_R.begin(), __pyx_v_R.end(), (__pyx_v_r[__pyx_v_i]))); + + /* "cyext_acv.pyx":6768 + * for i in range(r.size()): + * std_remove[vector[long].iterator, long](R.begin(), R.end(), r[i]) + * R.pop_back() # <<<<<<<<<<<<<< + * + * if (R.size() == 0 or S_size >= X.shape[1]/2) and stop: + */ + __pyx_v_R.pop_back(); + } + + /* "cyext_acv.pyx":6770 + * R.pop_back() + * + * if (R.size() == 0 or S_size >= X.shape[1]/2) and stop: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_19 = ((__pyx_v_R.size() == 0) != 0); + if (!__pyx_t_19) { + } else { + goto __pyx_L53_next_and; + } + __pyx_t_19 = ((__pyx_v_S_size >= ((__pyx_v_X.shape[1]) / 2)) != 0); + if (__pyx_t_19) { + } else { + __pyx_t_12 = __pyx_t_19; + goto __pyx_L52_bool_binop_done; + } + __pyx_L53_next_and:; + __pyx_t_19 = (__pyx_v_stop != 0); + __pyx_t_12 = __pyx_t_19; + __pyx_L52_bool_binop_done:; + if (__pyx_t_12) { + + /* "cyext_acv.pyx":6771 + * + * if (R.size() == 0 or S_size >= X.shape[1]/2) and stop: + * break # <<<<<<<<<<<<<< + * + * return np.asarray(sdp_global)/X.shape[0], np.array(s_star, dtype=np.long), np.array(len_s_star, dtype=np.long), np.array(sdp) + */ + goto __pyx_L27_break; + + /* "cyext_acv.pyx":6770 + * R.pop_back() + * + * if (R.size() == 0 or S_size >= X.shape[1]/2) and stop: # <<<<<<<<<<<<<< + * break + * + */ + } + + /* "cyext_acv.pyx":6720 + * S = np.zeros((data.shape[1]), dtype=np.int) + * + * for s_0 in tqdm(range(minimal, m + 1)): # <<<<<<<<<<<<<< + * for s_1 in range(0, power_cpp[s_0].size()): + * for i in range(power_cpp[s_0][s_1].size()): + */ + } + __pyx_L27_break:; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "cyext_acv.pyx":6773 + * break + * + * return np.asarray(sdp_global)/X.shape[0], np.array(s_star, dtype=np.long), np.array(len_s_star, dtype=np.long), np.array(sdp) # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_sdp_global, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_24 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_24 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_24)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_24); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_24) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_24, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); + __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_X.shape[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 6773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_s_star, 2, (PyObject *(*)(char *)) __pyx_memview_get_long, (int (*)(char *, PyObject *)) __pyx_memview_set_long, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_24 = PyTuple_New(1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_long); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 6773, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_24, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_convert_vector_to_py_int(__pyx_v_len_s_star); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_43 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_long); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 6773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_43); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_43) < 0) __PYX_ERR(0, 6773, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + __pyx_t_43 = __Pyx_PyObject_Call(__pyx_t_24, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 6773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_43); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_sdp, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_24))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_24); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_24); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_24, function); + } + } + __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_24, __pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_24, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = PyTuple_New(4); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 6773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_43); + PyTuple_SET_ITEM(__pyx_t_24, 2, __pyx_t_43); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_24, 3, __pyx_t_2); + __pyx_t_6 = 0; + __pyx_t_4 = 0; + __pyx_t_43 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_24; + __pyx_t_24 = 0; + goto __pyx_L0; + + /* "cyext_acv.pyx":6641 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef global_ddp_intv(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * const double [:, :, :] & cond, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); + __Pyx_XDECREF(__pyx_t_6); + __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1); + __Pyx_XDECREF(__pyx_t_24); + __PYX_XDEC_MEMVIEW(&__pyx_t_27, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_34, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_35, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_36, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_37, 1); + __Pyx_XDECREF(__pyx_t_43); + __Pyx_AddTraceback("cyext_acv.global_ddp_intv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp_b, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp_ba, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp_global, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_in_data, 1); + __Pyx_XDECREF(__pyx_v_power); + __Pyx_XDECREF(__pyx_v_va_id); + __PYX_XDEC_MEMVIEW(&__pyx_v_R_buf, 1); + __Pyx_XDECREF(__pyx_v_X_arr); + __Pyx_XDECREF(__pyx_v_y_X_arr); + __Pyx_XDECREF(__pyx_v_cond_arr); + __Pyx_XDECREF(__pyx_v_t_arr); + __Pyx_XDECREF(__pyx_v_remove_va); + __Pyx_XDECREF(__pyx_v_power_b); + __Pyx_XDECREF(__pyx_v_co); + __PYX_XDEC_MEMVIEW(&__pyx_v_s_star, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_9cyext_acv_111global_ddp_intv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_9cyext_acv_111global_ddp_intv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_features = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_thresholds = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_left = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_right = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_cond = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_max_depth; + int __pyx_v_min_node_size; + int __pyx_v_classifier; + __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_C = 0; + double __pyx_v_pi_level; + int __pyx_v_minimal; + int __pyx_v_stop; + PyObject *__pyx_v_search_space = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("global_ddp_intv (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_y_X,&__pyx_n_s_data,&__pyx_n_s_y_data,&__pyx_n_s_features,&__pyx_n_s_thresholds,&__pyx_n_s_children_left,&__pyx_n_s_children_right,&__pyx_n_s_cond,&__pyx_n_s_max_depth,&__pyx_n_s_min_node_size,&__pyx_n_s_classifier,&__pyx_n_s_t,&__pyx_n_s_C,&__pyx_n_s_pi_level,&__pyx_n_s_minimal,&__pyx_n_s_stop,&__pyx_n_s_search_space,0}; + PyObject* values[18] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17); + CYTHON_FALLTHROUGH; + case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16); + CYTHON_FALLTHROUGH; + case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15); + CYTHON_FALLTHROUGH; + case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_X)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_intv", 1, 18, 18, 1); __PYX_ERR(0, 6641, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_intv", 1, 18, 18, 2); __PYX_ERR(0, 6641, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_intv", 1, 18, 18, 3); __PYX_ERR(0, 6641, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_features)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_intv", 1, 18, 18, 4); __PYX_ERR(0, 6641, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thresholds)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_intv", 1, 18, 18, 5); __PYX_ERR(0, 6641, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_left)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_intv", 1, 18, 18, 6); __PYX_ERR(0, 6641, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_intv", 1, 18, 18, 7); __PYX_ERR(0, 6641, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_intv", 1, 18, 18, 8); __PYX_ERR(0, 6641, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_intv", 1, 18, 18, 9); __PYX_ERR(0, 6641, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_node_size)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_intv", 1, 18, 18, 10); __PYX_ERR(0, 6641, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classifier)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_intv", 1, 18, 18, 11); __PYX_ERR(0, 6641, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_intv", 1, 18, 18, 12); __PYX_ERR(0, 6641, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 13: + if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_intv", 1, 18, 18, 13); __PYX_ERR(0, 6641, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 14: + if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pi_level)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_intv", 1, 18, 18, 14); __PYX_ERR(0, 6641, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 15: + if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minimal)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_intv", 1, 18, 18, 15); __PYX_ERR(0, 6641, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 16: + if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_intv", 1, 18, 18, 16); __PYX_ERR(0, 6641, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 17: + if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_search_space)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_ddp_intv", 1, 18, 18, 17); __PYX_ERR(0, 6641, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "global_ddp_intv") < 0)) __PYX_ERR(0, 6641, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 18) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + values[15] = PyTuple_GET_ITEM(__pyx_args, 15); + values[16] = PyTuple_GET_ITEM(__pyx_args, 16); + values[17] = PyTuple_GET_ITEM(__pyx_args, 17); + } + __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 6641, __pyx_L3_error) + __pyx_v_y_X = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_X.memview)) __PYX_ERR(0, 6641, __pyx_L3_error) + __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 6641, __pyx_L3_error) + __pyx_v_y_data = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_data.memview)) __PYX_ERR(0, 6641, __pyx_L3_error) + __pyx_v_features = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_features.memview)) __PYX_ERR(0, 6642, __pyx_L3_error) + __pyx_v_thresholds = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_thresholds.memview)) __PYX_ERR(0, 6642, __pyx_L3_error) + __pyx_v_children_left = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_left.memview)) __PYX_ERR(0, 6642, __pyx_L3_error) + __pyx_v_children_right = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_right.memview)) __PYX_ERR(0, 6642, __pyx_L3_error) + __pyx_v_cond = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double__const__(values[8], 0); if (unlikely(!__pyx_v_cond.memview)) __PYX_ERR(0, 6643, __pyx_L3_error) + __pyx_v_max_depth = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6644, __pyx_L3_error) + __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6644, __pyx_L3_error) + __pyx_v_classifier = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6644, __pyx_L3_error) + __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[12], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 6644, __pyx_L3_error) + __pyx_v_C = ((PyObject*)values[13]); + __pyx_v_pi_level = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_pi_level == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 6644, __pyx_L3_error) + __pyx_v_minimal = __Pyx_PyInt_As_int(values[15]); if (unlikely((__pyx_v_minimal == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6645, __pyx_L3_error) + __pyx_v_stop = __Pyx_PyObject_IsTrue(values[16]); if (unlikely((__pyx_v_stop == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6645, __pyx_L3_error) + __pyx_v_search_space = ((PyObject*)values[17]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("global_ddp_intv", 1, 18, 18, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6641, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cyext_acv.global_ddp_intv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_C), (&PyList_Type), 1, "C", 1))) __PYX_ERR(0, 6644, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_search_space), (&PyList_Type), 1, "search_space", 1))) __PYX_ERR(0, 6645, __pyx_L1_error) + __pyx_r = __pyx_pf_9cyext_acv_110global_ddp_intv(__pyx_self, __pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_cond, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_v_C, __pyx_v_pi_level, __pyx_v_minimal, __pyx_v_stop, __pyx_v_search_space); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9cyext_acv_110global_ddp_intv(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, __Pyx_memviewslice __pyx_v_cond, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t, PyObject *__pyx_v_C, double __pyx_v_pi_level, int __pyx_v_minimal, int __pyx_v_stop, PyObject *__pyx_v_search_space) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("global_ddp_intv", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundLocalError("X"); __PYX_ERR(0, 6641, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_X.memview)) { __Pyx_RaiseUnboundLocalError("y_X"); __PYX_ERR(0, 6641, __pyx_L1_error) } + if (unlikely(!__pyx_v_data.memview)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 6641, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_data.memview)) { __Pyx_RaiseUnboundLocalError("y_data"); __PYX_ERR(0, 6641, __pyx_L1_error) } + if (unlikely(!__pyx_v_features.memview)) { __Pyx_RaiseUnboundLocalError("features"); __PYX_ERR(0, 6641, __pyx_L1_error) } + if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 6641, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 6641, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 6641, __pyx_L1_error) } + if (unlikely(!__pyx_v_cond.memview)) { __Pyx_RaiseUnboundLocalError("cond"); __PYX_ERR(0, 6641, __pyx_L1_error) } + if (unlikely(!__pyx_v_t.memview)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 6641, __pyx_L1_error) } + __pyx_t_1 = __pyx_f_9cyext_acv_global_ddp_intv(__pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_cond, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_v_C, __pyx_v_pi_level, __pyx_v_minimal, __pyx_v_stop, __pyx_v_search_space, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6641, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cyext_acv.global_ddp_intv", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_features, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_thresholds, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_left, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_right, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_cond, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_t, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cyext_acv.pyx":6779 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cdef double single_compute_cdp_rule(double[:] & x, double & y_x, double & down, double & up, double[:, :] & data, double[::1] & y_data, vector[int] & S, # <<<<<<<<<<<<<< + * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + * int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition) nogil: + */ + +static double __pyx_f_9cyext_acv_single_compute_cdp_rule(__Pyx_memviewslice &__pyx_v_x, double &__pyx_v_y_x, double &__pyx_v_down, double &__pyx_v_up, __Pyx_memviewslice &__pyx_v_data, __Pyx_memviewslice &__pyx_v_y_data, std::vector &__pyx_v_S, __Pyx_memviewslice &__pyx_v_features, __Pyx_memviewslice &__pyx_v_thresholds, __Pyx_memviewslice &__pyx_v_children_left, __Pyx_memviewslice &__pyx_v_children_right, int &__pyx_v_max_depth, int &__pyx_v_min_node_size, int &__pyx_v_classifier, CYTHON_UNUSED __Pyx_memviewslice &__pyx_v_t, __Pyx_memviewslice &__pyx_v_partition) { + unsigned int __pyx_v_n_trees; + unsigned int __pyx_v_N; + double __pyx_v_sdp; + int __pyx_v_b; + CYTHON_UNUSED int __pyx_v_level; + int __pyx_v_i; + int __pyx_v_it_node; + std::set __pyx_v_nodes_level; + std::set __pyx_v_nodes_child; + std::set __pyx_v_in_data; + std::set __pyx_v_in_data_b; + std::set ::iterator __pyx_v_it; + std::set ::iterator __pyx_v_it_point; + double __pyx_r; + unsigned int __pyx_t_1; + unsigned int __pyx_t_2; + int __pyx_t_3; + unsigned int __pyx_t_4; + unsigned int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + double __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "cyext_acv.pyx":6783 + * int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition) nogil: + * + * cdef unsigned int n_trees = features.shape[0] # <<<<<<<<<<<<<< + * cdef unsigned int N = data.shape[0] + * cdef double s, sdp + */ + __pyx_v_n_trees = (__pyx_v_features.shape[0]); + + /* "cyext_acv.pyx":6784 + * + * cdef unsigned int n_trees = features.shape[0] + * cdef unsigned int N = data.shape[0] # <<<<<<<<<<<<<< + * cdef double s, sdp + * cdef int o + */ + __pyx_v_N = (__pyx_v_data.shape[0]); + + /* "cyext_acv.pyx":6787 + * cdef double s, sdp + * cdef int o + * sdp = 0 # <<<<<<<<<<<<<< + * + * cdef int b, level, i, it_node + */ + __pyx_v_sdp = 0.0; + + /* "cyext_acv.pyx":6793 + * cdef set[int].iterator it, it_point + * + * for b in range(n_trees): # <<<<<<<<<<<<<< + * nodes_child.clear() + * nodes_level.clear() + */ + __pyx_t_1 = __pyx_v_n_trees; + __pyx_t_2 = __pyx_t_1; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_b = __pyx_t_3; + + /* "cyext_acv.pyx":6794 + * + * for b in range(n_trees): + * nodes_child.clear() # <<<<<<<<<<<<<< + * nodes_level.clear() + * nodes_level.insert(0) + */ + __pyx_v_nodes_child.clear(); + + /* "cyext_acv.pyx":6795 + * for b in range(n_trees): + * nodes_child.clear() + * nodes_level.clear() # <<<<<<<<<<<<<< + * nodes_level.insert(0) + * + */ + __pyx_v_nodes_level.clear(); + + /* "cyext_acv.pyx":6796 + * nodes_child.clear() + * nodes_level.clear() + * nodes_level.insert(0) # <<<<<<<<<<<<<< + * + * in_data.clear() + */ + try { + __pyx_v_nodes_level.insert(0); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 6796, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6798 + * nodes_level.insert(0) + * + * in_data.clear() # <<<<<<<<<<<<<< + * in_data_b.clear() + * for i in range(N): + */ + __pyx_v_in_data.clear(); + + /* "cyext_acv.pyx":6799 + * + * in_data.clear() + * in_data_b.clear() # <<<<<<<<<<<<<< + * for i in range(N): + * in_data.insert(i) + */ + __pyx_v_in_data_b.clear(); + + /* "cyext_acv.pyx":6800 + * in_data.clear() + * in_data_b.clear() + * for i in range(N): # <<<<<<<<<<<<<< + * in_data.insert(i) + * in_data_b.insert(i) + */ + __pyx_t_4 = __pyx_v_N; + __pyx_t_5 = __pyx_t_4; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "cyext_acv.pyx":6801 + * in_data_b.clear() + * for i in range(N): + * in_data.insert(i) # <<<<<<<<<<<<<< + * in_data_b.insert(i) + * + */ + try { + __pyx_v_in_data.insert(__pyx_v_i); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 6801, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6802 + * for i in range(N): + * in_data.insert(i) + * in_data_b.insert(i) # <<<<<<<<<<<<<< + * + * for level in range(max_depth): + */ + try { + __pyx_v_in_data_b.insert(__pyx_v_i); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 6802, __pyx_L1_error) + } + } + + /* "cyext_acv.pyx":6804 + * in_data_b.insert(i) + * + * for level in range(max_depth): # <<<<<<<<<<<<<< + * it_point = nodes_level.begin() + * while(it_point != nodes_level.end()): + */ + __pyx_t_6 = __pyx_v_max_depth; + __pyx_t_7 = __pyx_t_6; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_level = __pyx_t_8; + + /* "cyext_acv.pyx":6805 + * + * for level in range(max_depth): + * it_point = nodes_level.begin() # <<<<<<<<<<<<<< + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) + */ + __pyx_v_it_point = __pyx_v_nodes_level.begin(); + + /* "cyext_acv.pyx":6806 + * for level in range(max_depth): + * it_point = nodes_level.begin() + * while(it_point != nodes_level.end()): # <<<<<<<<<<<<<< + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it_point != __pyx_v_nodes_level.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":6807 + * it_point = nodes_level.begin() + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) # <<<<<<<<<<<<<< + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * if x[features[b, it_node]] <= thresholds[b, it_node]: + */ + __pyx_v_it_node = (*__pyx_v_it_point); + + /* "cyext_acv.pyx":6808 + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): # <<<<<<<<<<<<<< + * if x[features[b, it_node]] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) + */ + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_9 = ((std::find ::iterator,int>(__pyx_v_S.begin(), __pyx_v_S.end(), (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_10 * __pyx_v_features.strides[0]) ) + __pyx_t_11 * __pyx_v_features.strides[1]) )))) != __pyx_v_S.end()) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6809 + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * if x[features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * + */ + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_12 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_11 * __pyx_v_features.strides[0]) ) + __pyx_t_10 * __pyx_v_features.strides[1]) ))); + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_12 * __pyx_v_x.strides[0]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_13 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_14 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6810 + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * if x[features[b, it_node]] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) # <<<<<<<<<<<<<< + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + */ + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_left.data + __pyx_t_14 * __pyx_v_children_left.strides[0]) ) + __pyx_t_13 * __pyx_v_children_left.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 6810, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6812 + * nodes_child.insert(children_left[b, it_node]) + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 1] = thresholds[b, it_node] + * + */ + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + __pyx_t_10 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_13 * __pyx_v_features.strides[0]) ) + __pyx_t_14 * __pyx_v_features.strides[1]) ))); + __pyx_t_11 = 1; + __pyx_t_12 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_10 * __pyx_v_partition.strides[0]) ) + __pyx_t_11 * __pyx_v_partition.strides[1]) ))) >= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_12 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_15 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6813 + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + * partition[features[b, it_node], 1] = thresholds[b, it_node] # <<<<<<<<<<<<<< + * + * it = in_data.begin() + */ + __pyx_t_15 = __pyx_v_b; + __pyx_t_12 = __pyx_v_it_node; + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_11 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_14 * __pyx_v_features.strides[0]) ) + __pyx_t_13 * __pyx_v_features.strides[1]) ))); + __pyx_t_10 = 1; + *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_11 * __pyx_v_partition.strides[0]) ) + __pyx_t_10 * __pyx_v_partition.strides[1]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_15 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_12 * __pyx_v_thresholds.strides[1]) ))); + + /* "cyext_acv.pyx":6812 + * nodes_child.insert(children_left[b, it_node]) + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 1] = thresholds[b, it_node] + * + */ + } + + /* "cyext_acv.pyx":6815 + * partition[features[b, it_node], 1] = thresholds[b, it_node] + * + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + */ + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":6816 + * + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":6817 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + __pyx_t_12 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_13 = (*__pyx_v_it); + __pyx_t_14 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_12 * __pyx_v_features.strides[0]) ) + __pyx_t_15 * __pyx_v_features.strides[1]) ))); + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_data.data + __pyx_t_13 * __pyx_v_data.strides[0]) ) + __pyx_t_14 * __pyx_v_data.strides[1]) ))) > (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_10 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_11 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6818 + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) # <<<<<<<<<<<<<< + * inc(it) + * in_data = in_data_b + */ + (void)(__pyx_v_in_data_b.erase((*__pyx_v_it))); + + /* "cyext_acv.pyx":6817 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + } + + /* "cyext_acv.pyx":6819 + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + * inc(it) # <<<<<<<<<<<<<< + * in_data = in_data_b + * + */ + (void)((++__pyx_v_it)); + } + + /* "cyext_acv.pyx":6820 + * in_data_b.erase(deref(it)) + * inc(it) + * in_data = in_data_b # <<<<<<<<<<<<<< + * + * else: + */ + __pyx_v_in_data = __pyx_v_in_data_b; + + /* "cyext_acv.pyx":6809 + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * if x[features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * + */ + goto __pyx_L12; + } + + /* "cyext_acv.pyx":6823 + * + * else: + * nodes_child.insert(children_right[b, it_node]) # <<<<<<<<<<<<<< + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: + */ + /*else*/ { + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_right.data + __pyx_t_11 * __pyx_v_children_right.strides[0]) ) + __pyx_t_10 * __pyx_v_children_right.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 6823, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6825 + * nodes_child.insert(children_right[b, it_node]) + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 0] = thresholds[b, it_node] + * + */ + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_15 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_10 * __pyx_v_features.strides[0]) ) + __pyx_t_11 * __pyx_v_features.strides[1]) ))); + __pyx_t_12 = 0; + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_15 * __pyx_v_partition.strides[0]) ) + __pyx_t_12 * __pyx_v_partition.strides[1]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_14 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_13 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6826 + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: + * partition[features[b, it_node], 0] = thresholds[b, it_node] # <<<<<<<<<<<<<< + * + * it = in_data.begin() + */ + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_12 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_11 * __pyx_v_features.strides[0]) ) + __pyx_t_10 * __pyx_v_features.strides[1]) ))); + __pyx_t_15 = 0; + *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_12 * __pyx_v_partition.strides[0]) ) + __pyx_t_15 * __pyx_v_partition.strides[1]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_13 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_14 * __pyx_v_thresholds.strides[1]) ))); + + /* "cyext_acv.pyx":6825 + * nodes_child.insert(children_right[b, it_node]) + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 0] = thresholds[b, it_node] + * + */ + } + + /* "cyext_acv.pyx":6828 + * partition[features[b, it_node], 0] = thresholds[b, it_node] + * + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + */ + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":6829 + * + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":6830 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_10 = (*__pyx_v_it); + __pyx_t_11 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_14 * __pyx_v_features.strides[0]) ) + __pyx_t_13 * __pyx_v_features.strides[1]) ))); + __pyx_t_15 = __pyx_v_b; + __pyx_t_12 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_data.data + __pyx_t_10 * __pyx_v_data.strides[0]) ) + __pyx_t_11 * __pyx_v_data.strides[1]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_15 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_12 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6831 + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) # <<<<<<<<<<<<<< + * inc(it) + * in_data = in_data_b + */ + (void)(__pyx_v_in_data_b.erase((*__pyx_v_it))); + + /* "cyext_acv.pyx":6830 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + } + + /* "cyext_acv.pyx":6832 + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + * inc(it) # <<<<<<<<<<<<<< + * in_data = in_data_b + * else: + */ + (void)((++__pyx_v_it)); + } + + /* "cyext_acv.pyx":6833 + * in_data_b.erase(deref(it)) + * inc(it) + * in_data = in_data_b # <<<<<<<<<<<<<< + * else: + * nodes_child.insert(children_left[b, it_node]) + */ + __pyx_v_in_data = __pyx_v_in_data_b; + } + __pyx_L12:; + + /* "cyext_acv.pyx":6808 + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): # <<<<<<<<<<<<<< + * if x[features[b, it_node]] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) + */ + goto __pyx_L11; + } + + /* "cyext_acv.pyx":6835 + * in_data = in_data_b + * else: + * nodes_child.insert(children_left[b, it_node]) # <<<<<<<<<<<<<< + * nodes_child.insert(children_right[b, it_node]) + * + */ + /*else*/ { + __pyx_t_12 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_left.data + __pyx_t_12 * __pyx_v_children_left.strides[0]) ) + __pyx_t_15 * __pyx_v_children_left.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 6835, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6836 + * else: + * nodes_child.insert(children_left[b, it_node]) + * nodes_child.insert(children_right[b, it_node]) # <<<<<<<<<<<<<< + * + * if in_data.size() < min_node_size: + */ + __pyx_t_15 = __pyx_v_b; + __pyx_t_12 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_right.data + __pyx_t_15 * __pyx_v_children_right.strides[0]) ) + __pyx_t_12 * __pyx_v_children_right.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 6836, __pyx_L1_error) + } + } + __pyx_L11:; + + /* "cyext_acv.pyx":6838 + * nodes_child.insert(children_right[b, it_node]) + * + * if in_data.size() < min_node_size: # <<<<<<<<<<<<<< + * break + * inc(it_point) + */ + __pyx_t_9 = ((__pyx_v_in_data.size() < __pyx_v_min_node_size) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6839 + * + * if in_data.size() < min_node_size: + * break # <<<<<<<<<<<<<< + * inc(it_point) + * + */ + goto __pyx_L10_break; + + /* "cyext_acv.pyx":6838 + * nodes_child.insert(children_right[b, it_node]) + * + * if in_data.size() < min_node_size: # <<<<<<<<<<<<<< + * break + * inc(it_point) + */ + } + + /* "cyext_acv.pyx":6840 + * if in_data.size() < min_node_size: + * break + * inc(it_point) # <<<<<<<<<<<<<< + * + * nodes_level = nodes_child + */ + (void)((++__pyx_v_it_point)); + } + __pyx_L10_break:; + + /* "cyext_acv.pyx":6842 + * inc(it_point) + * + * nodes_level = nodes_child # <<<<<<<<<<<<<< + * + * if classifier == 1: + */ + __pyx_v_nodes_level = __pyx_v_nodes_child; + } + + /* "cyext_acv.pyx":6844 + * nodes_level = nodes_child + * + * if classifier == 1: # <<<<<<<<<<<<<< + * it = in_data.begin() + * while(it != in_data.end()): + */ + __pyx_t_9 = ((__pyx_v_classifier == 1) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6845 + * + * if classifier == 1: + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (y_x == y_data[deref(it)]) + */ + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":6846 + * if classifier == 1: + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * sdp += (1./(n_trees*in_data.size())) * (y_x == y_data[deref(it)]) + * inc(it) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":6847 + * it = in_data.begin() + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (y_x == y_data[deref(it)]) # <<<<<<<<<<<<<< + * inc(it) + * else: + */ + __pyx_t_12 = (*__pyx_v_it); + __pyx_v_sdp = (__pyx_v_sdp + ((1. / (__pyx_v_n_trees * __pyx_v_in_data.size())) * (__pyx_v_y_x == (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_12)) )))))); + + /* "cyext_acv.pyx":6848 + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (y_x == y_data[deref(it)]) + * inc(it) # <<<<<<<<<<<<<< + * else: + * it = in_data.begin() + */ + (void)((++__pyx_v_it)); + } + + /* "cyext_acv.pyx":6844 + * nodes_level = nodes_child + * + * if classifier == 1: # <<<<<<<<<<<<<< + * it = in_data.begin() + * while(it != in_data.end()): + */ + goto __pyx_L22; + } + + /* "cyext_acv.pyx":6850 + * inc(it) + * else: + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (down<=y_data[deref(it)]<=up) + */ + /*else*/ { + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":6851 + * else: + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * sdp += (1./(n_trees*in_data.size())) * (down<=y_data[deref(it)]<=up) + * inc(it) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":6852 + * it = in_data.begin() + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (down<=y_data[deref(it)]<=up) # <<<<<<<<<<<<<< + * inc(it) + * + */ + __pyx_t_12 = (*__pyx_v_it); + __pyx_t_16 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_12)) ))); + __pyx_t_9 = (__pyx_v_down <= __pyx_t_16); + if (__pyx_t_9) { + __pyx_t_9 = (__pyx_t_16 <= __pyx_v_up); + } + __pyx_v_sdp = (__pyx_v_sdp + ((1. / (__pyx_v_n_trees * __pyx_v_in_data.size())) * __pyx_t_9)); + + /* "cyext_acv.pyx":6853 + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (down<=y_data[deref(it)]<=up) + * inc(it) # <<<<<<<<<<<<<< + * + * return sdp + */ + (void)((++__pyx_v_it)); + } + } + __pyx_L22:; + } + + /* "cyext_acv.pyx":6855 + * inc(it) + * + * return sdp # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_r = __pyx_v_sdp; + goto __pyx_L0; + + /* "cyext_acv.pyx":6779 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cdef double single_compute_cdp_rule(double[:] & x, double & y_x, double & down, double & up, double[:, :] & data, double[::1] & y_data, vector[int] & S, # <<<<<<<<<<<<<< + * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + * int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition) nogil: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("cyext_acv.single_compute_cdp_rule", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_r = 0; + __pyx_L0:; + return __pyx_r; +} + +/* "cyext_acv.pyx":6861 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_cdp_rule(double[:, :] & X, double[::1] & y_X, double[::1] down, double[::1] up, double[:, :] & data, double[::1] & y_data, vector[vector[int]] & S, # <<<<<<<<<<<<<< + * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + * int & max_depth, int & min_node_size, int & classifier, double[:, :] & t): + */ + +static PyObject *__pyx_pw_9cyext_acv_113compute_cdp_rule(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_cdp_rule(__Pyx_memviewslice &__pyx_v_X, __Pyx_memviewslice &__pyx_v_y_X, __Pyx_memviewslice __pyx_v_down, __Pyx_memviewslice __pyx_v_up, __Pyx_memviewslice &__pyx_v_data, __Pyx_memviewslice &__pyx_v_y_data, std::vector > &__pyx_v_S, __Pyx_memviewslice &__pyx_v_features, __Pyx_memviewslice &__pyx_v_thresholds, __Pyx_memviewslice &__pyx_v_children_left, __Pyx_memviewslice &__pyx_v_children_right, int &__pyx_v_max_depth, int &__pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_buffer = NULL; + __Pyx_memviewslice __pyx_v_partition_byobs = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_N; + __Pyx_memviewslice __pyx_v_sdp = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + __Pyx_memviewslice __pyx_t_15 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_16 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_cdp_rule", 0); + + /* "cyext_acv.pyx":6865 + * int & max_depth, int & min_node_size, int & classifier, double[:, :] & t): + * + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) # <<<<<<<<<<<<<< + * buffer[:, :, 0] = -1e+10 + * cdef double [:, :, :] partition_byobs = buffer + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6865, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ones); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6865, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6865, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_X.shape[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6865, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_X.shape[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6865, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6865, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_INCREF(__pyx_int_2); + __Pyx_GIVEREF(__pyx_int_2); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_2); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 6865, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6865, __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 = PyNumber_Multiply(__pyx_float_1e_10, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6865, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_buffer = __pyx_t_1; + __pyx_t_1 = 0; + + /* "cyext_acv.pyx":6866 + * + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + * buffer[:, :, 0] = -1e+10 # <<<<<<<<<<<<<< + * cdef double [:, :, :] partition_byobs = buffer + * + */ + if (unlikely(PyObject_SetItem(__pyx_v_buffer, __pyx_tuple__3, __pyx_float_neg_1e_10) < 0)) __PYX_ERR(0, 6866, __pyx_L1_error) + + /* "cyext_acv.pyx":6867 + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + * buffer[:, :, 0] = -1e+10 + * cdef double [:, :, :] partition_byobs = buffer # <<<<<<<<<<<<<< + * + * cdef int N = X.shape[0] + */ + __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_v_buffer, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 6867, __pyx_L1_error) + __pyx_v_partition_byobs = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "cyext_acv.pyx":6869 + * cdef double [:, :, :] partition_byobs = buffer + * + * cdef int N = X.shape[0] # <<<<<<<<<<<<<< + * cdef double[::1] sdp = np.zeros(N) + * cdef int i + */ + __pyx_v_N = (__pyx_v_X.shape[0]); + + /* "cyext_acv.pyx":6870 + * + * cdef int N = X.shape[0] + * cdef double[::1] sdp = np.zeros(N) # <<<<<<<<<<<<<< + * cdef int i + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6870, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6870, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6870, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6870, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 6870, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp = __pyx_t_7; + __pyx_t_7.memview = NULL; + __pyx_t_7.data = NULL; + + /* "cyext_acv.pyx":6873 + * cdef int i + * + * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_cdp_rule(X[i], y_X[i], down[i], up[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + __pyx_t_8 = __pyx_v_N; + if ((1 == 0)) abort(); + { + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) (x) + #define unlikely(x) (x) + #endif + __pyx_t_10 = (__pyx_t_8 - 0 + 1 - 1/abs(1)) / 1; + if (__pyx_t_10 > 0) + { + #ifdef _OPENMP + #pragma omp parallel private(__pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_17) firstprivate(__pyx_t_11, __pyx_t_15, __pyx_t_16) + #endif /* _OPENMP */ + { + #ifdef _OPENMP + #pragma omp for firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) schedule(dynamic) + #endif /* _OPENMP */ + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_10; __pyx_t_9++){ + { + __pyx_v_i = (int)(0 + 1 * __pyx_t_9); + + /* "cyext_acv.pyx":6874 + * + * for i in prange(N, nogil=True, schedule='dynamic'): + * sdp[i] = single_compute_cdp_rule(X[i], y_X[i], down[i], up[i], data, y_data, S[i], # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i]) + */ + __pyx_t_11.data = __pyx_v_X.data; + __pyx_t_11.memview = __pyx_v_X.memview; + __PYX_INC_MEMVIEW(&__pyx_t_11, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_X.strides[0]; + __pyx_t_11.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_11.shape[0] = __pyx_v_X.shape[1]; +__pyx_t_11.strides[0] = __pyx_v_X.strides[1]; + __pyx_t_11.suboffsets[0] = -1; + +__pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_i; + + /* "cyext_acv.pyx":6876 + * sdp[i] = single_compute_cdp_rule(X[i], y_X[i], down[i], up[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i]) # <<<<<<<<<<<<<< + * + * return np.array(sdp), np.array(partition_byobs) + */ + __pyx_t_15.data = __pyx_v_t.data; + __pyx_t_15.memview = __pyx_v_t.memview; + __PYX_INC_MEMVIEW(&__pyx_t_15, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_t.strides[0]; + __pyx_t_15.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_15.shape[0] = __pyx_v_t.shape[1]; +__pyx_t_15.strides[0] = __pyx_v_t.strides[1]; + __pyx_t_15.suboffsets[0] = -1; + +__pyx_t_16.data = __pyx_v_partition_byobs.data; + __pyx_t_16.memview = __pyx_v_partition_byobs.memview; + __PYX_INC_MEMVIEW(&__pyx_t_16, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_partition_byobs.strides[0]; + __pyx_t_16.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_16.shape[0] = __pyx_v_partition_byobs.shape[1]; +__pyx_t_16.strides[0] = __pyx_v_partition_byobs.strides[1]; + __pyx_t_16.suboffsets[0] = -1; + +__pyx_t_16.shape[1] = __pyx_v_partition_byobs.shape[2]; +__pyx_t_16.strides[1] = __pyx_v_partition_byobs.strides[2]; + __pyx_t_16.suboffsets[1] = -1; + +__pyx_t_17 = __pyx_v_i; + + /* "cyext_acv.pyx":6874 + * + * for i in prange(N, nogil=True, schedule='dynamic'): + * sdp[i] = single_compute_cdp_rule(X[i], y_X[i], down[i], up[i], data, y_data, S[i], # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i]) + */ + *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_sdp.data) + __pyx_t_17)) )) = __pyx_f_9cyext_acv_single_compute_cdp_rule(__pyx_t_11, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_12)) ))), (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_down.data) + __pyx_t_13)) ))), (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_up.data) + __pyx_t_14)) ))), __pyx_v_data, __pyx_v_y_data, (__pyx_v_S[__pyx_v_i]), __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_t_15, __pyx_t_16); + __PYX_XDEC_MEMVIEW(&__pyx_t_11, 0); + __pyx_t_11.memview = NULL; + __pyx_t_11.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_15, 0); + __pyx_t_15.memview = NULL; + __pyx_t_15.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_16, 0); + __pyx_t_16.memview = NULL; + __pyx_t_16.data = NULL; + } + } + } + } + } + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #endif + } + + /* "cyext_acv.pyx":6873 + * cdef int i + * + * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_cdp_rule(X[i], y_X[i], down[i], up[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "cyext_acv.pyx":6878 + * max_depth, min_node_size, classifier, t[i], partition_byobs[i]) + * + * return np.array(sdp), np.array(partition_byobs) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6878, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6878, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_sdp, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6878, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6878, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6878, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6878, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_partition_byobs, 3, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6878, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6878, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6878, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); + __pyx_t_1 = 0; + __pyx_t_5 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "cyext_acv.pyx":6861 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_cdp_rule(double[:, :] & X, double[::1] & y_X, double[::1] down, double[::1] up, double[:, :] & data, double[::1] & y_data, vector[vector[int]] & S, # <<<<<<<<<<<<<< + * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + * int & max_depth, int & min_node_size, int & classifier, double[:, :] & t): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_15, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1); + __Pyx_AddTraceback("cyext_acv.compute_cdp_rule", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_buffer); + __PYX_XDEC_MEMVIEW(&__pyx_v_partition_byobs, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_9cyext_acv_113compute_cdp_rule(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_9cyext_acv_113compute_cdp_rule(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_down = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_up = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + std::vector > __pyx_v_S; + __Pyx_memviewslice __pyx_v_features = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_thresholds = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_left = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_right = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_max_depth; + int __pyx_v_min_node_size; + int __pyx_v_classifier; + __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("compute_cdp_rule (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_y_X,&__pyx_n_s_down,&__pyx_n_s_up,&__pyx_n_s_data,&__pyx_n_s_y_data,&__pyx_n_s_S,&__pyx_n_s_features,&__pyx_n_s_thresholds,&__pyx_n_s_children_left,&__pyx_n_s_children_right,&__pyx_n_s_max_depth,&__pyx_n_s_min_node_size,&__pyx_n_s_classifier,&__pyx_n_s_t,0}; + PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_X)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rule", 1, 15, 15, 1); __PYX_ERR(0, 6861, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_down)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rule", 1, 15, 15, 2); __PYX_ERR(0, 6861, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_up)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rule", 1, 15, 15, 3); __PYX_ERR(0, 6861, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rule", 1, 15, 15, 4); __PYX_ERR(0, 6861, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rule", 1, 15, 15, 5); __PYX_ERR(0, 6861, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_S)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rule", 1, 15, 15, 6); __PYX_ERR(0, 6861, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_features)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rule", 1, 15, 15, 7); __PYX_ERR(0, 6861, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thresholds)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rule", 1, 15, 15, 8); __PYX_ERR(0, 6861, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_left)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rule", 1, 15, 15, 9); __PYX_ERR(0, 6861, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rule", 1, 15, 15, 10); __PYX_ERR(0, 6861, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rule", 1, 15, 15, 11); __PYX_ERR(0, 6861, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_node_size)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rule", 1, 15, 15, 12); __PYX_ERR(0, 6861, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 13: + if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classifier)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rule", 1, 15, 15, 13); __PYX_ERR(0, 6861, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 14: + if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rule", 1, 15, 15, 14); __PYX_ERR(0, 6861, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_cdp_rule") < 0)) __PYX_ERR(0, 6861, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 15) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + } + __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 6861, __pyx_L3_error) + __pyx_v_y_X = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_X.memview)) __PYX_ERR(0, 6861, __pyx_L3_error) + __pyx_v_down = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_down.memview)) __PYX_ERR(0, 6861, __pyx_L3_error) + __pyx_v_up = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_up.memview)) __PYX_ERR(0, 6861, __pyx_L3_error) + __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 6861, __pyx_L3_error) + __pyx_v_y_data = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_data.memview)) __PYX_ERR(0, 6861, __pyx_L3_error) + __pyx_v_S = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_int_3e___(values[6]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 6861, __pyx_L3_error) + __pyx_v_features = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_features.memview)) __PYX_ERR(0, 6862, __pyx_L3_error) + __pyx_v_thresholds = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_thresholds.memview)) __PYX_ERR(0, 6862, __pyx_L3_error) + __pyx_v_children_left = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[9], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_left.memview)) __PYX_ERR(0, 6862, __pyx_L3_error) + __pyx_v_children_right = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[10], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_right.memview)) __PYX_ERR(0, 6862, __pyx_L3_error) + __pyx_v_max_depth = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6863, __pyx_L3_error) + __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6863, __pyx_L3_error) + __pyx_v_classifier = __Pyx_PyInt_As_int(values[13]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 6863, __pyx_L3_error) + __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[14], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 6863, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("compute_cdp_rule", 1, 15, 15, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6861, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cyext_acv.compute_cdp_rule", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_9cyext_acv_112compute_cdp_rule(__pyx_self, __pyx_v_X, __pyx_v_y_X, __pyx_v_down, __pyx_v_up, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9cyext_acv_112compute_cdp_rule(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_down, __Pyx_memviewslice __pyx_v_up, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_cdp_rule", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundLocalError("X"); __PYX_ERR(0, 6861, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_X.memview)) { __Pyx_RaiseUnboundLocalError("y_X"); __PYX_ERR(0, 6861, __pyx_L1_error) } + if (unlikely(!__pyx_v_down.memview)) { __Pyx_RaiseUnboundLocalError("down"); __PYX_ERR(0, 6861, __pyx_L1_error) } + if (unlikely(!__pyx_v_up.memview)) { __Pyx_RaiseUnboundLocalError("up"); __PYX_ERR(0, 6861, __pyx_L1_error) } + if (unlikely(!__pyx_v_data.memview)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 6861, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_data.memview)) { __Pyx_RaiseUnboundLocalError("y_data"); __PYX_ERR(0, 6861, __pyx_L1_error) } + if (unlikely(!__pyx_v_features.memview)) { __Pyx_RaiseUnboundLocalError("features"); __PYX_ERR(0, 6861, __pyx_L1_error) } + if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 6861, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 6861, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 6861, __pyx_L1_error) } + if (unlikely(!__pyx_v_t.memview)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 6861, __pyx_L1_error) } + __pyx_t_1 = __pyx_f_9cyext_acv_compute_cdp_rule(__pyx_v_X, __pyx_v_y_X, __pyx_v_down, __pyx_v_up, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6861, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cyext_acv.compute_cdp_rule", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_down, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_up, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_features, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_thresholds, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_left, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_right, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_t, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cyext_acv.pyx":6885 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cdef double single_compute_cdp_cond_rule_weights(double[:] & x, double & y_x, double & down, double & up, double[:, :] & data, double[::1] & y_data, vector[int] & S, # <<<<<<<<<<<<<< + * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + * int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition, + */ + +static double __pyx_f_9cyext_acv_single_compute_cdp_cond_rule_weights(__Pyx_memviewslice &__pyx_v_x, double &__pyx_v_y_x, double &__pyx_v_down, double &__pyx_v_up, __Pyx_memviewslice &__pyx_v_data, __Pyx_memviewslice &__pyx_v_y_data, std::vector &__pyx_v_S, __Pyx_memviewslice &__pyx_v_features, __Pyx_memviewslice &__pyx_v_thresholds, __Pyx_memviewslice &__pyx_v_children_left, __Pyx_memviewslice &__pyx_v_children_right, int &__pyx_v_max_depth, int &__pyx_v_min_node_size, int &__pyx_v_classifier, CYTHON_UNUSED __Pyx_memviewslice &__pyx_v_t, __Pyx_memviewslice &__pyx_v_partition, __Pyx_memviewslice &__pyx_v_w, __Pyx_memviewslice &__pyx_v_cond) { + unsigned int __pyx_v_n_trees; + unsigned int __pyx_v_N; + double __pyx_v_sdp; + int __pyx_v_b; + CYTHON_UNUSED int __pyx_v_level; + int __pyx_v_i; + int __pyx_v_it_node; + std::set __pyx_v_nodes_level; + std::set __pyx_v_nodes_child; + std::set __pyx_v_in_data; + std::set __pyx_v_in_data_b; + std::set ::iterator __pyx_v_it; + std::set ::iterator __pyx_v_it_point; + double __pyx_r; + unsigned int __pyx_t_1; + unsigned int __pyx_t_2; + int __pyx_t_3; + unsigned int __pyx_t_4; + unsigned int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + double __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "cyext_acv.pyx":6890 + * double[:] & w, const double[:, :] & cond) nogil: + * + * cdef unsigned int n_trees = features.shape[0] # <<<<<<<<<<<<<< + * cdef unsigned int N = data.shape[0] + * cdef double s, sdp + */ + __pyx_v_n_trees = (__pyx_v_features.shape[0]); + + /* "cyext_acv.pyx":6891 + * + * cdef unsigned int n_trees = features.shape[0] + * cdef unsigned int N = data.shape[0] # <<<<<<<<<<<<<< + * cdef double s, sdp + * cdef int o + */ + __pyx_v_N = (__pyx_v_data.shape[0]); + + /* "cyext_acv.pyx":6894 + * cdef double s, sdp + * cdef int o + * sdp = 0 # <<<<<<<<<<<<<< + * + * cdef int b, level, i, it_node + */ + __pyx_v_sdp = 0.0; + + /* "cyext_acv.pyx":6900 + * cdef set[int].iterator it, it_point + * + * for b in range(n_trees): # <<<<<<<<<<<<<< + * nodes_child.clear() + * nodes_level.clear() + */ + __pyx_t_1 = __pyx_v_n_trees; + __pyx_t_2 = __pyx_t_1; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_b = __pyx_t_3; + + /* "cyext_acv.pyx":6901 + * + * for b in range(n_trees): + * nodes_child.clear() # <<<<<<<<<<<<<< + * nodes_level.clear() + * nodes_level.insert(0) + */ + __pyx_v_nodes_child.clear(); + + /* "cyext_acv.pyx":6902 + * for b in range(n_trees): + * nodes_child.clear() + * nodes_level.clear() # <<<<<<<<<<<<<< + * nodes_level.insert(0) + * + */ + __pyx_v_nodes_level.clear(); + + /* "cyext_acv.pyx":6903 + * nodes_child.clear() + * nodes_level.clear() + * nodes_level.insert(0) # <<<<<<<<<<<<<< + * + * in_data.clear() + */ + try { + __pyx_v_nodes_level.insert(0); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 6903, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6905 + * nodes_level.insert(0) + * + * in_data.clear() # <<<<<<<<<<<<<< + * in_data_b.clear() + * for i in range(N): + */ + __pyx_v_in_data.clear(); + + /* "cyext_acv.pyx":6906 + * + * in_data.clear() + * in_data_b.clear() # <<<<<<<<<<<<<< + * for i in range(N): + * in_data.insert(i) + */ + __pyx_v_in_data_b.clear(); + + /* "cyext_acv.pyx":6907 + * in_data.clear() + * in_data_b.clear() + * for i in range(N): # <<<<<<<<<<<<<< + * in_data.insert(i) + * in_data_b.insert(i) + */ + __pyx_t_4 = __pyx_v_N; + __pyx_t_5 = __pyx_t_4; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "cyext_acv.pyx":6908 + * in_data_b.clear() + * for i in range(N): + * in_data.insert(i) # <<<<<<<<<<<<<< + * in_data_b.insert(i) + * + */ + try { + __pyx_v_in_data.insert(__pyx_v_i); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 6908, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6909 + * for i in range(N): + * in_data.insert(i) + * in_data_b.insert(i) # <<<<<<<<<<<<<< + * + * for level in range(max_depth): + */ + try { + __pyx_v_in_data_b.insert(__pyx_v_i); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 6909, __pyx_L1_error) + } + } + + /* "cyext_acv.pyx":6911 + * in_data_b.insert(i) + * + * for level in range(max_depth): # <<<<<<<<<<<<<< + * it_point = nodes_level.begin() + * while(it_point != nodes_level.end()): + */ + __pyx_t_6 = __pyx_v_max_depth; + __pyx_t_7 = __pyx_t_6; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_level = __pyx_t_8; + + /* "cyext_acv.pyx":6912 + * + * for level in range(max_depth): + * it_point = nodes_level.begin() # <<<<<<<<<<<<<< + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) + */ + __pyx_v_it_point = __pyx_v_nodes_level.begin(); + + /* "cyext_acv.pyx":6913 + * for level in range(max_depth): + * it_point = nodes_level.begin() + * while(it_point != nodes_level.end()): # <<<<<<<<<<<<<< + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it_point != __pyx_v_nodes_level.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":6914 + * it_point = nodes_level.begin() + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) # <<<<<<<<<<<<<< + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * if x[features[b, it_node]] <= thresholds[b, it_node]: + */ + __pyx_v_it_node = (*__pyx_v_it_point); + + /* "cyext_acv.pyx":6915 + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): # <<<<<<<<<<<<<< + * if x[features[b, it_node]] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) + */ + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_9 = ((std::find ::iterator,int>(__pyx_v_S.begin(), __pyx_v_S.end(), (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_10 * __pyx_v_features.strides[0]) ) + __pyx_t_11 * __pyx_v_features.strides[1]) )))) != __pyx_v_S.end()) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6916 + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * if x[features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * + */ + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_12 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_11 * __pyx_v_features.strides[0]) ) + __pyx_t_10 * __pyx_v_features.strides[1]) ))); + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_12 * __pyx_v_x.strides[0]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_13 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_14 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6917 + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * if x[features[b, it_node]] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) # <<<<<<<<<<<<<< + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + */ + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_left.data + __pyx_t_14 * __pyx_v_children_left.strides[0]) ) + __pyx_t_13 * __pyx_v_children_left.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 6917, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6919 + * nodes_child.insert(children_left[b, it_node]) + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 1] = thresholds[b, it_node] + * + */ + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + __pyx_t_10 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_13 * __pyx_v_features.strides[0]) ) + __pyx_t_14 * __pyx_v_features.strides[1]) ))); + __pyx_t_11 = 1; + __pyx_t_12 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_10 * __pyx_v_partition.strides[0]) ) + __pyx_t_11 * __pyx_v_partition.strides[1]) ))) >= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_12 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_15 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6920 + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + * partition[features[b, it_node], 1] = thresholds[b, it_node] # <<<<<<<<<<<<<< + * + * it = in_data.begin() + */ + __pyx_t_15 = __pyx_v_b; + __pyx_t_12 = __pyx_v_it_node; + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_11 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_14 * __pyx_v_features.strides[0]) ) + __pyx_t_13 * __pyx_v_features.strides[1]) ))); + __pyx_t_10 = 1; + *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_11 * __pyx_v_partition.strides[0]) ) + __pyx_t_10 * __pyx_v_partition.strides[1]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_15 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_12 * __pyx_v_thresholds.strides[1]) ))); + + /* "cyext_acv.pyx":6919 + * nodes_child.insert(children_left[b, it_node]) + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 1] = thresholds[b, it_node] + * + */ + } + + /* "cyext_acv.pyx":6922 + * partition[features[b, it_node], 1] = thresholds[b, it_node] + * + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + */ + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":6923 + * + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":6924 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + __pyx_t_12 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_13 = (*__pyx_v_it); + __pyx_t_14 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_12 * __pyx_v_features.strides[0]) ) + __pyx_t_15 * __pyx_v_features.strides[1]) ))); + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_data.data + __pyx_t_13 * __pyx_v_data.strides[0]) ) + __pyx_t_14 * __pyx_v_data.strides[1]) ))) > (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_10 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_11 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6925 + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) # <<<<<<<<<<<<<< + * inc(it) + * in_data = in_data_b + */ + (void)(__pyx_v_in_data_b.erase((*__pyx_v_it))); + + /* "cyext_acv.pyx":6924 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + } + + /* "cyext_acv.pyx":6926 + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + * inc(it) # <<<<<<<<<<<<<< + * in_data = in_data_b + * + */ + (void)((++__pyx_v_it)); + } + + /* "cyext_acv.pyx":6927 + * in_data_b.erase(deref(it)) + * inc(it) + * in_data = in_data_b # <<<<<<<<<<<<<< + * + * else: + */ + __pyx_v_in_data = __pyx_v_in_data_b; + + /* "cyext_acv.pyx":6916 + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * if x[features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * + */ + goto __pyx_L12; + } + + /* "cyext_acv.pyx":6930 + * + * else: + * nodes_child.insert(children_right[b, it_node]) # <<<<<<<<<<<<<< + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: + */ + /*else*/ { + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_right.data + __pyx_t_11 * __pyx_v_children_right.strides[0]) ) + __pyx_t_10 * __pyx_v_children_right.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 6930, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6932 + * nodes_child.insert(children_right[b, it_node]) + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 0] = thresholds[b, it_node] + * + */ + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_15 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_10 * __pyx_v_features.strides[0]) ) + __pyx_t_11 * __pyx_v_features.strides[1]) ))); + __pyx_t_12 = 0; + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_15 * __pyx_v_partition.strides[0]) ) + __pyx_t_12 * __pyx_v_partition.strides[1]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_14 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_13 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6933 + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: + * partition[features[b, it_node], 0] = thresholds[b, it_node] # <<<<<<<<<<<<<< + * + * it = in_data.begin() + */ + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_12 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_11 * __pyx_v_features.strides[0]) ) + __pyx_t_10 * __pyx_v_features.strides[1]) ))); + __pyx_t_15 = 0; + *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_12 * __pyx_v_partition.strides[0]) ) + __pyx_t_15 * __pyx_v_partition.strides[1]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_13 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_14 * __pyx_v_thresholds.strides[1]) ))); + + /* "cyext_acv.pyx":6932 + * nodes_child.insert(children_right[b, it_node]) + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 0] = thresholds[b, it_node] + * + */ + } + + /* "cyext_acv.pyx":6935 + * partition[features[b, it_node], 0] = thresholds[b, it_node] + * + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + */ + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":6936 + * + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":6937 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_10 = (*__pyx_v_it); + __pyx_t_11 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_14 * __pyx_v_features.strides[0]) ) + __pyx_t_13 * __pyx_v_features.strides[1]) ))); + __pyx_t_15 = __pyx_v_b; + __pyx_t_12 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_data.data + __pyx_t_10 * __pyx_v_data.strides[0]) ) + __pyx_t_11 * __pyx_v_data.strides[1]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_15 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_12 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6938 + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) # <<<<<<<<<<<<<< + * inc(it) + * in_data = in_data_b + */ + (void)(__pyx_v_in_data_b.erase((*__pyx_v_it))); + + /* "cyext_acv.pyx":6937 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + } + + /* "cyext_acv.pyx":6939 + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + * inc(it) # <<<<<<<<<<<<<< + * in_data = in_data_b + * + */ + (void)((++__pyx_v_it)); + } + + /* "cyext_acv.pyx":6940 + * in_data_b.erase(deref(it)) + * inc(it) + * in_data = in_data_b # <<<<<<<<<<<<<< + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] <= thresholds[b, it_node]: + */ + __pyx_v_in_data = __pyx_v_in_data_b; + } + __pyx_L12:; + + /* "cyext_acv.pyx":6915 + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): # <<<<<<<<<<<<<< + * if x[features[b, it_node]] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) + */ + goto __pyx_L11; + } + + /* "cyext_acv.pyx":6942 + * in_data = in_data_b + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * + */ + __pyx_t_12 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_16 = (((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_12 * __pyx_v_features.strides[0]) ) + __pyx_t_15 * __pyx_v_features.strides[1]) ))) >= 0) != 0); + if (__pyx_t_16) { + } else { + __pyx_t_9 = __pyx_t_16; + goto __pyx_L21_bool_binop_done; + } + __pyx_t_15 = __pyx_v_b; + __pyx_t_12 = __pyx_v_it_node; + __pyx_t_13 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_15 * __pyx_v_features.strides[0]) ) + __pyx_t_12 * __pyx_v_features.strides[1]) ))); + __pyx_t_14 = 1; + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_16 = (((*((double const *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_cond.data + __pyx_t_13 * __pyx_v_cond.strides[0]) ) + __pyx_t_14 * __pyx_v_cond.strides[1]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_11 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_10 * __pyx_v_thresholds.strides[1]) )))) != 0); + __pyx_t_9 = __pyx_t_16; + __pyx_L21_bool_binop_done:; + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6943 + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) # <<<<<<<<<<<<<< + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + */ + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_left.data + __pyx_t_10 * __pyx_v_children_left.strides[0]) ) + __pyx_t_11 * __pyx_v_children_left.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 6943, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6945 + * nodes_child.insert(children_left[b, it_node]) + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 1] = thresholds[b, it_node] + * + */ + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_12 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_11 * __pyx_v_features.strides[0]) ) + __pyx_t_10 * __pyx_v_features.strides[1]) ))); + __pyx_t_15 = 1; + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_12 * __pyx_v_partition.strides[0]) ) + __pyx_t_15 * __pyx_v_partition.strides[1]) ))) >= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_14 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_13 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6946 + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + * partition[features[b, it_node], 1] = thresholds[b, it_node] # <<<<<<<<<<<<<< + * + * it = in_data.begin() + */ + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_15 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_10 * __pyx_v_features.strides[0]) ) + __pyx_t_11 * __pyx_v_features.strides[1]) ))); + __pyx_t_12 = 1; + *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_15 * __pyx_v_partition.strides[0]) ) + __pyx_t_12 * __pyx_v_partition.strides[1]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_13 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_14 * __pyx_v_thresholds.strides[1]) ))); + + /* "cyext_acv.pyx":6945 + * nodes_child.insert(children_left[b, it_node]) + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 1] = thresholds[b, it_node] + * + */ + } + + /* "cyext_acv.pyx":6948 + * partition[features[b, it_node], 1] = thresholds[b, it_node] + * + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + */ + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":6949 + * + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":6950 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_11 = (*__pyx_v_it); + __pyx_t_10 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_14 * __pyx_v_features.strides[0]) ) + __pyx_t_13 * __pyx_v_features.strides[1]) ))); + __pyx_t_12 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_data.data + __pyx_t_11 * __pyx_v_data.strides[0]) ) + __pyx_t_10 * __pyx_v_data.strides[1]) ))) > (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_12 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_15 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6951 + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) # <<<<<<<<<<<<<< + * inc(it) + * in_data = in_data_b + */ + (void)(__pyx_v_in_data_b.erase((*__pyx_v_it))); + + /* "cyext_acv.pyx":6950 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + } + + /* "cyext_acv.pyx":6952 + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + * inc(it) # <<<<<<<<<<<<<< + * in_data = in_data_b + * + */ + (void)((++__pyx_v_it)); + } + + /* "cyext_acv.pyx":6953 + * in_data_b.erase(deref(it)) + * inc(it) + * in_data = in_data_b # <<<<<<<<<<<<<< + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 0] > thresholds[b, it_node]: + */ + __pyx_v_in_data = __pyx_v_in_data_b; + + /* "cyext_acv.pyx":6942 + * in_data = in_data_b + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * + */ + goto __pyx_L11; + } + + /* "cyext_acv.pyx":6955 + * in_data = in_data_b + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 0] > thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_right[b, it_node]) + * + */ + __pyx_t_15 = __pyx_v_b; + __pyx_t_12 = __pyx_v_it_node; + __pyx_t_16 = (((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_15 * __pyx_v_features.strides[0]) ) + __pyx_t_12 * __pyx_v_features.strides[1]) ))) >= 0) != 0); + if (__pyx_t_16) { + } else { + __pyx_t_9 = __pyx_t_16; + goto __pyx_L27_bool_binop_done; + } + __pyx_t_12 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_13 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_12 * __pyx_v_features.strides[0]) ) + __pyx_t_15 * __pyx_v_features.strides[1]) ))); + __pyx_t_14 = 0; + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_16 = (((*((double const *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_cond.data + __pyx_t_13 * __pyx_v_cond.strides[0]) ) + __pyx_t_14 * __pyx_v_cond.strides[1]) ))) > (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_10 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_11 * __pyx_v_thresholds.strides[1]) )))) != 0); + __pyx_t_9 = __pyx_t_16; + __pyx_L27_bool_binop_done:; + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6956 + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 0] > thresholds[b, it_node]: + * nodes_child.insert(children_right[b, it_node]) # <<<<<<<<<<<<<< + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: + */ + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_right.data + __pyx_t_11 * __pyx_v_children_right.strides[0]) ) + __pyx_t_10 * __pyx_v_children_right.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 6956, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6958 + * nodes_child.insert(children_right[b, it_node]) + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 0] = thresholds[b, it_node] + * + */ + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_15 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_10 * __pyx_v_features.strides[0]) ) + __pyx_t_11 * __pyx_v_features.strides[1]) ))); + __pyx_t_12 = 0; + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_15 * __pyx_v_partition.strides[0]) ) + __pyx_t_12 * __pyx_v_partition.strides[1]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_14 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_13 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6959 + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: + * partition[features[b, it_node], 0] = thresholds[b, it_node] # <<<<<<<<<<<<<< + * + * it = in_data.begin() + */ + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_12 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_11 * __pyx_v_features.strides[0]) ) + __pyx_t_10 * __pyx_v_features.strides[1]) ))); + __pyx_t_15 = 0; + *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_12 * __pyx_v_partition.strides[0]) ) + __pyx_t_15 * __pyx_v_partition.strides[1]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_13 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_14 * __pyx_v_thresholds.strides[1]) ))); + + /* "cyext_acv.pyx":6958 + * nodes_child.insert(children_right[b, it_node]) + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 0] = thresholds[b, it_node] + * + */ + } + + /* "cyext_acv.pyx":6961 + * partition[features[b, it_node], 0] = thresholds[b, it_node] + * + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + */ + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":6962 + * + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":6963 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_10 = (*__pyx_v_it); + __pyx_t_11 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_14 * __pyx_v_features.strides[0]) ) + __pyx_t_13 * __pyx_v_features.strides[1]) ))); + __pyx_t_15 = __pyx_v_b; + __pyx_t_12 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_data.data + __pyx_t_10 * __pyx_v_data.strides[0]) ) + __pyx_t_11 * __pyx_v_data.strides[1]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_15 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_12 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6964 + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) # <<<<<<<<<<<<<< + * inc(it) + * in_data = in_data_b + */ + (void)(__pyx_v_in_data_b.erase((*__pyx_v_it))); + + /* "cyext_acv.pyx":6963 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + } + + /* "cyext_acv.pyx":6965 + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + * inc(it) # <<<<<<<<<<<<<< + * in_data = in_data_b + * + */ + (void)((++__pyx_v_it)); + } + + /* "cyext_acv.pyx":6966 + * in_data_b.erase(deref(it)) + * inc(it) + * in_data = in_data_b # <<<<<<<<<<<<<< + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] >= thresholds[b, it_node] and cond[features[b, it_node], 0] <= thresholds[b, it_node]: + */ + __pyx_v_in_data = __pyx_v_in_data_b; + + /* "cyext_acv.pyx":6955 + * in_data = in_data_b + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 0] > thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_right[b, it_node]) + * + */ + goto __pyx_L11; + } + + /* "cyext_acv.pyx":6968 + * in_data = in_data_b + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] >= thresholds[b, it_node] and cond[features[b, it_node], 0] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * nodes_child.insert(children_right[b, it_node]) + */ + __pyx_t_12 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_16 = (((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_12 * __pyx_v_features.strides[0]) ) + __pyx_t_15 * __pyx_v_features.strides[1]) ))) >= 0) != 0); + if (__pyx_t_16) { + } else { + __pyx_t_9 = __pyx_t_16; + goto __pyx_L33_bool_binop_done; + } + __pyx_t_15 = __pyx_v_b; + __pyx_t_12 = __pyx_v_it_node; + __pyx_t_13 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_15 * __pyx_v_features.strides[0]) ) + __pyx_t_12 * __pyx_v_features.strides[1]) ))); + __pyx_t_14 = 1; + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_16 = (((*((double const *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_cond.data + __pyx_t_13 * __pyx_v_cond.strides[0]) ) + __pyx_t_14 * __pyx_v_cond.strides[1]) ))) >= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_11 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_10 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_16) { + } else { + __pyx_t_9 = __pyx_t_16; + goto __pyx_L33_bool_binop_done; + } + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_12 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_10 * __pyx_v_features.strides[0]) ) + __pyx_t_11 * __pyx_v_features.strides[1]) ))); + __pyx_t_15 = 0; + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_16 = (((*((double const *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_cond.data + __pyx_t_12 * __pyx_v_cond.strides[0]) ) + __pyx_t_15 * __pyx_v_cond.strides[1]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_14 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_13 * __pyx_v_thresholds.strides[1]) )))) != 0); + __pyx_t_9 = __pyx_t_16; + __pyx_L33_bool_binop_done:; + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6969 + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] >= thresholds[b, it_node] and cond[features[b, it_node], 0] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) # <<<<<<<<<<<<<< + * nodes_child.insert(children_right[b, it_node]) + * + */ + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_left.data + __pyx_t_13 * __pyx_v_children_left.strides[0]) ) + __pyx_t_14 * __pyx_v_children_left.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 6969, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6970 + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] >= thresholds[b, it_node] and cond[features[b, it_node], 0] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) + * nodes_child.insert(children_right[b, it_node]) # <<<<<<<<<<<<<< + * + * # if partition[features[b, it_node], 0] <= thresholds[b, it_node]: # TO DO: compute correctly the partition in this case + */ + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_right.data + __pyx_t_14 * __pyx_v_children_right.strides[0]) ) + __pyx_t_13 * __pyx_v_children_right.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 6970, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6968 + * in_data = in_data_b + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] >= thresholds[b, it_node] and cond[features[b, it_node], 0] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * nodes_child.insert(children_right[b, it_node]) + */ + goto __pyx_L11; + } + + /* "cyext_acv.pyx":6986 + * + * else: + * nodes_child.insert(children_left[b, it_node]) # <<<<<<<<<<<<<< + * nodes_child.insert(children_right[b, it_node]) + * + */ + /*else*/ { + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_left.data + __pyx_t_13 * __pyx_v_children_left.strides[0]) ) + __pyx_t_14 * __pyx_v_children_left.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 6986, __pyx_L1_error) + } + + /* "cyext_acv.pyx":6987 + * else: + * nodes_child.insert(children_left[b, it_node]) + * nodes_child.insert(children_right[b, it_node]) # <<<<<<<<<<<<<< + * + * if in_data.size() < min_node_size: + */ + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_right.data + __pyx_t_14 * __pyx_v_children_right.strides[0]) ) + __pyx_t_13 * __pyx_v_children_right.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 6987, __pyx_L1_error) + } + } + __pyx_L11:; + + /* "cyext_acv.pyx":6989 + * nodes_child.insert(children_right[b, it_node]) + * + * if in_data.size() < min_node_size: # <<<<<<<<<<<<<< + * break + * inc(it_point) + */ + __pyx_t_9 = ((__pyx_v_in_data.size() < __pyx_v_min_node_size) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6990 + * + * if in_data.size() < min_node_size: + * break # <<<<<<<<<<<<<< + * inc(it_point) + * + */ + goto __pyx_L10_break; + + /* "cyext_acv.pyx":6989 + * nodes_child.insert(children_right[b, it_node]) + * + * if in_data.size() < min_node_size: # <<<<<<<<<<<<<< + * break + * inc(it_point) + */ + } + + /* "cyext_acv.pyx":6991 + * if in_data.size() < min_node_size: + * break + * inc(it_point) # <<<<<<<<<<<<<< + * + * nodes_level = nodes_child + */ + (void)((++__pyx_v_it_point)); + } + __pyx_L10_break:; + + /* "cyext_acv.pyx":6993 + * inc(it_point) + * + * nodes_level = nodes_child # <<<<<<<<<<<<<< + * + * if classifier == 1: + */ + __pyx_v_nodes_level = __pyx_v_nodes_child; + } + + /* "cyext_acv.pyx":6995 + * nodes_level = nodes_child + * + * if classifier == 1: # <<<<<<<<<<<<<< + * it = in_data.begin() + * while(it != in_data.end()): + */ + __pyx_t_9 = ((__pyx_v_classifier == 1) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":6996 + * + * if classifier == 1: + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (y_x == y_data[deref(it)]) + */ + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":6997 + * if classifier == 1: + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * sdp += (1./(n_trees*in_data.size())) * (y_x == y_data[deref(it)]) + * w[deref(it)] += (1./(n_trees*in_data.size())) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":6998 + * it = in_data.begin() + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (y_x == y_data[deref(it)]) # <<<<<<<<<<<<<< + * w[deref(it)] += (1./(n_trees*in_data.size())) + * inc(it) + */ + __pyx_t_13 = (*__pyx_v_it); + __pyx_v_sdp = (__pyx_v_sdp + ((1. / (__pyx_v_n_trees * __pyx_v_in_data.size())) * (__pyx_v_y_x == (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_13)) )))))); + + /* "cyext_acv.pyx":6999 + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (y_x == y_data[deref(it)]) + * w[deref(it)] += (1./(n_trees*in_data.size())) # <<<<<<<<<<<<<< + * inc(it) + * else: + */ + __pyx_t_13 = (*__pyx_v_it); + *((double *) ( /* dim=0 */ (__pyx_v_w.data + __pyx_t_13 * __pyx_v_w.strides[0]) )) += (1. / (__pyx_v_n_trees * __pyx_v_in_data.size())); + + /* "cyext_acv.pyx":7000 + * sdp += (1./(n_trees*in_data.size())) * (y_x == y_data[deref(it)]) + * w[deref(it)] += (1./(n_trees*in_data.size())) + * inc(it) # <<<<<<<<<<<<<< + * else: + * it = in_data.begin() + */ + (void)((++__pyx_v_it)); + } + + /* "cyext_acv.pyx":6995 + * nodes_level = nodes_child + * + * if classifier == 1: # <<<<<<<<<<<<<< + * it = in_data.begin() + * while(it != in_data.end()): + */ + goto __pyx_L37; + } + + /* "cyext_acv.pyx":7002 + * inc(it) + * else: + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (down <=y_data[deref(it)]<= up) + */ + /*else*/ { + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":7003 + * else: + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * sdp += (1./(n_trees*in_data.size())) * (down <=y_data[deref(it)]<= up) + * w[deref(it)] += (1./(n_trees*in_data.size())) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":7004 + * it = in_data.begin() + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (down <=y_data[deref(it)]<= up) # <<<<<<<<<<<<<< + * w[deref(it)] += (1./(n_trees*in_data.size())) + * inc(it) + */ + __pyx_t_13 = (*__pyx_v_it); + __pyx_t_17 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_13)) ))); + __pyx_t_9 = (__pyx_v_down <= __pyx_t_17); + if (__pyx_t_9) { + __pyx_t_9 = (__pyx_t_17 <= __pyx_v_up); + } + __pyx_v_sdp = (__pyx_v_sdp + ((1. / (__pyx_v_n_trees * __pyx_v_in_data.size())) * __pyx_t_9)); + + /* "cyext_acv.pyx":7005 + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (down <=y_data[deref(it)]<= up) + * w[deref(it)] += (1./(n_trees*in_data.size())) # <<<<<<<<<<<<<< + * inc(it) + * + */ + __pyx_t_13 = (*__pyx_v_it); + *((double *) ( /* dim=0 */ (__pyx_v_w.data + __pyx_t_13 * __pyx_v_w.strides[0]) )) += (1. / (__pyx_v_n_trees * __pyx_v_in_data.size())); + + /* "cyext_acv.pyx":7006 + * sdp += (1./(n_trees*in_data.size())) * (down <=y_data[deref(it)]<= up) + * w[deref(it)] += (1./(n_trees*in_data.size())) + * inc(it) # <<<<<<<<<<<<<< + * + * return sdp + */ + (void)((++__pyx_v_it)); + } + } + __pyx_L37:; + } + + /* "cyext_acv.pyx":7008 + * inc(it) + * + * return sdp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_sdp; + goto __pyx_L0; + + /* "cyext_acv.pyx":6885 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cdef double single_compute_cdp_cond_rule_weights(double[:] & x, double & y_x, double & down, double & up, double[:, :] & data, double[::1] & y_data, vector[int] & S, # <<<<<<<<<<<<<< + * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + * int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("cyext_acv.single_compute_cdp_cond_rule_weights", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_r = 0; + __pyx_L0:; + return __pyx_r; +} + +/* "cyext_acv.pyx":7015 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_cdp_cond_weights(double[:, :] X, double[::1] y_X, double[::1] down, double[::1] up, double[:, :] data, double[::1] y_data, vector[vector[int]] S, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * const double [:, :, :] & cond, + */ + +static PyObject *__pyx_pw_9cyext_acv_115compute_cdp_cond_weights(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_cdp_cond_weights(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_down, __Pyx_memviewslice __pyx_v_up, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, __Pyx_memviewslice &__pyx_v_cond, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, CYTHON_UNUSED double &__pyx_v_pi, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_buffer = NULL; + __Pyx_memviewslice __pyx_v_partition_byobs = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_N; + __Pyx_memviewslice __pyx_v_sdp = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_weights = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __Pyx_memviewslice __pyx_t_16 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_17 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_18 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_19; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_cdp_cond_weights", 0); + + /* "cyext_acv.pyx":7020 + * int max_depth, int min_node_size, int & classifier, double[:, :] & t, double & pi): + * + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) # <<<<<<<<<<<<<< + * buffer[:, :, 0] = -1e+10 + * cdef double [:, :, :] partition_byobs = buffer + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7020, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ones); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7020, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7020, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_X.shape[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7020, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_X.shape[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7020, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7020, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_INCREF(__pyx_int_2); + __Pyx_GIVEREF(__pyx_int_2); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_2); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 7020, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7020, __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 = PyNumber_Multiply(__pyx_float_1e_10, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7020, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_buffer = __pyx_t_1; + __pyx_t_1 = 0; + + /* "cyext_acv.pyx":7021 + * + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + * buffer[:, :, 0] = -1e+10 # <<<<<<<<<<<<<< + * cdef double [:, :, :] partition_byobs = buffer + * + */ + if (unlikely(PyObject_SetItem(__pyx_v_buffer, __pyx_tuple__3, __pyx_float_neg_1e_10) < 0)) __PYX_ERR(0, 7021, __pyx_L1_error) + + /* "cyext_acv.pyx":7022 + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + * buffer[:, :, 0] = -1e+10 + * cdef double [:, :, :] partition_byobs = buffer # <<<<<<<<<<<<<< + * + * cdef int N = X.shape[0] + */ + __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_v_buffer, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 7022, __pyx_L1_error) + __pyx_v_partition_byobs = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "cyext_acv.pyx":7024 + * cdef double [:, :, :] partition_byobs = buffer + * + * cdef int N = X.shape[0] # <<<<<<<<<<<<<< + * cdef double[::1] sdp = np.zeros(N) + * cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + */ + __pyx_v_N = (__pyx_v_X.shape[0]); + + /* "cyext_acv.pyx":7025 + * + * cdef int N = X.shape[0] + * cdef double[::1] sdp = np.zeros(N) # <<<<<<<<<<<<<< + * cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + * cdef int i, j + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7025, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7025, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7025, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7025, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 7025, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp = __pyx_t_7; + __pyx_t_7.memview = NULL; + __pyx_t_7.data = NULL; + + /* "cyext_acv.pyx":7026 + * cdef int N = X.shape[0] + * cdef double[::1] sdp = np.zeros(N) + * cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) # <<<<<<<<<<<<<< + * cdef int i, j + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7026, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7026, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7026, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7026, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_data.shape[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7026, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7026, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __pyx_t_5 = 0; + __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_3) < 0) __PYX_ERR(0, 7026, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7026, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 7026, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_weights = __pyx_t_8; + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; + + /* "cyext_acv.pyx":7029 + * cdef int i, j + * + * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_cdp_cond_rule_weights(X[i], y_X[i], down[i], up[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + __pyx_t_9 = __pyx_v_N; + if ((1 == 0)) abort(); + { + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) (x) + #define unlikely(x) (x) + #endif + __pyx_t_11 = (__pyx_t_9 - 0 + 1 - 1/abs(1)) / 1; + if (__pyx_t_11 > 0) + { + #ifdef _OPENMP + #pragma omp parallel private(__pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_19) firstprivate(__pyx_t_12, __pyx_t_16, __pyx_t_17, __pyx_t_18, __pyx_t_8) + #endif /* _OPENMP */ + { + #ifdef _OPENMP + #pragma omp for firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) schedule(dynamic) + #endif /* _OPENMP */ + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_11; __pyx_t_10++){ + { + __pyx_v_i = (int)(0 + 1 * __pyx_t_10); + + /* "cyext_acv.pyx":7030 + * + * for i in prange(N, nogil=True, schedule='dynamic'): + * sdp[i] = single_compute_cdp_cond_rule_weights(X[i], y_X[i], down[i], up[i], data, y_data, S[i], # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i], cond[i]) + */ + __pyx_t_12.data = __pyx_v_X.data; + __pyx_t_12.memview = __pyx_v_X.memview; + __PYX_INC_MEMVIEW(&__pyx_t_12, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_X.strides[0]; + __pyx_t_12.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_12.shape[0] = __pyx_v_X.shape[1]; +__pyx_t_12.strides[0] = __pyx_v_X.strides[1]; + __pyx_t_12.suboffsets[0] = -1; + +__pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_i; + __pyx_t_15 = __pyx_v_i; + + /* "cyext_acv.pyx":7032 + * sdp[i] = single_compute_cdp_cond_rule_weights(X[i], y_X[i], down[i], up[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i], cond[i]) # <<<<<<<<<<<<<< + * + * return np.array(sdp), np.array(weights) + */ + __pyx_t_16.data = __pyx_v_t.data; + __pyx_t_16.memview = __pyx_v_t.memview; + __PYX_INC_MEMVIEW(&__pyx_t_16, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_t.strides[0]; + __pyx_t_16.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_16.shape[0] = __pyx_v_t.shape[1]; +__pyx_t_16.strides[0] = __pyx_v_t.strides[1]; + __pyx_t_16.suboffsets[0] = -1; + +__pyx_t_8.data = __pyx_v_partition_byobs.data; + __pyx_t_8.memview = __pyx_v_partition_byobs.memview; + __PYX_INC_MEMVIEW(&__pyx_t_8, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_partition_byobs.strides[0]; + __pyx_t_8.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_8.shape[0] = __pyx_v_partition_byobs.shape[1]; +__pyx_t_8.strides[0] = __pyx_v_partition_byobs.strides[1]; + __pyx_t_8.suboffsets[0] = -1; + +__pyx_t_8.shape[1] = __pyx_v_partition_byobs.shape[2]; +__pyx_t_8.strides[1] = __pyx_v_partition_byobs.strides[2]; + __pyx_t_8.suboffsets[1] = -1; + +__pyx_t_17.data = __pyx_v_weights.data; + __pyx_t_17.memview = __pyx_v_weights.memview; + __PYX_INC_MEMVIEW(&__pyx_t_17, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_weights.strides[0]; + __pyx_t_17.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_17.shape[0] = __pyx_v_weights.shape[1]; +__pyx_t_17.strides[0] = __pyx_v_weights.strides[1]; + __pyx_t_17.suboffsets[0] = -1; + +__pyx_t_18.data = __pyx_v_cond.data; + __pyx_t_18.memview = __pyx_v_cond.memview; + __PYX_INC_MEMVIEW(&__pyx_t_18, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_cond.strides[0]; + __pyx_t_18.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_18.shape[0] = __pyx_v_cond.shape[1]; +__pyx_t_18.strides[0] = __pyx_v_cond.strides[1]; + __pyx_t_18.suboffsets[0] = -1; + +__pyx_t_18.shape[1] = __pyx_v_cond.shape[2]; +__pyx_t_18.strides[1] = __pyx_v_cond.strides[2]; + __pyx_t_18.suboffsets[1] = -1; + +__pyx_t_19 = __pyx_v_i; + + /* "cyext_acv.pyx":7030 + * + * for i in prange(N, nogil=True, schedule='dynamic'): + * sdp[i] = single_compute_cdp_cond_rule_weights(X[i], y_X[i], down[i], up[i], data, y_data, S[i], # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i], cond[i]) + */ + *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_sdp.data) + __pyx_t_19)) )) = __pyx_f_9cyext_acv_single_compute_cdp_cond_rule_weights(__pyx_t_12, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_13)) ))), (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_down.data) + __pyx_t_14)) ))), (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_up.data) + __pyx_t_15)) ))), __pyx_v_data, __pyx_v_y_data, (__pyx_v_S[__pyx_v_i]), __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_t_16, __pyx_t_8, __pyx_t_17, __pyx_t_18); + __PYX_XDEC_MEMVIEW(&__pyx_t_12, 0); + __pyx_t_12.memview = NULL; + __pyx_t_12.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_16, 0); + __pyx_t_16.memview = NULL; + __pyx_t_16.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_8, 0); + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_17, 0); + __pyx_t_17.memview = NULL; + __pyx_t_17.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_18, 0); + __pyx_t_18.memview = NULL; + __pyx_t_18.data = NULL; + } + } + } + } + } + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #endif + } + + /* "cyext_acv.pyx":7029 + * cdef int i, j + * + * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_cdp_cond_rule_weights(X[i], y_X[i], down[i], up[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "cyext_acv.pyx":7034 + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i], cond[i]) + * + * return np.array(sdp), np.array(weights) # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7034, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7034, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_sdp, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7034, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7034, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7034, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7034, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_weights, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7034, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7034, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7034, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __pyx_t_3 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "cyext_acv.pyx":7015 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_cdp_cond_weights(double[:, :] X, double[::1] y_X, double[::1] down, double[::1] up, double[:, :] data, double[::1] y_data, vector[vector[int]] S, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * const double [:, :, :] & cond, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_18, 1); + __Pyx_AddTraceback("cyext_acv.compute_cdp_cond_weights", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_buffer); + __PYX_XDEC_MEMVIEW(&__pyx_v_partition_byobs, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_weights, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_9cyext_acv_115compute_cdp_cond_weights(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_9cyext_acv_115compute_cdp_cond_weights(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_down = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_up = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + std::vector > __pyx_v_S; + __Pyx_memviewslice __pyx_v_features = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_thresholds = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_left = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_right = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_cond = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_max_depth; + int __pyx_v_min_node_size; + int __pyx_v_classifier; + __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } }; + double __pyx_v_pi; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("compute_cdp_cond_weights (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_y_X,&__pyx_n_s_down,&__pyx_n_s_up,&__pyx_n_s_data,&__pyx_n_s_y_data,&__pyx_n_s_S,&__pyx_n_s_features,&__pyx_n_s_thresholds,&__pyx_n_s_children_left,&__pyx_n_s_children_right,&__pyx_n_s_cond,&__pyx_n_s_max_depth,&__pyx_n_s_min_node_size,&__pyx_n_s_classifier,&__pyx_n_s_t,&__pyx_n_s_pi,0}; + PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16); + CYTHON_FALLTHROUGH; + case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15); + CYTHON_FALLTHROUGH; + case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_X)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_cond_weights", 1, 17, 17, 1); __PYX_ERR(0, 7015, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_down)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_cond_weights", 1, 17, 17, 2); __PYX_ERR(0, 7015, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_up)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_cond_weights", 1, 17, 17, 3); __PYX_ERR(0, 7015, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_cond_weights", 1, 17, 17, 4); __PYX_ERR(0, 7015, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_cond_weights", 1, 17, 17, 5); __PYX_ERR(0, 7015, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_S)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_cond_weights", 1, 17, 17, 6); __PYX_ERR(0, 7015, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_features)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_cond_weights", 1, 17, 17, 7); __PYX_ERR(0, 7015, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thresholds)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_cond_weights", 1, 17, 17, 8); __PYX_ERR(0, 7015, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_left)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_cond_weights", 1, 17, 17, 9); __PYX_ERR(0, 7015, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_cond_weights", 1, 17, 17, 10); __PYX_ERR(0, 7015, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_cond_weights", 1, 17, 17, 11); __PYX_ERR(0, 7015, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_cond_weights", 1, 17, 17, 12); __PYX_ERR(0, 7015, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 13: + if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_node_size)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_cond_weights", 1, 17, 17, 13); __PYX_ERR(0, 7015, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 14: + if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classifier)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_cond_weights", 1, 17, 17, 14); __PYX_ERR(0, 7015, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 15: + if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_cond_weights", 1, 17, 17, 15); __PYX_ERR(0, 7015, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 16: + if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pi)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_cond_weights", 1, 17, 17, 16); __PYX_ERR(0, 7015, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_cdp_cond_weights") < 0)) __PYX_ERR(0, 7015, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 17) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + values[15] = PyTuple_GET_ITEM(__pyx_args, 15); + values[16] = PyTuple_GET_ITEM(__pyx_args, 16); + } + __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 7015, __pyx_L3_error) + __pyx_v_y_X = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_X.memview)) __PYX_ERR(0, 7015, __pyx_L3_error) + __pyx_v_down = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_down.memview)) __PYX_ERR(0, 7015, __pyx_L3_error) + __pyx_v_up = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_up.memview)) __PYX_ERR(0, 7015, __pyx_L3_error) + __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 7015, __pyx_L3_error) + __pyx_v_y_data = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_data.memview)) __PYX_ERR(0, 7015, __pyx_L3_error) + __pyx_v_S = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_int_3e___(values[6]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 7015, __pyx_L3_error) + __pyx_v_features = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_features.memview)) __PYX_ERR(0, 7016, __pyx_L3_error) + __pyx_v_thresholds = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_thresholds.memview)) __PYX_ERR(0, 7016, __pyx_L3_error) + __pyx_v_children_left = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[9], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_left.memview)) __PYX_ERR(0, 7016, __pyx_L3_error) + __pyx_v_children_right = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[10], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_right.memview)) __PYX_ERR(0, 7016, __pyx_L3_error) + __pyx_v_cond = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double__const__(values[11], 0); if (unlikely(!__pyx_v_cond.memview)) __PYX_ERR(0, 7017, __pyx_L3_error) + __pyx_v_max_depth = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7018, __pyx_L3_error) + __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[13]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7018, __pyx_L3_error) + __pyx_v_classifier = __Pyx_PyInt_As_int(values[14]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7018, __pyx_L3_error) + __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[15], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 7018, __pyx_L3_error) + __pyx_v_pi = __pyx_PyFloat_AsDouble(values[16]); if (unlikely((__pyx_v_pi == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 7018, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("compute_cdp_cond_weights", 1, 17, 17, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7015, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cyext_acv.compute_cdp_cond_weights", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_9cyext_acv_114compute_cdp_cond_weights(__pyx_self, __pyx_v_X, __pyx_v_y_X, __pyx_v_down, __pyx_v_up, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_cond, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_v_pi); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9cyext_acv_114compute_cdp_cond_weights(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_down, __Pyx_memviewslice __pyx_v_up, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, __Pyx_memviewslice __pyx_v_cond, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t, double __pyx_v_pi) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_cdp_cond_weights", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundLocalError("X"); __PYX_ERR(0, 7015, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_X.memview)) { __Pyx_RaiseUnboundLocalError("y_X"); __PYX_ERR(0, 7015, __pyx_L1_error) } + if (unlikely(!__pyx_v_down.memview)) { __Pyx_RaiseUnboundLocalError("down"); __PYX_ERR(0, 7015, __pyx_L1_error) } + if (unlikely(!__pyx_v_up.memview)) { __Pyx_RaiseUnboundLocalError("up"); __PYX_ERR(0, 7015, __pyx_L1_error) } + if (unlikely(!__pyx_v_data.memview)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 7015, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_data.memview)) { __Pyx_RaiseUnboundLocalError("y_data"); __PYX_ERR(0, 7015, __pyx_L1_error) } + if (unlikely(!__pyx_v_features.memview)) { __Pyx_RaiseUnboundLocalError("features"); __PYX_ERR(0, 7015, __pyx_L1_error) } + if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 7015, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 7015, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 7015, __pyx_L1_error) } + if (unlikely(!__pyx_v_cond.memview)) { __Pyx_RaiseUnboundLocalError("cond"); __PYX_ERR(0, 7015, __pyx_L1_error) } + if (unlikely(!__pyx_v_t.memview)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 7015, __pyx_L1_error) } + __pyx_t_1 = __pyx_f_9cyext_acv_compute_cdp_cond_weights(__pyx_v_X, __pyx_v_y_X, __pyx_v_down, __pyx_v_up, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_cond, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_v_pi, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7015, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cyext_acv.compute_cdp_cond_weights", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_down, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_up, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_features, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_thresholds, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_left, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_right, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_cond, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_t, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cyext_acv.pyx":7040 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cdef double single_compute_cdp_rf(double[:] & x, double & y_x, double & down, double & up, double[:, :] & data, double[::1] & y_data, vector[int] & S, # <<<<<<<<<<<<<< + * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + * int & max_depth, int & min_node_size, int & classifier, double[:] & t) nogil: + */ + +static double __pyx_f_9cyext_acv_single_compute_cdp_rf(__Pyx_memviewslice &__pyx_v_x, double &__pyx_v_y_x, double &__pyx_v_down, double &__pyx_v_up, __Pyx_memviewslice &__pyx_v_data, __Pyx_memviewslice &__pyx_v_y_data, std::vector &__pyx_v_S, __Pyx_memviewslice &__pyx_v_features, __Pyx_memviewslice &__pyx_v_thresholds, __Pyx_memviewslice &__pyx_v_children_left, __Pyx_memviewslice &__pyx_v_children_right, int &__pyx_v_max_depth, int &__pyx_v_min_node_size, int &__pyx_v_classifier, CYTHON_UNUSED __Pyx_memviewslice &__pyx_v_t) { + unsigned int __pyx_v_n_trees; + unsigned int __pyx_v_N; + double __pyx_v_sdp; + int __pyx_v_b; + CYTHON_UNUSED int __pyx_v_level; + int __pyx_v_i; + int __pyx_v_it_node; + std::set __pyx_v_nodes_level; + std::set __pyx_v_nodes_child; + std::set __pyx_v_in_data; + std::set __pyx_v_in_data_b; + std::set ::iterator __pyx_v_it; + std::set ::iterator __pyx_v_it_point; + double __pyx_r; + unsigned int __pyx_t_1; + unsigned int __pyx_t_2; + int __pyx_t_3; + unsigned int __pyx_t_4; + unsigned int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + double __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "cyext_acv.pyx":7044 + * int & max_depth, int & min_node_size, int & classifier, double[:] & t) nogil: + * + * cdef unsigned int n_trees = features.shape[0] # <<<<<<<<<<<<<< + * cdef unsigned int N = data.shape[0] + * cdef double s, sdp + */ + __pyx_v_n_trees = (__pyx_v_features.shape[0]); + + /* "cyext_acv.pyx":7045 + * + * cdef unsigned int n_trees = features.shape[0] + * cdef unsigned int N = data.shape[0] # <<<<<<<<<<<<<< + * cdef double s, sdp + * cdef int o + */ + __pyx_v_N = (__pyx_v_data.shape[0]); + + /* "cyext_acv.pyx":7048 + * cdef double s, sdp + * cdef int o + * sdp = 0 # <<<<<<<<<<<<<< + * + * cdef int b, level, i, it_node + */ + __pyx_v_sdp = 0.0; + + /* "cyext_acv.pyx":7054 + * cdef set[int].iterator it, it_point + * + * for b in range(n_trees): # <<<<<<<<<<<<<< + * nodes_child.clear() + * nodes_level.clear() + */ + __pyx_t_1 = __pyx_v_n_trees; + __pyx_t_2 = __pyx_t_1; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_b = __pyx_t_3; + + /* "cyext_acv.pyx":7055 + * + * for b in range(n_trees): + * nodes_child.clear() # <<<<<<<<<<<<<< + * nodes_level.clear() + * nodes_level.insert(0) + */ + __pyx_v_nodes_child.clear(); + + /* "cyext_acv.pyx":7056 + * for b in range(n_trees): + * nodes_child.clear() + * nodes_level.clear() # <<<<<<<<<<<<<< + * nodes_level.insert(0) + * + */ + __pyx_v_nodes_level.clear(); + + /* "cyext_acv.pyx":7057 + * nodes_child.clear() + * nodes_level.clear() + * nodes_level.insert(0) # <<<<<<<<<<<<<< + * + * in_data.clear() + */ + try { + __pyx_v_nodes_level.insert(0); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 7057, __pyx_L1_error) + } + + /* "cyext_acv.pyx":7059 + * nodes_level.insert(0) + * + * in_data.clear() # <<<<<<<<<<<<<< + * in_data_b.clear() + * for i in range(N): + */ + __pyx_v_in_data.clear(); + + /* "cyext_acv.pyx":7060 + * + * in_data.clear() + * in_data_b.clear() # <<<<<<<<<<<<<< + * for i in range(N): + * in_data.insert(i) + */ + __pyx_v_in_data_b.clear(); + + /* "cyext_acv.pyx":7061 + * in_data.clear() + * in_data_b.clear() + * for i in range(N): # <<<<<<<<<<<<<< + * in_data.insert(i) + * in_data_b.insert(i) + */ + __pyx_t_4 = __pyx_v_N; + __pyx_t_5 = __pyx_t_4; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "cyext_acv.pyx":7062 + * in_data_b.clear() + * for i in range(N): + * in_data.insert(i) # <<<<<<<<<<<<<< + * in_data_b.insert(i) + * + */ + try { + __pyx_v_in_data.insert(__pyx_v_i); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 7062, __pyx_L1_error) + } + + /* "cyext_acv.pyx":7063 + * for i in range(N): + * in_data.insert(i) + * in_data_b.insert(i) # <<<<<<<<<<<<<< + * + * for level in range(max_depth): + */ + try { + __pyx_v_in_data_b.insert(__pyx_v_i); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 7063, __pyx_L1_error) + } + } + + /* "cyext_acv.pyx":7065 + * in_data_b.insert(i) + * + * for level in range(max_depth): # <<<<<<<<<<<<<< + * it_point = nodes_level.begin() + * while(it_point != nodes_level.end()): + */ + __pyx_t_6 = __pyx_v_max_depth; + __pyx_t_7 = __pyx_t_6; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_level = __pyx_t_8; + + /* "cyext_acv.pyx":7066 + * + * for level in range(max_depth): + * it_point = nodes_level.begin() # <<<<<<<<<<<<<< + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) + */ + __pyx_v_it_point = __pyx_v_nodes_level.begin(); + + /* "cyext_acv.pyx":7067 + * for level in range(max_depth): + * it_point = nodes_level.begin() + * while(it_point != nodes_level.end()): # <<<<<<<<<<<<<< + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it_point != __pyx_v_nodes_level.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":7068 + * it_point = nodes_level.begin() + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) # <<<<<<<<<<<<<< + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * if x[features[b, it_node]] <= thresholds[b, it_node]: + */ + __pyx_v_it_node = (*__pyx_v_it_point); + + /* "cyext_acv.pyx":7069 + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): # <<<<<<<<<<<<<< + * if x[features[b, it_node]] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) + */ + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_9 = ((std::find ::iterator,int>(__pyx_v_S.begin(), __pyx_v_S.end(), (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_10 * __pyx_v_features.strides[0]) ) + __pyx_t_11 * __pyx_v_features.strides[1]) )))) != __pyx_v_S.end()) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":7070 + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * if x[features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * + */ + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_12 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_11 * __pyx_v_features.strides[0]) ) + __pyx_t_10 * __pyx_v_features.strides[1]) ))); + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_12 * __pyx_v_x.strides[0]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_13 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_14 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":7071 + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * if x[features[b, it_node]] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) # <<<<<<<<<<<<<< + * + * it = in_data.begin() + */ + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_left.data + __pyx_t_14 * __pyx_v_children_left.strides[0]) ) + __pyx_t_13 * __pyx_v_children_left.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 7071, __pyx_L1_error) + } + + /* "cyext_acv.pyx":7073 + * nodes_child.insert(children_left[b, it_node]) + * + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + */ + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":7074 + * + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":7075 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + __pyx_t_10 = (*__pyx_v_it); + __pyx_t_11 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_13 * __pyx_v_features.strides[0]) ) + __pyx_t_14 * __pyx_v_features.strides[1]) ))); + __pyx_t_12 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_data.data + __pyx_t_10 * __pyx_v_data.strides[0]) ) + __pyx_t_11 * __pyx_v_data.strides[1]) ))) > (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_12 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_15 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":7076 + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) # <<<<<<<<<<<<<< + * inc(it) + * in_data = in_data_b + */ + (void)(__pyx_v_in_data_b.erase((*__pyx_v_it))); + + /* "cyext_acv.pyx":7075 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + } + + /* "cyext_acv.pyx":7077 + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + * inc(it) # <<<<<<<<<<<<<< + * in_data = in_data_b + * + */ + (void)((++__pyx_v_it)); + } + + /* "cyext_acv.pyx":7078 + * in_data_b.erase(deref(it)) + * inc(it) + * in_data = in_data_b # <<<<<<<<<<<<<< + * + * else: + */ + __pyx_v_in_data = __pyx_v_in_data_b; + + /* "cyext_acv.pyx":7070 + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * if x[features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * + */ + goto __pyx_L12; + } + + /* "cyext_acv.pyx":7081 + * + * else: + * nodes_child.insert(children_right[b, it_node]) # <<<<<<<<<<<<<< + * + * it = in_data.begin() + */ + /*else*/ { + __pyx_t_15 = __pyx_v_b; + __pyx_t_12 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_right.data + __pyx_t_15 * __pyx_v_children_right.strides[0]) ) + __pyx_t_12 * __pyx_v_children_right.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 7081, __pyx_L1_error) + } + + /* "cyext_acv.pyx":7083 + * nodes_child.insert(children_right[b, it_node]) + * + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + */ + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":7084 + * + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":7085 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + __pyx_t_12 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_14 = (*__pyx_v_it); + __pyx_t_13 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_12 * __pyx_v_features.strides[0]) ) + __pyx_t_15 * __pyx_v_features.strides[1]) ))); + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_data.data + __pyx_t_14 * __pyx_v_data.strides[0]) ) + __pyx_t_13 * __pyx_v_data.strides[1]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_11 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_10 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":7086 + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) # <<<<<<<<<<<<<< + * inc(it) + * in_data = in_data_b + */ + (void)(__pyx_v_in_data_b.erase((*__pyx_v_it))); + + /* "cyext_acv.pyx":7085 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + } + + /* "cyext_acv.pyx":7087 + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + * inc(it) # <<<<<<<<<<<<<< + * in_data = in_data_b + * else: + */ + (void)((++__pyx_v_it)); + } + + /* "cyext_acv.pyx":7088 + * in_data_b.erase(deref(it)) + * inc(it) + * in_data = in_data_b # <<<<<<<<<<<<<< + * else: + * nodes_child.insert(children_left[b, it_node]) + */ + __pyx_v_in_data = __pyx_v_in_data_b; + } + __pyx_L12:; + + /* "cyext_acv.pyx":7069 + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): # <<<<<<<<<<<<<< + * if x[features[b, it_node]] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) + */ + goto __pyx_L11; + } + + /* "cyext_acv.pyx":7090 + * in_data = in_data_b + * else: + * nodes_child.insert(children_left[b, it_node]) # <<<<<<<<<<<<<< + * nodes_child.insert(children_right[b, it_node]) + * + */ + /*else*/ { + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_left.data + __pyx_t_10 * __pyx_v_children_left.strides[0]) ) + __pyx_t_11 * __pyx_v_children_left.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 7090, __pyx_L1_error) + } + + /* "cyext_acv.pyx":7091 + * else: + * nodes_child.insert(children_left[b, it_node]) + * nodes_child.insert(children_right[b, it_node]) # <<<<<<<<<<<<<< + * + * if in_data.size() < min_node_size: + */ + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_right.data + __pyx_t_11 * __pyx_v_children_right.strides[0]) ) + __pyx_t_10 * __pyx_v_children_right.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 7091, __pyx_L1_error) + } + } + __pyx_L11:; + + /* "cyext_acv.pyx":7093 + * nodes_child.insert(children_right[b, it_node]) + * + * if in_data.size() < min_node_size: # <<<<<<<<<<<<<< + * break + * inc(it_point) + */ + __pyx_t_9 = ((__pyx_v_in_data.size() < __pyx_v_min_node_size) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":7094 + * + * if in_data.size() < min_node_size: + * break # <<<<<<<<<<<<<< + * inc(it_point) + * + */ + goto __pyx_L10_break; + + /* "cyext_acv.pyx":7093 + * nodes_child.insert(children_right[b, it_node]) + * + * if in_data.size() < min_node_size: # <<<<<<<<<<<<<< + * break + * inc(it_point) + */ + } + + /* "cyext_acv.pyx":7095 + * if in_data.size() < min_node_size: + * break + * inc(it_point) # <<<<<<<<<<<<<< + * + * nodes_level = nodes_child + */ + (void)((++__pyx_v_it_point)); + } + __pyx_L10_break:; + + /* "cyext_acv.pyx":7097 + * inc(it_point) + * + * nodes_level = nodes_child # <<<<<<<<<<<<<< + * + * if classifier == 1: + */ + __pyx_v_nodes_level = __pyx_v_nodes_child; + } + + /* "cyext_acv.pyx":7099 + * nodes_level = nodes_child + * + * if classifier == 1: # <<<<<<<<<<<<<< + * it = in_data.begin() + * while(it != in_data.end()): + */ + __pyx_t_9 = ((__pyx_v_classifier == 1) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":7100 + * + * if classifier == 1: + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (y_x == y_data[deref(it)]) + */ + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":7101 + * if classifier == 1: + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * sdp += (1./(n_trees*in_data.size())) * (y_x == y_data[deref(it)]) + * inc(it) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":7102 + * it = in_data.begin() + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (y_x == y_data[deref(it)]) # <<<<<<<<<<<<<< + * inc(it) + * else: + */ + __pyx_t_10 = (*__pyx_v_it); + __pyx_v_sdp = (__pyx_v_sdp + ((1. / (__pyx_v_n_trees * __pyx_v_in_data.size())) * (__pyx_v_y_x == (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_10)) )))))); + + /* "cyext_acv.pyx":7103 + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (y_x == y_data[deref(it)]) + * inc(it) # <<<<<<<<<<<<<< + * else: + * it = in_data.begin() + */ + (void)((++__pyx_v_it)); + } + + /* "cyext_acv.pyx":7099 + * nodes_level = nodes_child + * + * if classifier == 1: # <<<<<<<<<<<<<< + * it = in_data.begin() + * while(it != in_data.end()): + */ + goto __pyx_L20; + } + + /* "cyext_acv.pyx":7105 + * inc(it) + * else: + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (down<=y_data[deref(it)]<= up) + */ + /*else*/ { + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":7106 + * else: + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * sdp += (1./(n_trees*in_data.size())) * (down<=y_data[deref(it)]<= up) + * inc(it) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":7107 + * it = in_data.begin() + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (down<=y_data[deref(it)]<= up) # <<<<<<<<<<<<<< + * inc(it) + * + */ + __pyx_t_10 = (*__pyx_v_it); + __pyx_t_16 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_10)) ))); + __pyx_t_9 = (__pyx_v_down <= __pyx_t_16); + if (__pyx_t_9) { + __pyx_t_9 = (__pyx_t_16 <= __pyx_v_up); + } + __pyx_v_sdp = (__pyx_v_sdp + ((1. / (__pyx_v_n_trees * __pyx_v_in_data.size())) * __pyx_t_9)); + + /* "cyext_acv.pyx":7108 + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (down<=y_data[deref(it)]<= up) + * inc(it) # <<<<<<<<<<<<<< + * + * return sdp + */ + (void)((++__pyx_v_it)); + } + } + __pyx_L20:; + } + + /* "cyext_acv.pyx":7110 + * inc(it) + * + * return sdp # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __pyx_r = __pyx_v_sdp; + goto __pyx_L0; + + /* "cyext_acv.pyx":7040 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cdef double single_compute_cdp_rf(double[:] & x, double & y_x, double & down, double & up, double[:, :] & data, double[::1] & y_data, vector[int] & S, # <<<<<<<<<<<<<< + * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + * int & max_depth, int & min_node_size, int & classifier, double[:] & t) nogil: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("cyext_acv.single_compute_cdp_rf", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_r = 0; + __pyx_L0:; + return __pyx_r; +} + +/* "cyext_acv.pyx":7116 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_cdp_rf(double[:, :] X, double[::1] y_X, double[::1] down, double[::1] up, double[:, :] data, double[::1] y_data, vector[vector[int]] S, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * int max_depth, int min_node_size, int & classifier, double[:, :] & t): + */ + +static PyObject *__pyx_pw_9cyext_acv_117compute_cdp_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_cdp_rf(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_down, __Pyx_memviewslice __pyx_v_up, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, CYTHON_UNUSED int __pyx_skip_dispatch) { + int __pyx_v_N; + __Pyx_memviewslice __pyx_v_sdp = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + __Pyx_memviewslice __pyx_t_13 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_cdp_rf", 0); + + /* "cyext_acv.pyx":7120 + * int max_depth, int min_node_size, int & classifier, double[:, :] & t): + * + * cdef int N = X.shape[0] # <<<<<<<<<<<<<< + * cdef double[::1] sdp = np.zeros(N) + * cdef int i + */ + __pyx_v_N = (__pyx_v_X.shape[0]); + + /* "cyext_acv.pyx":7121 + * + * cdef int N = X.shape[0] + * cdef double[::1] sdp = np.zeros(N) # <<<<<<<<<<<<<< + * cdef int i + * for i in prange(N, nogil=True, schedule='dynamic'): + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 7121, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":7123 + * cdef double[::1] sdp = np.zeros(N) + * cdef int i + * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_cdp_rf(X[i], y_X[i], down[i], up[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + __pyx_t_6 = __pyx_v_N; + if ((1 == 0)) abort(); + { + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) (x) + #define unlikely(x) (x) + #endif + __pyx_t_8 = (__pyx_t_6 - 0 + 1 - 1/abs(1)) / 1; + if (__pyx_t_8 > 0) + { + #ifdef _OPENMP + #pragma omp parallel private(__pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_14) firstprivate(__pyx_t_13, __pyx_t_9) + #endif /* _OPENMP */ + { + #ifdef _OPENMP + #pragma omp for firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) schedule(dynamic) + #endif /* _OPENMP */ + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7++){ + { + __pyx_v_i = (int)(0 + 1 * __pyx_t_7); + + /* "cyext_acv.pyx":7124 + * cdef int i + * for i in prange(N, nogil=True, schedule='dynamic'): + * sdp[i] = single_compute_cdp_rf(X[i], y_X[i], down[i], up[i], data, y_data, S[i], # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i]) + */ + __pyx_t_9.data = __pyx_v_X.data; + __pyx_t_9.memview = __pyx_v_X.memview; + __PYX_INC_MEMVIEW(&__pyx_t_9, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_X.strides[0]; + __pyx_t_9.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_9.shape[0] = __pyx_v_X.shape[1]; +__pyx_t_9.strides[0] = __pyx_v_X.strides[1]; + __pyx_t_9.suboffsets[0] = -1; + +__pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_i; + + /* "cyext_acv.pyx":7126 + * sdp[i] = single_compute_cdp_rf(X[i], y_X[i], down[i], up[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i]) # <<<<<<<<<<<<<< + * return np.array(sdp) + * + */ + __pyx_t_13.data = __pyx_v_t.data; + __pyx_t_13.memview = __pyx_v_t.memview; + __PYX_INC_MEMVIEW(&__pyx_t_13, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_t.strides[0]; + __pyx_t_13.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_13.shape[0] = __pyx_v_t.shape[1]; +__pyx_t_13.strides[0] = __pyx_v_t.strides[1]; + __pyx_t_13.suboffsets[0] = -1; + +__pyx_t_14 = __pyx_v_i; + + /* "cyext_acv.pyx":7124 + * cdef int i + * for i in prange(N, nogil=True, schedule='dynamic'): + * sdp[i] = single_compute_cdp_rf(X[i], y_X[i], down[i], up[i], data, y_data, S[i], # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i]) + */ + *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_sdp.data) + __pyx_t_14)) )) = __pyx_f_9cyext_acv_single_compute_cdp_rf(__pyx_t_9, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_10)) ))), (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_down.data) + __pyx_t_11)) ))), (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_up.data) + __pyx_t_12)) ))), __pyx_v_data, __pyx_v_y_data, (__pyx_v_S[__pyx_v_i]), __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_t_13); + __PYX_XDEC_MEMVIEW(&__pyx_t_9, 0); + __pyx_t_9.memview = NULL; + __pyx_t_9.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_13, 0); + __pyx_t_13.memview = NULL; + __pyx_t_13.data = NULL; + } + } + } + } + } + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #endif + } + + /* "cyext_acv.pyx":7123 + * cdef double[::1] sdp = np.zeros(N) + * cdef int i + * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_cdp_rf(X[i], y_X[i], down[i], up[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "cyext_acv.pyx":7127 + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i]) + * return np.array(sdp) # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_sdp, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "cyext_acv.pyx":7116 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_cdp_rf(double[:, :] X, double[::1] y_X, double[::1] down, double[::1] up, double[:, :] data, double[::1] y_data, vector[vector[int]] S, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * int max_depth, int min_node_size, int & classifier, double[:, :] & t): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1); + __Pyx_AddTraceback("cyext_acv.compute_cdp_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_9cyext_acv_117compute_cdp_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_9cyext_acv_117compute_cdp_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_down = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_up = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + std::vector > __pyx_v_S; + __Pyx_memviewslice __pyx_v_features = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_thresholds = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_left = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_right = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_max_depth; + int __pyx_v_min_node_size; + int __pyx_v_classifier; + __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("compute_cdp_rf (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_y_X,&__pyx_n_s_down,&__pyx_n_s_up,&__pyx_n_s_data,&__pyx_n_s_y_data,&__pyx_n_s_S,&__pyx_n_s_features,&__pyx_n_s_thresholds,&__pyx_n_s_children_left,&__pyx_n_s_children_right,&__pyx_n_s_max_depth,&__pyx_n_s_min_node_size,&__pyx_n_s_classifier,&__pyx_n_s_t,0}; + PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_X)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rf", 1, 15, 15, 1); __PYX_ERR(0, 7116, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_down)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rf", 1, 15, 15, 2); __PYX_ERR(0, 7116, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_up)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rf", 1, 15, 15, 3); __PYX_ERR(0, 7116, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rf", 1, 15, 15, 4); __PYX_ERR(0, 7116, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rf", 1, 15, 15, 5); __PYX_ERR(0, 7116, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_S)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rf", 1, 15, 15, 6); __PYX_ERR(0, 7116, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_features)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rf", 1, 15, 15, 7); __PYX_ERR(0, 7116, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thresholds)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rf", 1, 15, 15, 8); __PYX_ERR(0, 7116, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_left)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rf", 1, 15, 15, 9); __PYX_ERR(0, 7116, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rf", 1, 15, 15, 10); __PYX_ERR(0, 7116, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rf", 1, 15, 15, 11); __PYX_ERR(0, 7116, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_node_size)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rf", 1, 15, 15, 12); __PYX_ERR(0, 7116, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 13: + if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classifier)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rf", 1, 15, 15, 13); __PYX_ERR(0, 7116, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 14: + if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rf", 1, 15, 15, 14); __PYX_ERR(0, 7116, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_cdp_rf") < 0)) __PYX_ERR(0, 7116, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 15) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + } + __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 7116, __pyx_L3_error) + __pyx_v_y_X = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_X.memview)) __PYX_ERR(0, 7116, __pyx_L3_error) + __pyx_v_down = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_down.memview)) __PYX_ERR(0, 7116, __pyx_L3_error) + __pyx_v_up = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_up.memview)) __PYX_ERR(0, 7116, __pyx_L3_error) + __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 7116, __pyx_L3_error) + __pyx_v_y_data = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_data.memview)) __PYX_ERR(0, 7116, __pyx_L3_error) + __pyx_v_S = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_int_3e___(values[6]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 7116, __pyx_L3_error) + __pyx_v_features = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_features.memview)) __PYX_ERR(0, 7117, __pyx_L3_error) + __pyx_v_thresholds = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_thresholds.memview)) __PYX_ERR(0, 7117, __pyx_L3_error) + __pyx_v_children_left = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[9], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_left.memview)) __PYX_ERR(0, 7117, __pyx_L3_error) + __pyx_v_children_right = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[10], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_right.memview)) __PYX_ERR(0, 7117, __pyx_L3_error) + __pyx_v_max_depth = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7118, __pyx_L3_error) + __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7118, __pyx_L3_error) + __pyx_v_classifier = __Pyx_PyInt_As_int(values[13]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7118, __pyx_L3_error) + __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[14], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 7118, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("compute_cdp_rf", 1, 15, 15, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7116, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cyext_acv.compute_cdp_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_9cyext_acv_116compute_cdp_rf(__pyx_self, __pyx_v_X, __pyx_v_y_X, __pyx_v_down, __pyx_v_up, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9cyext_acv_116compute_cdp_rf(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_down, __Pyx_memviewslice __pyx_v_up, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_cdp_rf", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundLocalError("X"); __PYX_ERR(0, 7116, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_X.memview)) { __Pyx_RaiseUnboundLocalError("y_X"); __PYX_ERR(0, 7116, __pyx_L1_error) } + if (unlikely(!__pyx_v_down.memview)) { __Pyx_RaiseUnboundLocalError("down"); __PYX_ERR(0, 7116, __pyx_L1_error) } + if (unlikely(!__pyx_v_up.memview)) { __Pyx_RaiseUnboundLocalError("up"); __PYX_ERR(0, 7116, __pyx_L1_error) } + if (unlikely(!__pyx_v_data.memview)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 7116, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_data.memview)) { __Pyx_RaiseUnboundLocalError("y_data"); __PYX_ERR(0, 7116, __pyx_L1_error) } + if (unlikely(!__pyx_v_features.memview)) { __Pyx_RaiseUnboundLocalError("features"); __PYX_ERR(0, 7116, __pyx_L1_error) } + if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 7116, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 7116, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 7116, __pyx_L1_error) } + if (unlikely(!__pyx_v_t.memview)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 7116, __pyx_L1_error) } + __pyx_t_1 = __pyx_f_9cyext_acv_compute_cdp_rf(__pyx_v_X, __pyx_v_y_X, __pyx_v_down, __pyx_v_up, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cyext_acv.compute_cdp_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_down, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_up, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_features, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_thresholds, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_left, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_right, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_t, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cyext_acv.pyx":7133 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_cdp_rf_same_set(double[:, :] X, double[::1] y_X, double[::1] down, double[::1] up, double[:, :] data, double[::1] y_data, vector[int] S, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * int max_depth, int min_node_size, int & classifier, double[:, :] & t): + */ + +static PyObject *__pyx_pw_9cyext_acv_119compute_cdp_rf_same_set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_cdp_rf_same_set(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_down, __Pyx_memviewslice __pyx_v_up, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, CYTHON_UNUSED int __pyx_skip_dispatch) { + int __pyx_v_N; + __Pyx_memviewslice __pyx_v_sdp = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + __Pyx_memviewslice __pyx_t_13 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_cdp_rf_same_set", 0); + + /* "cyext_acv.pyx":7137 + * int max_depth, int min_node_size, int & classifier, double[:, :] & t): + * + * cdef int N = X.shape[0] # <<<<<<<<<<<<<< + * cdef double[::1] sdp = np.zeros(N) + * cdef int i + */ + __pyx_v_N = (__pyx_v_X.shape[0]); + + /* "cyext_acv.pyx":7138 + * + * cdef int N = X.shape[0] + * cdef double[::1] sdp = np.zeros(N) # <<<<<<<<<<<<<< + * cdef int i + * for i in prange(N, nogil=True, schedule='dynamic'): + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 7138, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":7140 + * cdef double[::1] sdp = np.zeros(N) + * cdef int i + * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_cdp_rf(X[i], y_X[i], down[i], up[i], data, y_data, S, + * features, thresholds, children_left, children_right, + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + __pyx_t_6 = __pyx_v_N; + if ((1 == 0)) abort(); + { + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) (x) + #define unlikely(x) (x) + #endif + __pyx_t_8 = (__pyx_t_6 - 0 + 1 - 1/abs(1)) / 1; + if (__pyx_t_8 > 0) + { + #ifdef _OPENMP + #pragma omp parallel private(__pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_14) firstprivate(__pyx_t_13, __pyx_t_9) + #endif /* _OPENMP */ + { + #ifdef _OPENMP + #pragma omp for firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) schedule(dynamic) + #endif /* _OPENMP */ + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7++){ + { + __pyx_v_i = (int)(0 + 1 * __pyx_t_7); + + /* "cyext_acv.pyx":7141 + * cdef int i + * for i in prange(N, nogil=True, schedule='dynamic'): + * sdp[i] = single_compute_cdp_rf(X[i], y_X[i], down[i], up[i], data, y_data, S, # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i]) + */ + __pyx_t_9.data = __pyx_v_X.data; + __pyx_t_9.memview = __pyx_v_X.memview; + __PYX_INC_MEMVIEW(&__pyx_t_9, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_X.strides[0]; + __pyx_t_9.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_9.shape[0] = __pyx_v_X.shape[1]; +__pyx_t_9.strides[0] = __pyx_v_X.strides[1]; + __pyx_t_9.suboffsets[0] = -1; + +__pyx_t_10 = __pyx_v_i; + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_i; + + /* "cyext_acv.pyx":7143 + * sdp[i] = single_compute_cdp_rf(X[i], y_X[i], down[i], up[i], data, y_data, S, + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i]) # <<<<<<<<<<<<<< + * return np.array(sdp) + * + */ + __pyx_t_13.data = __pyx_v_t.data; + __pyx_t_13.memview = __pyx_v_t.memview; + __PYX_INC_MEMVIEW(&__pyx_t_13, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_t.strides[0]; + __pyx_t_13.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_13.shape[0] = __pyx_v_t.shape[1]; +__pyx_t_13.strides[0] = __pyx_v_t.strides[1]; + __pyx_t_13.suboffsets[0] = -1; + +__pyx_t_14 = __pyx_v_i; + + /* "cyext_acv.pyx":7141 + * cdef int i + * for i in prange(N, nogil=True, schedule='dynamic'): + * sdp[i] = single_compute_cdp_rf(X[i], y_X[i], down[i], up[i], data, y_data, S, # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i]) + */ + *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_sdp.data) + __pyx_t_14)) )) = __pyx_f_9cyext_acv_single_compute_cdp_rf(__pyx_t_9, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_10)) ))), (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_down.data) + __pyx_t_11)) ))), (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_up.data) + __pyx_t_12)) ))), __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_t_13); + __PYX_XDEC_MEMVIEW(&__pyx_t_9, 0); + __pyx_t_9.memview = NULL; + __pyx_t_9.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_13, 0); + __pyx_t_13.memview = NULL; + __pyx_t_13.data = NULL; + } + } + } + } + } + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #endif + } + + /* "cyext_acv.pyx":7140 + * cdef double[::1] sdp = np.zeros(N) + * cdef int i + * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_cdp_rf(X[i], y_X[i], down[i], up[i], data, y_data, S, + * features, thresholds, children_left, children_right, + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "cyext_acv.pyx":7144 + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i]) + * return np.array(sdp) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_sdp, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "cyext_acv.pyx":7133 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_cdp_rf_same_set(double[:, :] X, double[::1] y_X, double[::1] down, double[::1] up, double[:, :] data, double[::1] y_data, vector[int] S, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * int max_depth, int min_node_size, int & classifier, double[:, :] & t): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1); + __Pyx_AddTraceback("cyext_acv.compute_cdp_rf_same_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_9cyext_acv_119compute_cdp_rf_same_set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_9cyext_acv_119compute_cdp_rf_same_set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_down = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_up = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + std::vector __pyx_v_S; + __Pyx_memviewslice __pyx_v_features = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_thresholds = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_left = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_right = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_max_depth; + int __pyx_v_min_node_size; + int __pyx_v_classifier; + __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("compute_cdp_rf_same_set (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_y_X,&__pyx_n_s_down,&__pyx_n_s_up,&__pyx_n_s_data,&__pyx_n_s_y_data,&__pyx_n_s_S,&__pyx_n_s_features,&__pyx_n_s_thresholds,&__pyx_n_s_children_left,&__pyx_n_s_children_right,&__pyx_n_s_max_depth,&__pyx_n_s_min_node_size,&__pyx_n_s_classifier,&__pyx_n_s_t,0}; + PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_X)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rf_same_set", 1, 15, 15, 1); __PYX_ERR(0, 7133, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_down)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rf_same_set", 1, 15, 15, 2); __PYX_ERR(0, 7133, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_up)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rf_same_set", 1, 15, 15, 3); __PYX_ERR(0, 7133, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rf_same_set", 1, 15, 15, 4); __PYX_ERR(0, 7133, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rf_same_set", 1, 15, 15, 5); __PYX_ERR(0, 7133, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_S)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rf_same_set", 1, 15, 15, 6); __PYX_ERR(0, 7133, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_features)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rf_same_set", 1, 15, 15, 7); __PYX_ERR(0, 7133, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thresholds)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rf_same_set", 1, 15, 15, 8); __PYX_ERR(0, 7133, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_left)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rf_same_set", 1, 15, 15, 9); __PYX_ERR(0, 7133, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rf_same_set", 1, 15, 15, 10); __PYX_ERR(0, 7133, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rf_same_set", 1, 15, 15, 11); __PYX_ERR(0, 7133, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_node_size)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rf_same_set", 1, 15, 15, 12); __PYX_ERR(0, 7133, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 13: + if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classifier)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rf_same_set", 1, 15, 15, 13); __PYX_ERR(0, 7133, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 14: + if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_rf_same_set", 1, 15, 15, 14); __PYX_ERR(0, 7133, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_cdp_rf_same_set") < 0)) __PYX_ERR(0, 7133, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 15) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + } + __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 7133, __pyx_L3_error) + __pyx_v_y_X = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_X.memview)) __PYX_ERR(0, 7133, __pyx_L3_error) + __pyx_v_down = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_down.memview)) __PYX_ERR(0, 7133, __pyx_L3_error) + __pyx_v_up = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_up.memview)) __PYX_ERR(0, 7133, __pyx_L3_error) + __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 7133, __pyx_L3_error) + __pyx_v_y_data = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_data.memview)) __PYX_ERR(0, 7133, __pyx_L3_error) + __pyx_v_S = __pyx_convert_vector_from_py_int(values[6]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 7133, __pyx_L3_error) + __pyx_v_features = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_features.memview)) __PYX_ERR(0, 7134, __pyx_L3_error) + __pyx_v_thresholds = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_thresholds.memview)) __PYX_ERR(0, 7134, __pyx_L3_error) + __pyx_v_children_left = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[9], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_left.memview)) __PYX_ERR(0, 7134, __pyx_L3_error) + __pyx_v_children_right = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[10], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_right.memview)) __PYX_ERR(0, 7134, __pyx_L3_error) + __pyx_v_max_depth = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7135, __pyx_L3_error) + __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7135, __pyx_L3_error) + __pyx_v_classifier = __Pyx_PyInt_As_int(values[13]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7135, __pyx_L3_error) + __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[14], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 7135, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("compute_cdp_rf_same_set", 1, 15, 15, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7133, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cyext_acv.compute_cdp_rf_same_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_9cyext_acv_118compute_cdp_rf_same_set(__pyx_self, __pyx_v_X, __pyx_v_y_X, __pyx_v_down, __pyx_v_up, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9cyext_acv_118compute_cdp_rf_same_set(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_down, __Pyx_memviewslice __pyx_v_up, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_cdp_rf_same_set", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundLocalError("X"); __PYX_ERR(0, 7133, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_X.memview)) { __Pyx_RaiseUnboundLocalError("y_X"); __PYX_ERR(0, 7133, __pyx_L1_error) } + if (unlikely(!__pyx_v_down.memview)) { __Pyx_RaiseUnboundLocalError("down"); __PYX_ERR(0, 7133, __pyx_L1_error) } + if (unlikely(!__pyx_v_up.memview)) { __Pyx_RaiseUnboundLocalError("up"); __PYX_ERR(0, 7133, __pyx_L1_error) } + if (unlikely(!__pyx_v_data.memview)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 7133, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_data.memview)) { __Pyx_RaiseUnboundLocalError("y_data"); __PYX_ERR(0, 7133, __pyx_L1_error) } + if (unlikely(!__pyx_v_features.memview)) { __Pyx_RaiseUnboundLocalError("features"); __PYX_ERR(0, 7133, __pyx_L1_error) } + if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 7133, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 7133, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 7133, __pyx_L1_error) } + if (unlikely(!__pyx_v_t.memview)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 7133, __pyx_L1_error) } + __pyx_t_1 = __pyx_f_9cyext_acv_compute_cdp_rf_same_set(__pyx_v_X, __pyx_v_y_X, __pyx_v_down, __pyx_v_up, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cyext_acv.compute_cdp_rf_same_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_down, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_up, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_features, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_thresholds, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_left, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_right, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_t, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cyext_acv.pyx":7151 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef global_cdp_rf(double[:, :] X, double[::1] y_X, double[::1] DOWN, double[::1] UP, double[:, :] data, double[::1] y_data, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * int max_depth, int min_node_size, int & classifier, double[:, :] & t, list C, double pi_level, + */ + +static PyObject *__pyx_pw_9cyext_acv_121global_cdp_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_global_cdp_rf(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_DOWN, __Pyx_memviewslice __pyx_v_UP, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, PyObject *__pyx_v_C, double __pyx_v_pi_level, int __pyx_v_minimal, int __pyx_v_stop, PyObject *__pyx_v_search_space, CYTHON_UNUSED int __pyx_skip_dispatch) { + unsigned int __pyx_v_N; + unsigned int __pyx_v_m; + __Pyx_memviewslice __pyx_v_sdp = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_sdp_b = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_sdp_ba = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_sdp_global = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_in_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_i; + int __pyx_v_s; + int __pyx_v_s_0; + int __pyx_v_s_1; + int __pyx_v_S_size; + int __pyx_v_max_size; + int __pyx_v_size; + std::vector __pyx_v_S; + std::vector __pyx_v_len_s_star; + PyObject *__pyx_v_power = 0; + PyObject *__pyx_v_va_id = 0; + std::vector __pyx_v_R; + std::vector __pyx_v_r; + __Pyx_memviewslice __pyx_v_R_buf = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_X_arr = NULL; + PyObject *__pyx_v_y_X_arr = NULL; + PyObject *__pyx_v_down_arr = NULL; + PyObject *__pyx_v_up_arr = NULL; + PyObject *__pyx_v_t_arr = NULL; + PyObject *__pyx_v_remove_va = NULL; + Py_ssize_t __pyx_v_ci; + Py_ssize_t __pyx_v_cj; + PyObject *__pyx_v_power_b = NULL; + PyObject *__pyx_v_co = NULL; + std::vector > > __pyx_v_power_cpp; + __Pyx_memviewslice __pyx_v_s_star = { 0, 0, { 0 }, { 0 }, { 0 } }; + CYTHON_UNUSED long __pyx_v_power_set_size; + PyObject *__pyx_v_S_bar = NULL; + PyObject *__pyx_v_S_bar_set = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_t_6 = NULL; + std::vector __pyx_t_7; + unsigned int __pyx_t_8; + unsigned int __pyx_t_9; + int __pyx_t_10; + __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + int __pyx_t_19; + long __pyx_t_20; + long __pyx_t_21; + int __pyx_t_22; + PyObject *(*__pyx_t_23)(PyObject *); + PyObject *__pyx_t_24 = NULL; + int __pyx_t_25; + std::vector > > __pyx_t_26; + __Pyx_memviewslice __pyx_t_27 = { 0, 0, { 0 }, { 0 }, { 0 } }; + std::vector > ::size_type __pyx_t_28; + std::vector > ::size_type __pyx_t_29; + std::vector ::size_type __pyx_t_30; + std::vector ::size_type __pyx_t_31; + int __pyx_t_32; + int __pyx_t_33; + Py_ssize_t __pyx_t_34; + Py_ssize_t __pyx_t_35; + __Pyx_memviewslice __pyx_t_36 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_37 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_38 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_39 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_40 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + int __pyx_t_43; + PyObject *__pyx_t_44 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("global_cdp_rf", 0); + + /* "cyext_acv.pyx":7156 + * int minimal, bint stop, list search_space): + * + * cdef unsigned int N = X.shape[0] # <<<<<<<<<<<<<< + * cdef unsigned int m = X.shape[1] + * + */ + __pyx_v_N = (__pyx_v_X.shape[0]); + + /* "cyext_acv.pyx":7157 + * + * cdef unsigned int N = X.shape[0] + * cdef unsigned int m = X.shape[1] # <<<<<<<<<<<<<< + * + * cdef double[:] sdp, sdp_b, sdp_ba + */ + __pyx_v_m = (__pyx_v_X.shape[1]); + + /* "cyext_acv.pyx":7162 + * cdef double[:] sdp_global + * cdef double[:] in_data + * sdp = np.zeros((N)) # <<<<<<<<<<<<<< + * sdp_b = np.zeros((N)) + * sdp_global = np.zeros((m)) + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 7162, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":7163 + * cdef double[:] in_data + * sdp = np.zeros((N)) + * sdp_b = np.zeros((N)) # <<<<<<<<<<<<<< + * sdp_global = np.zeros((m)) + * in_data = np.zeros(N) + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 7163, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp_b = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":7164 + * sdp = np.zeros((N)) + * sdp_b = np.zeros((N)) + * sdp_global = np.zeros((m)) # <<<<<<<<<<<<<< + * in_data = np.zeros(N) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_m); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 7164, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp_global = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":7165 + * sdp_b = np.zeros((N)) + * sdp_global = np.zeros((m)) + * in_data = np.zeros(N) # <<<<<<<<<<<<<< + * + * cdef unsigned int it, it_s, a_it, b_it, o_all, p, p_s, nb_leaf, p_u, p_d, p_su, p_sd, down, up + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 7165, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_in_data = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":7172 + * + * cdef vector[int] S, len_s_star + * len_s_star = np.zeros((N), dtype=np.int) # <<<<<<<<<<<<<< + * + * cdef list power, va_id + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 7172, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = __pyx_convert_vector_from_py_int(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 7172, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_len_s_star = __pyx_t_7; + + /* "cyext_acv.pyx":7177 + * + * cdef vector[long] R, r + * R.resize(N) # <<<<<<<<<<<<<< + * for i in range(N): + * R[i] = i + */ + try { + __pyx_v_R.resize(__pyx_v_N); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 7177, __pyx_L1_error) + } + + /* "cyext_acv.pyx":7178 + * cdef vector[long] R, r + * R.resize(N) + * for i in range(N): # <<<<<<<<<<<<<< + * R[i] = i + * r.resize(N) + */ + __pyx_t_8 = __pyx_v_N; + __pyx_t_9 = __pyx_t_8; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "cyext_acv.pyx":7179 + * R.resize(N) + * for i in range(N): + * R[i] = i # <<<<<<<<<<<<<< + * r.resize(N) + * + */ + (__pyx_v_R[__pyx_v_i]) = __pyx_v_i; + } + + /* "cyext_acv.pyx":7180 + * for i in range(N): + * R[i] = i + * r.resize(N) # <<<<<<<<<<<<<< + * + * cdef long[:] R_buf + */ + try { + __pyx_v_r.resize(__pyx_v_N); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 7180, __pyx_L1_error) + } + + /* "cyext_acv.pyx":7183 + * + * cdef long[:] R_buf + * R_buf = np.zeros((N), dtype=np.int) # <<<<<<<<<<<<<< + * + * X_arr = np.array(X, dtype=np.double) + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 7183, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7183, __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(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_long(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 7183, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_R_buf = __pyx_t_11; + __pyx_t_11.memview = NULL; + __pyx_t_11.data = NULL; + + /* "cyext_acv.pyx":7185 + * R_buf = np.zeros((N), dtype=np.int) + * + * X_arr = np.array(X, dtype=np.double) # <<<<<<<<<<<<<< + * y_X_arr = np.array(y_X, dtype=np.double) + * down_arr = np.array(DOWN, dtype=np.double) + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_X, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_double); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 7185, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_X_arr = __pyx_t_2; + __pyx_t_2 = 0; + + /* "cyext_acv.pyx":7186 + * + * X_arr = np.array(X, dtype=np.double) + * y_X_arr = np.array(y_X, dtype=np.double) # <<<<<<<<<<<<<< + * down_arr = np.array(DOWN, dtype=np.double) + * up_arr = np.array(UP, dtype=np.double) + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_y_X, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_double); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 7186, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_y_X_arr = __pyx_t_1; + __pyx_t_1 = 0; + + /* "cyext_acv.pyx":7187 + * X_arr = np.array(X, dtype=np.double) + * y_X_arr = np.array(y_X, dtype=np.double) + * down_arr = np.array(DOWN, dtype=np.double) # <<<<<<<<<<<<<< + * up_arr = np.array(UP, dtype=np.double) + * t_arr = np.array(t, dtype=np.double) + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_DOWN, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 7187, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_down_arr = __pyx_t_6; + __pyx_t_6 = 0; + + /* "cyext_acv.pyx":7188 + * y_X_arr = np.array(y_X, dtype=np.double) + * down_arr = np.array(DOWN, dtype=np.double) + * up_arr = np.array(UP, dtype=np.double) # <<<<<<<<<<<<<< + * t_arr = np.array(t, dtype=np.double) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_UP, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_double); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 7188, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7188, __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(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_up_arr = __pyx_t_4; + __pyx_t_4 = 0; + + /* "cyext_acv.pyx":7189 + * down_arr = np.array(DOWN, dtype=np.double) + * up_arr = np.array(UP, dtype=np.double) + * t_arr = np.array(t, dtype=np.double) # <<<<<<<<<<<<<< + * + * if C[0] != []: + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_t, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_double); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 7189, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_t_arr = __pyx_t_2; + __pyx_t_2 = 0; + + /* "cyext_acv.pyx":7191 + * t_arr = np.array(t, dtype=np.double) + * + * if C[0] != []: # <<<<<<<<<<<<<< + * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] + * va_id = [[i] for i in search_space if i not in remove_va] + */ + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 7191, __pyx_L1_error) + } + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_RichCompare(PyList_GET_ITEM(__pyx_v_C, 0), __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7191, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 7191, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_12) { + + /* "cyext_acv.pyx":7192 + * + * if C[0] != []: + * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] # <<<<<<<<<<<<<< + * va_id = [[i] for i in search_space if i not in remove_va] + * for ci in range(len(C)): + */ + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 7192, __pyx_L1_error) + } + __pyx_t_13 = PyList_GET_SIZE(__pyx_v_C); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 7192, __pyx_L1_error) + __pyx_t_14 = __pyx_t_13; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_ci = __pyx_t_15; + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 7192, __pyx_L1_error) + } + __pyx_t_2 = PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_16 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(0, 7192, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_17 = __pyx_t_16; + for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { + __pyx_v_cj = __pyx_t_18; + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 7192, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_GetItemInt(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci), __pyx_v_cj, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 7192, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + } + __pyx_v_remove_va = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "cyext_acv.pyx":7193 + * if C[0] != []: + * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] + * va_id = [[i] for i in search_space if i not in remove_va] # <<<<<<<<<<<<<< + * for ci in range(len(C)): + * i = 0 + */ + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(__pyx_v_search_space == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 7193, __pyx_L1_error) + } + __pyx_t_2 = __pyx_v_search_space; __Pyx_INCREF(__pyx_t_2); __pyx_t_13 = 0; + for (;;) { + if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 7193, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7193, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_i = __pyx_t_10; + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_t_3, __pyx_v_remove_va, Py_NE)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 7193, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_19 = (__pyx_t_12 != 0); + if (__pyx_t_19) { + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); + __pyx_t_3 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 7193, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_va_id = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "cyext_acv.pyx":7194 + * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] + * va_id = [[i] for i in search_space if i not in remove_va] + * for ci in range(len(C)): # <<<<<<<<<<<<<< + * i = 0 + * for cj in range(len(C[ci])): + */ + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 7194, __pyx_L1_error) + } + __pyx_t_13 = PyList_GET_SIZE(__pyx_v_C); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 7194, __pyx_L1_error) + __pyx_t_14 = __pyx_t_13; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_ci = __pyx_t_15; + + /* "cyext_acv.pyx":7195 + * va_id = [[i] for i in search_space if i not in remove_va] + * for ci in range(len(C)): + * i = 0 # <<<<<<<<<<<<<< + * for cj in range(len(C[ci])): + * if C[ci][cj] in search_space: + */ + __pyx_v_i = 0; + + /* "cyext_acv.pyx":7196 + * for ci in range(len(C)): + * i = 0 + * for cj in range(len(C[ci])): # <<<<<<<<<<<<<< + * if C[ci][cj] in search_space: + * i += 1 + */ + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 7196, __pyx_L1_error) + } + __pyx_t_4 = PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci); + __Pyx_INCREF(__pyx_t_4); + __pyx_t_16 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(0, 7196, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_17 = __pyx_t_16; + for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { + __pyx_v_cj = __pyx_t_18; + + /* "cyext_acv.pyx":7197 + * i = 0 + * for cj in range(len(C[ci])): + * if C[ci][cj] in search_space: # <<<<<<<<<<<<<< + * i += 1 + * break + */ + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 7197, __pyx_L1_error) + } + __pyx_t_4 = __Pyx_GetItemInt(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci), __pyx_v_cj, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_19 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_v_search_space, Py_EQ)); if (unlikely(__pyx_t_19 < 0)) __PYX_ERR(0, 7197, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_12 = (__pyx_t_19 != 0); + if (__pyx_t_12) { + + /* "cyext_acv.pyx":7198 + * for cj in range(len(C[ci])): + * if C[ci][cj] in search_space: + * i += 1 # <<<<<<<<<<<<<< + * break + * if i != 0: + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "cyext_acv.pyx":7199 + * if C[ci][cj] in search_space: + * i += 1 + * break # <<<<<<<<<<<<<< + * if i != 0: + * va_id += [C[ci]] + */ + goto __pyx_L16_break; + + /* "cyext_acv.pyx":7197 + * i = 0 + * for cj in range(len(C[ci])): + * if C[ci][cj] in search_space: # <<<<<<<<<<<<<< + * i += 1 + * break + */ + } + } + __pyx_L16_break:; + + /* "cyext_acv.pyx":7200 + * i += 1 + * break + * if i != 0: # <<<<<<<<<<<<<< + * va_id += [C[ci]] + * else: + */ + __pyx_t_12 = ((__pyx_v_i != 0) != 0); + if (__pyx_t_12) { + + /* "cyext_acv.pyx":7201 + * break + * if i != 0: + * va_id += [C[ci]] # <<<<<<<<<<<<<< + * else: + * va_id = [[i] for i in search_space] + */ + if (unlikely(__pyx_v_C == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 7201, __pyx_L1_error) + } + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci)); + __Pyx_GIVEREF(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci)); + PyList_SET_ITEM(__pyx_t_4, 0, PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci)); + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_va_id, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_va_id, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "cyext_acv.pyx":7200 + * i += 1 + * break + * if i != 0: # <<<<<<<<<<<<<< + * va_id += [C[ci]] + * else: + */ + } + } + + /* "cyext_acv.pyx":7191 + * t_arr = np.array(t, dtype=np.double) + * + * if C[0] != []: # <<<<<<<<<<<<<< + * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] + * va_id = [[i] for i in search_space if i not in remove_va] + */ + goto __pyx_L5; + } + + /* "cyext_acv.pyx":7203 + * va_id += [C[ci]] + * else: + * va_id = [[i] for i in search_space] # <<<<<<<<<<<<<< + * + * m = len(va_id) + */ + /*else*/ { + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__pyx_v_search_space == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 7203, __pyx_L1_error) + } + __pyx_t_4 = __pyx_v_search_space; __Pyx_INCREF(__pyx_t_4); __pyx_t_13 = 0; + for (;;) { + if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 7203, __pyx_L1_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7203, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_i = __pyx_t_10; + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_6); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __pyx_t_6 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 7203, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_va_id = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + } + __pyx_L5:; + + /* "cyext_acv.pyx":7205 + * va_id = [[i] for i in search_space] + * + * m = len(va_id) # <<<<<<<<<<<<<< + * power = [] + * max_size = 0 + */ + __pyx_t_13 = PyList_GET_SIZE(__pyx_v_va_id); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 7205, __pyx_L1_error) + __pyx_v_m = __pyx_t_13; + + /* "cyext_acv.pyx":7206 + * + * m = len(va_id) + * power = [] # <<<<<<<<<<<<<< + * max_size = 0 + * for size in range(m + 1): + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_power = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "cyext_acv.pyx":7207 + * m = len(va_id) + * power = [] + * max_size = 0 # <<<<<<<<<<<<<< + * for size in range(m + 1): + * power_b = [] + */ + __pyx_v_max_size = 0; + + /* "cyext_acv.pyx":7208 + * power = [] + * max_size = 0 + * for size in range(m + 1): # <<<<<<<<<<<<<< + * power_b = [] + * for co in itertools.combinations(va_id, size): + */ + __pyx_t_20 = (__pyx_v_m + 1); + __pyx_t_21 = __pyx_t_20; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_21; __pyx_t_10+=1) { + __pyx_v_size = __pyx_t_10; + + /* "cyext_acv.pyx":7209 + * max_size = 0 + * for size in range(m + 1): + * power_b = [] # <<<<<<<<<<<<<< + * for co in itertools.combinations(va_id, size): + * power_b.append(np.array(sum(list(co),[]))) + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_power_b, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "cyext_acv.pyx":7210 + * for size in range(m + 1): + * power_b = [] + * for co in itertools.combinations(va_id, size): # <<<<<<<<<<<<<< + * power_b.append(np.array(sum(list(co),[]))) + * max_size += 1 + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_itertools); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_combinations); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + __pyx_t_22 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_22 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_va_id, __pyx_t_4}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7210, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_va_id, __pyx_t_4}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7210, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_1 = PyTuple_New(2+__pyx_t_22); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __pyx_t_6 = NULL; + } + __Pyx_INCREF(__pyx_v_va_id); + __Pyx_GIVEREF(__pyx_v_va_id); + PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_22, __pyx_v_va_id); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_22, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7210, __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(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_13 = 0; + __pyx_t_23 = NULL; + } else { + __pyx_t_13 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_23 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 7210, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (likely(!__pyx_t_23)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 7210, __pyx_L1_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } else { + if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 7210, __pyx_L1_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } + } else { + __pyx_t_2 = __pyx_t_23(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 7210, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_co, __pyx_t_2); + __pyx_t_2 = 0; + + /* "cyext_acv.pyx":7211 + * power_b = [] + * for co in itertools.combinations(va_id, size): + * power_b.append(np.array(sum(list(co),[]))) # <<<<<<<<<<<<<< + * max_size += 1 + * power.append(power_b) + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PySequence_List(__pyx_v_co); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_24 = PyTuple_New(2); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_6); + __pyx_t_1 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_24, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_24 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_24)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_24); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_2 = (__pyx_t_24) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_24, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); + __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_25 = __Pyx_PyList_Append(__pyx_v_power_b, __pyx_t_2); if (unlikely(__pyx_t_25 == ((int)-1))) __PYX_ERR(0, 7211, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "cyext_acv.pyx":7212 + * for co in itertools.combinations(va_id, size): + * power_b.append(np.array(sum(list(co),[]))) + * max_size += 1 # <<<<<<<<<<<<<< + * power.append(power_b) + * if max_size >= 2**15: + */ + __pyx_v_max_size = (__pyx_v_max_size + 1); + + /* "cyext_acv.pyx":7210 + * for size in range(m + 1): + * power_b = [] + * for co in itertools.combinations(va_id, size): # <<<<<<<<<<<<<< + * power_b.append(np.array(sum(list(co),[]))) + * max_size += 1 + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "cyext_acv.pyx":7213 + * power_b.append(np.array(sum(list(co),[]))) + * max_size += 1 + * power.append(power_b) # <<<<<<<<<<<<<< + * if max_size >= 2**15: + * break + */ + __pyx_t_25 = __Pyx_PyList_Append(__pyx_v_power, __pyx_v_power_b); if (unlikely(__pyx_t_25 == ((int)-1))) __PYX_ERR(0, 7213, __pyx_L1_error) + + /* "cyext_acv.pyx":7214 + * max_size += 1 + * power.append(power_b) + * if max_size >= 2**15: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_12 = ((__pyx_v_max_size >= 0x8000) != 0); + if (__pyx_t_12) { + + /* "cyext_acv.pyx":7215 + * power.append(power_b) + * if max_size >= 2**15: + * break # <<<<<<<<<<<<<< + * + * cdef vector[vector[vector[long]]] power_cpp = power + */ + goto __pyx_L22_break; + + /* "cyext_acv.pyx":7214 + * max_size += 1 + * power.append(power_b) + * if max_size >= 2**15: # <<<<<<<<<<<<<< + * break + * + */ + } + } + __pyx_L22_break:; + + /* "cyext_acv.pyx":7217 + * break + * + * cdef vector[vector[vector[long]]] power_cpp = power # <<<<<<<<<<<<<< + * cdef long[:, :] s_star + * s_star = -1*np.ones((N, X.shape[1]), dtype=np.int) + */ + __pyx_t_26 = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_std_3a__3a_vector_3c_long_3e____3e___(__pyx_v_power); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 7217, __pyx_L1_error) + __pyx_v_power_cpp = __pyx_t_26; + + /* "cyext_acv.pyx":7219 + * cdef vector[vector[vector[long]]] power_cpp = power + * cdef long[:, :] s_star + * s_star = -1*np.ones((N, X.shape[1]), dtype=np.int) # <<<<<<<<<<<<<< + * + * cdef long power_set_size = 2**m + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ones); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_X.shape[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_24) < 0) __PYX_ERR(0, 7219, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Multiply(__pyx_int_neg_1, __pyx_t_24); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_27 = __Pyx_PyObject_to_MemoryviewSlice_dsds_long(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_27.memview)) __PYX_ERR(0, 7219, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_s_star = __pyx_t_27; + __pyx_t_27.memview = NULL; + __pyx_t_27.data = NULL; + + /* "cyext_acv.pyx":7221 + * s_star = -1*np.ones((N, X.shape[1]), dtype=np.int) + * + * cdef long power_set_size = 2**m # <<<<<<<<<<<<<< + * S = np.zeros((data.shape[1]), dtype=np.int) + * S_bar = np.zeros((data.shape[1]), dtype=np.int) + */ + __pyx_v_power_set_size = __Pyx_pow_long(2, ((long)__pyx_v_m)); + + /* "cyext_acv.pyx":7222 + * + * cdef long power_set_size = 2**m + * S = np.zeros((data.shape[1]), dtype=np.int) # <<<<<<<<<<<<<< + * S_bar = np.zeros((data.shape[1]), dtype=np.int) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyInt_FromSsize_t((__pyx_v_data.shape[1])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 7222, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_24, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = __pyx_convert_vector_from_py_int(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 7222, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_S = __pyx_t_7; + + /* "cyext_acv.pyx":7223 + * cdef long power_set_size = 2**m + * S = np.zeros((data.shape[1]), dtype=np.int) + * S_bar = np.zeros((data.shape[1]), dtype=np.int) # <<<<<<<<<<<<<< + * + * for s_0 in tqdm(range(minimal, m+1)): + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_data.shape[1])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_24, __pyx_n_s_np); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_24, __pyx_n_s_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 7223, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_S_bar = __pyx_t_2; + __pyx_t_2 = 0; + + /* "cyext_acv.pyx":7225 + * S_bar = np.zeros((data.shape[1]), dtype=np.int) + * + * for s_0 in tqdm(range(minimal, m+1)): # <<<<<<<<<<<<<< + * for s_1 in range(0, power_cpp[s_0].size()): + * for i in range(power_cpp[s_0][s_1].size()): + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_tqdm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minimal); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyInt_From_long((__pyx_v_m + 1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_24 = PyTuple_New(2); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_6); + __pyx_t_4 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_24, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_24 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_24)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_24); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_24) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_24, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); + __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_13 = 0; + __pyx_t_23 = NULL; + } else { + __pyx_t_13 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_23 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 7225, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (likely(!__pyx_t_23)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 7225, __pyx_L1_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } else { + if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 7225, __pyx_L1_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } + } else { + __pyx_t_2 = __pyx_t_23(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 7225, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7225, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_s_0 = __pyx_t_10; + + /* "cyext_acv.pyx":7226 + * + * for s_0 in tqdm(range(minimal, m+1)): + * for s_1 in range(0, power_cpp[s_0].size()): # <<<<<<<<<<<<<< + * for i in range(power_cpp[s_0][s_1].size()): + * S[i] = power_cpp[s_0][s_1][i] + */ + __pyx_t_28 = (__pyx_v_power_cpp[__pyx_v_s_0]).size(); + __pyx_t_29 = __pyx_t_28; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_29; __pyx_t_10+=1) { + __pyx_v_s_1 = __pyx_t_10; + + /* "cyext_acv.pyx":7227 + * for s_0 in tqdm(range(minimal, m+1)): + * for s_1 in range(0, power_cpp[s_0].size()): + * for i in range(power_cpp[s_0][s_1].size()): # <<<<<<<<<<<<<< + * S[i] = power_cpp[s_0][s_1][i] + * + */ + __pyx_t_30 = ((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1]).size(); + __pyx_t_31 = __pyx_t_30; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_31; __pyx_t_22+=1) { + __pyx_v_i = __pyx_t_22; + + /* "cyext_acv.pyx":7228 + * for s_1 in range(0, power_cpp[s_0].size()): + * for i in range(power_cpp[s_0][s_1].size()): + * S[i] = power_cpp[s_0][s_1][i] # <<<<<<<<<<<<<< + * + * S_size = power_cpp[s_0][s_1].size() + */ + (__pyx_v_S[__pyx_v_i]) = (((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1])[__pyx_v_i]); + } + + /* "cyext_acv.pyx":7230 + * S[i] = power_cpp[s_0][s_1][i] + * + * S_size = power_cpp[s_0][s_1].size() # <<<<<<<<<<<<<< + * r.clear() + * N = R.size() + */ + __pyx_v_S_size = ((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1]).size(); + + /* "cyext_acv.pyx":7231 + * + * S_size = power_cpp[s_0][s_1].size() + * r.clear() # <<<<<<<<<<<<<< + * N = R.size() + * in_data = np.zeros(X.shape[0]) + */ + __pyx_v_r.clear(); + + /* "cyext_acv.pyx":7232 + * S_size = power_cpp[s_0][s_1].size() + * r.clear() + * N = R.size() # <<<<<<<<<<<<<< + * in_data = np.zeros(X.shape[0]) + * + */ + __pyx_v_N = __pyx_v_R.size(); + + /* "cyext_acv.pyx":7233 + * r.clear() + * N = R.size() + * in_data = np.zeros(X.shape[0]) # <<<<<<<<<<<<<< + * + * S_bar_set = list(range(data.shape[1])) + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyInt_FromSsize_t((__pyx_v_X.shape[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_24))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_24); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_24); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_24, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_24, __pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_24, __pyx_t_6); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 7233, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_in_data, 1); + __pyx_v_in_data = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":7235 + * in_data = np.zeros(X.shape[0]) + * + * S_bar_set = list(range(data.shape[1])) # <<<<<<<<<<<<<< + * for i in range(S_size): + * S_bar_set.remove(S[i]) + */ + __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_data.shape[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_24 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PySequence_List(__pyx_t_24); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_XDECREF_SET(__pyx_v_S_bar_set, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "cyext_acv.pyx":7236 + * + * S_bar_set = list(range(data.shape[1])) + * for i in range(S_size): # <<<<<<<<<<<<<< + * S_bar_set.remove(S[i]) + * + */ + __pyx_t_22 = __pyx_v_S_size; + __pyx_t_32 = __pyx_t_22; + for (__pyx_t_33 = 0; __pyx_t_33 < __pyx_t_32; __pyx_t_33+=1) { + __pyx_v_i = __pyx_t_33; + + /* "cyext_acv.pyx":7237 + * S_bar_set = list(range(data.shape[1])) + * for i in range(S_size): + * S_bar_set.remove(S[i]) # <<<<<<<<<<<<<< + * + * for i in range(data.shape[1]-S_size): + */ + __pyx_t_2 = __Pyx_PyInt_From_int((__pyx_v_S[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_24 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyList_Type_remove, __pyx_v_S_bar_set, __pyx_t_2); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + } + + /* "cyext_acv.pyx":7239 + * S_bar_set.remove(S[i]) + * + * for i in range(data.shape[1]-S_size): # <<<<<<<<<<<<<< + * S_bar[i] = S_bar_set[i] + * + */ + __pyx_t_14 = ((__pyx_v_data.shape[1]) - __pyx_v_S_size); + __pyx_t_15 = __pyx_t_14; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_15; __pyx_t_22+=1) { + __pyx_v_i = __pyx_t_22; + + /* "cyext_acv.pyx":7240 + * + * for i in range(data.shape[1]-S_size): + * S_bar[i] = S_bar_set[i] # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_24 = PyList_GET_ITEM(__pyx_v_S_bar_set, __pyx_v_i); + __Pyx_INCREF(__pyx_t_24); + if (unlikely(__Pyx_SetItemInt(__pyx_v_S_bar, __pyx_v_i, __pyx_t_24, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0)) __PYX_ERR(0, 7240, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + } + + /* "cyext_acv.pyx":7242 + * S_bar[i] = S_bar_set[i] + * + * for i in range(N): # <<<<<<<<<<<<<< + * R_buf[i] = R[i] + * in_data[R_buf[i]] = 1 + */ + __pyx_t_8 = __pyx_v_N; + __pyx_t_9 = __pyx_t_8; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_9; __pyx_t_22+=1) { + __pyx_v_i = __pyx_t_22; + + /* "cyext_acv.pyx":7243 + * + * for i in range(N): + * R_buf[i] = R[i] # <<<<<<<<<<<<<< + * in_data[R_buf[i]] = 1 + * + */ + __pyx_t_34 = __pyx_v_i; + *((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_34 * __pyx_v_R_buf.strides[0]) )) = (__pyx_v_R[__pyx_v_i]); + + /* "cyext_acv.pyx":7244 + * for i in range(N): + * R_buf[i] = R[i] + * in_data[R_buf[i]] = 1 # <<<<<<<<<<<<<< + * + * # sdp_b[R_buf[i]] = single_compute_ddp_rf(X[R_buf[i]], y_X[R_buf[i]], down[R_buf[i]], up[R[buf[i]], data, y_data, S_bar[:m-S_size], features, thresholds, children_left, children_right, + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_34 * __pyx_v_R_buf.strides[0]) ))); + *((double *) ( /* dim=0 */ (__pyx_v_in_data.data + __pyx_t_35 * __pyx_v_in_data.strides[0]) )) = 1.0; + } + + /* "cyext_acv.pyx":7249 + * # max_depth, min_node_size, classifier, t) + * + * sdp_ba = compute_cdp_rf_same_set(X_arr[np.array(in_data, dtype=bool)], # <<<<<<<<<<<<<< + * y_X_arr[np.array(in_data, dtype=bool)], down_arr[np.array(in_data, dtype=bool)], + * up_arr[np.array(in_data, dtype=bool)], + */ + __Pyx_GetModuleGlobalName(__pyx_t_24, __pyx_n_s_np); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_24, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = __pyx_memoryview_fromslice(__pyx_v_in_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_24); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_24); + __pyx_t_24 = 0; + __pyx_t_24 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 7249, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_24); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = __Pyx_PyObject_GetItem(__pyx_v_X_arr, __pyx_t_4); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_36 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_24, PyBUF_WRITABLE); if (unlikely(!__pyx_t_36.memview)) __PYX_ERR(0, 7249, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + + /* "cyext_acv.pyx":7250 + * + * sdp_ba = compute_cdp_rf_same_set(X_arr[np.array(in_data, dtype=bool)], + * y_X_arr[np.array(in_data, dtype=bool)], down_arr[np.array(in_data, dtype=bool)], # <<<<<<<<<<<<<< + * up_arr[np.array(in_data, dtype=bool)], + * data, y_data, S_bar[:data.shape[1]-S_size], features, thresholds, children_left, + */ + __Pyx_GetModuleGlobalName(__pyx_t_24, __pyx_n_s_np); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_24, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = __pyx_memoryview_fromslice(__pyx_v_in_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_24); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_24); + __pyx_t_24 = 0; + __pyx_t_24 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 7250, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_24); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = __Pyx_PyObject_GetItem(__pyx_v_y_X_arr, __pyx_t_2); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_37 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_24, PyBUF_WRITABLE); if (unlikely(!__pyx_t_37.memview)) __PYX_ERR(0, 7250, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_24, __pyx_n_s_np); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_24, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = __pyx_memoryview_fromslice(__pyx_v_in_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_24); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_24); + __pyx_t_24 = 0; + __pyx_t_24 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 7250, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_24); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = __Pyx_PyObject_GetItem(__pyx_v_down_arr, __pyx_t_4); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_38 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_24, PyBUF_WRITABLE); if (unlikely(!__pyx_t_38.memview)) __PYX_ERR(0, 7250, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + + /* "cyext_acv.pyx":7251 + * sdp_ba = compute_cdp_rf_same_set(X_arr[np.array(in_data, dtype=bool)], + * y_X_arr[np.array(in_data, dtype=bool)], down_arr[np.array(in_data, dtype=bool)], + * up_arr[np.array(in_data, dtype=bool)], # <<<<<<<<<<<<<< + * data, y_data, S_bar[:data.shape[1]-S_size], features, thresholds, children_left, + * children_right, max_depth, min_node_size, classifier, t_arr[np.array(in_data, dtype=bool)]) + */ + __Pyx_GetModuleGlobalName(__pyx_t_24, __pyx_n_s_np); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_24, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = __pyx_memoryview_fromslice(__pyx_v_in_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_24); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_24); + __pyx_t_24 = 0; + __pyx_t_24 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 7251, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_24); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = __Pyx_PyObject_GetItem(__pyx_v_up_arr, __pyx_t_2); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_39 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_24, PyBUF_WRITABLE); if (unlikely(!__pyx_t_39.memview)) __PYX_ERR(0, 7251, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + + /* "cyext_acv.pyx":7252 + * y_X_arr[np.array(in_data, dtype=bool)], down_arr[np.array(in_data, dtype=bool)], + * up_arr[np.array(in_data, dtype=bool)], + * data, y_data, S_bar[:data.shape[1]-S_size], features, thresholds, children_left, # <<<<<<<<<<<<<< + * children_right, max_depth, min_node_size, classifier, t_arr[np.array(in_data, dtype=bool)]) + * + */ + __pyx_t_24 = __Pyx_PyObject_GetSlice(__pyx_v_S_bar, 0, ((__pyx_v_data.shape[1]) - __pyx_v_S_size), NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_7 = __pyx_convert_vector_from_py_int(__pyx_t_24); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 7252, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + + /* "cyext_acv.pyx":7253 + * up_arr[np.array(in_data, dtype=bool)], + * data, y_data, S_bar[:data.shape[1]-S_size], features, thresholds, children_left, + * children_right, max_depth, min_node_size, classifier, t_arr[np.array(in_data, dtype=bool)]) # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __Pyx_GetModuleGlobalName(__pyx_t_24, __pyx_n_s_np); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_24, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = __pyx_memoryview_fromslice(__pyx_v_in_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_24); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_24); + __pyx_t_24 = 0; + __pyx_t_24 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 7253, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_24); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = __Pyx_PyObject_GetItem(__pyx_v_t_arr, __pyx_t_4); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_40 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_24, PyBUF_WRITABLE); if (unlikely(!__pyx_t_40.memview)) __PYX_ERR(0, 7253, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + + /* "cyext_acv.pyx":7249 + * # max_depth, min_node_size, classifier, t) + * + * sdp_ba = compute_cdp_rf_same_set(X_arr[np.array(in_data, dtype=bool)], # <<<<<<<<<<<<<< + * y_X_arr[np.array(in_data, dtype=bool)], down_arr[np.array(in_data, dtype=bool)], + * up_arr[np.array(in_data, dtype=bool)], + */ + __pyx_t_24 = __pyx_f_9cyext_acv_compute_cdp_rf_same_set(__pyx_t_36, __pyx_t_37, __pyx_t_38, __pyx_t_39, __pyx_v_data, __pyx_v_y_data, __pyx_t_7, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_t_40, 0); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __PYX_XDEC_MEMVIEW(&__pyx_t_36, 1); + __pyx_t_36.memview = NULL; + __pyx_t_36.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_37, 1); + __pyx_t_37.memview = NULL; + __pyx_t_37.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_38, 1); + __pyx_t_38.memview = NULL; + __pyx_t_38.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_39, 1); + __pyx_t_39.memview = NULL; + __pyx_t_39.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_40, 1); + __pyx_t_40.memview = NULL; + __pyx_t_40.data = NULL; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_24, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 7249, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp_ba, 1); + __pyx_v_sdp_ba = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":7255 + * children_right, max_depth, min_node_size, classifier, t_arr[np.array(in_data, dtype=bool)]) + * + * for i in range(N): # <<<<<<<<<<<<<< + * sdp_b[R_buf[i]] = sdp_ba[i] + * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: + */ + __pyx_t_8 = __pyx_v_N; + __pyx_t_9 = __pyx_t_8; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_9; __pyx_t_22+=1) { + __pyx_v_i = __pyx_t_22; + + /* "cyext_acv.pyx":7256 + * + * for i in range(N): + * sdp_b[R_buf[i]] = sdp_ba[i] # <<<<<<<<<<<<<< + * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: + * sdp[R_buf[i]] = sdp_b[R_buf[i]] + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = __pyx_v_i; + __pyx_t_41 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_35 * __pyx_v_R_buf.strides[0]) ))); + *((double *) ( /* dim=0 */ (__pyx_v_sdp_b.data + __pyx_t_41 * __pyx_v_sdp_b.strides[0]) )) = (*((double *) ( /* dim=0 */ (__pyx_v_sdp_ba.data + __pyx_t_34 * __pyx_v_sdp_ba.strides[0]) ))); + + /* "cyext_acv.pyx":7257 + * for i in range(N): + * sdp_b[R_buf[i]] = sdp_ba[i] + * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: # <<<<<<<<<<<<<< + * sdp[R_buf[i]] = sdp_b[R_buf[i]] + * len_s_star[R_buf[i]] = S_size + */ + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_34 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_41 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_12 = (((*((double *) ( /* dim=0 */ (__pyx_v_sdp_b.data + __pyx_t_35 * __pyx_v_sdp_b.strides[0]) ))) >= (*((double *) ( /* dim=0 */ (__pyx_v_sdp.data + __pyx_t_42 * __pyx_v_sdp.strides[0]) )))) != 0); + if (__pyx_t_12) { + + /* "cyext_acv.pyx":7258 + * sdp_b[R_buf[i]] = sdp_ba[i] + * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: + * sdp[R_buf[i]] = sdp_b[R_buf[i]] # <<<<<<<<<<<<<< + * len_s_star[R_buf[i]] = S_size + * for s in range(S_size): + */ + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_41 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_34 = __pyx_v_i; + __pyx_t_35 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_34 * __pyx_v_R_buf.strides[0]) ))); + *((double *) ( /* dim=0 */ (__pyx_v_sdp.data + __pyx_t_35 * __pyx_v_sdp.strides[0]) )) = (*((double *) ( /* dim=0 */ (__pyx_v_sdp_b.data + __pyx_t_42 * __pyx_v_sdp_b.strides[0]) ))); + + /* "cyext_acv.pyx":7259 + * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: + * sdp[R_buf[i]] = sdp_b[R_buf[i]] + * len_s_star[R_buf[i]] = S_size # <<<<<<<<<<<<<< + * for s in range(S_size): + * s_star[R_buf[i], s] = S[s] + */ + __pyx_t_41 = __pyx_v_i; + (__pyx_v_len_s_star[(*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_41 * __pyx_v_R_buf.strides[0]) )))]) = __pyx_v_S_size; + + /* "cyext_acv.pyx":7260 + * sdp[R_buf[i]] = sdp_b[R_buf[i]] + * len_s_star[R_buf[i]] = S_size + * for s in range(S_size): # <<<<<<<<<<<<<< + * s_star[R_buf[i], s] = S[s] + * + */ + __pyx_t_32 = __pyx_v_S_size; + __pyx_t_33 = __pyx_t_32; + for (__pyx_t_43 = 0; __pyx_t_43 < __pyx_t_33; __pyx_t_43+=1) { + __pyx_v_s = __pyx_t_43; + + /* "cyext_acv.pyx":7261 + * len_s_star[R_buf[i]] = S_size + * for s in range(S_size): + * s_star[R_buf[i], s] = S[s] # <<<<<<<<<<<<<< + * + * if S_size == X.shape[1]: + */ + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_41 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_34 = __pyx_v_s; + *((long *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_s_star.data + __pyx_t_42 * __pyx_v_s_star.strides[0]) ) + __pyx_t_34 * __pyx_v_s_star.strides[1]) )) = (__pyx_v_S[__pyx_v_s]); + } + + /* "cyext_acv.pyx":7257 + * for i in range(N): + * sdp_b[R_buf[i]] = sdp_ba[i] + * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: # <<<<<<<<<<<<<< + * sdp[R_buf[i]] = sdp_b[R_buf[i]] + * len_s_star[R_buf[i]] = S_size + */ + } + + /* "cyext_acv.pyx":7263 + * s_star[R_buf[i], s] = S[s] + * + * if S_size == X.shape[1]: # <<<<<<<<<<<<<< + * sdp[R_buf[i]] = 1 + * len_s_star[R_buf[i]] = S_size + */ + __pyx_t_12 = ((__pyx_v_S_size == (__pyx_v_X.shape[1])) != 0); + if (__pyx_t_12) { + + /* "cyext_acv.pyx":7264 + * + * if S_size == X.shape[1]: + * sdp[R_buf[i]] = 1 # <<<<<<<<<<<<<< + * len_s_star[R_buf[i]] = S_size + * for s in range(S_size): + */ + __pyx_t_41 = __pyx_v_i; + __pyx_t_34 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_41 * __pyx_v_R_buf.strides[0]) ))); + *((double *) ( /* dim=0 */ (__pyx_v_sdp.data + __pyx_t_34 * __pyx_v_sdp.strides[0]) )) = 1.0; + + /* "cyext_acv.pyx":7265 + * if S_size == X.shape[1]: + * sdp[R_buf[i]] = 1 + * len_s_star[R_buf[i]] = S_size # <<<<<<<<<<<<<< + * for s in range(S_size): + * s_star[R_buf[i], s] = S[s] + */ + __pyx_t_41 = __pyx_v_i; + (__pyx_v_len_s_star[(*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_41 * __pyx_v_R_buf.strides[0]) )))]) = __pyx_v_S_size; + + /* "cyext_acv.pyx":7266 + * sdp[R_buf[i]] = 1 + * len_s_star[R_buf[i]] = S_size + * for s in range(S_size): # <<<<<<<<<<<<<< + * s_star[R_buf[i], s] = S[s] + * for s in range(len_s_star[R_buf[i]], X.shape[1]): # to filter (important for coalition) + */ + __pyx_t_32 = __pyx_v_S_size; + __pyx_t_33 = __pyx_t_32; + for (__pyx_t_43 = 0; __pyx_t_43 < __pyx_t_33; __pyx_t_43+=1) { + __pyx_v_s = __pyx_t_43; + + /* "cyext_acv.pyx":7267 + * len_s_star[R_buf[i]] = S_size + * for s in range(S_size): + * s_star[R_buf[i], s] = S[s] # <<<<<<<<<<<<<< + * for s in range(len_s_star[R_buf[i]], X.shape[1]): # to filter (important for coalition) + * s_star[R_buf[i], s] = -1 + */ + __pyx_t_41 = __pyx_v_i; + __pyx_t_34 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_41 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_42 = __pyx_v_s; + *((long *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_s_star.data + __pyx_t_34 * __pyx_v_s_star.strides[0]) ) + __pyx_t_42 * __pyx_v_s_star.strides[1]) )) = (__pyx_v_S[__pyx_v_s]); + } + + /* "cyext_acv.pyx":7268 + * for s in range(S_size): + * s_star[R_buf[i], s] = S[s] + * for s in range(len_s_star[R_buf[i]], X.shape[1]): # to filter (important for coalition) # <<<<<<<<<<<<<< + * s_star[R_buf[i], s] = -1 + * + */ + __pyx_t_14 = (__pyx_v_X.shape[1]); + __pyx_t_41 = __pyx_v_i; + __pyx_t_15 = __pyx_t_14; + for (__pyx_t_32 = (__pyx_v_len_s_star[(*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_41 * __pyx_v_R_buf.strides[0]) )))]); __pyx_t_32 < __pyx_t_15; __pyx_t_32+=1) { + __pyx_v_s = __pyx_t_32; + + /* "cyext_acv.pyx":7269 + * s_star[R_buf[i], s] = S[s] + * for s in range(len_s_star[R_buf[i]], X.shape[1]): # to filter (important for coalition) + * s_star[R_buf[i], s] = -1 # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_t_42 = __pyx_v_i; + __pyx_t_34 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_42 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_35 = __pyx_v_s; + *((long *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_s_star.data + __pyx_t_34 * __pyx_v_s_star.strides[0]) ) + __pyx_t_35 * __pyx_v_s_star.strides[1]) )) = -1L; + } + + /* "cyext_acv.pyx":7263 + * s_star[R_buf[i], s] = S[s] + * + * if S_size == X.shape[1]: # <<<<<<<<<<<<<< + * sdp[R_buf[i]] = 1 + * len_s_star[R_buf[i]] = S_size + */ + } + } + } + + /* "cyext_acv.pyx":7271 + * s_star[R_buf[i], s] = -1 + * + * for i in range(N): # <<<<<<<<<<<<<< + * if sdp[R_buf[i]] >= pi_level: + * r.push_back(R[i]) + */ + __pyx_t_8 = __pyx_v_N; + __pyx_t_9 = __pyx_t_8; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "cyext_acv.pyx":7272 + * + * for i in range(N): + * if sdp[R_buf[i]] >= pi_level: # <<<<<<<<<<<<<< + * r.push_back(R[i]) + * for s in range(len_s_star[R_buf[i]]): + */ + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_41 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_12 = (((*((double *) ( /* dim=0 */ (__pyx_v_sdp.data + __pyx_t_42 * __pyx_v_sdp.strides[0]) ))) >= __pyx_v_pi_level) != 0); + if (__pyx_t_12) { + + /* "cyext_acv.pyx":7273 + * for i in range(N): + * if sdp[R_buf[i]] >= pi_level: + * r.push_back(R[i]) # <<<<<<<<<<<<<< + * for s in range(len_s_star[R_buf[i]]): + * sdp_global[s_star[R_buf[i], s]] += 1 + */ + try { + __pyx_v_r.push_back((__pyx_v_R[__pyx_v_i])); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 7273, __pyx_L1_error) + } + + /* "cyext_acv.pyx":7274 + * if sdp[R_buf[i]] >= pi_level: + * r.push_back(R[i]) + * for s in range(len_s_star[R_buf[i]]): # <<<<<<<<<<<<<< + * sdp_global[s_star[R_buf[i], s]] += 1 + * + */ + __pyx_t_41 = __pyx_v_i; + __pyx_t_22 = (__pyx_v_len_s_star[(*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_41 * __pyx_v_R_buf.strides[0]) )))]); + __pyx_t_32 = __pyx_t_22; + for (__pyx_t_33 = 0; __pyx_t_33 < __pyx_t_32; __pyx_t_33+=1) { + __pyx_v_s = __pyx_t_33; + + /* "cyext_acv.pyx":7275 + * r.push_back(R[i]) + * for s in range(len_s_star[R_buf[i]]): + * sdp_global[s_star[R_buf[i], s]] += 1 # <<<<<<<<<<<<<< + * + * for i in range(r.size()): + */ + __pyx_t_41 = __pyx_v_i; + __pyx_t_42 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_41 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_35 = __pyx_v_s; + __pyx_t_34 = (*((long *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_s_star.data + __pyx_t_42 * __pyx_v_s_star.strides[0]) ) + __pyx_t_35 * __pyx_v_s_star.strides[1]) ))); + *((double *) ( /* dim=0 */ (__pyx_v_sdp_global.data + __pyx_t_34 * __pyx_v_sdp_global.strides[0]) )) += 1.0; + } + + /* "cyext_acv.pyx":7272 + * + * for i in range(N): + * if sdp[R_buf[i]] >= pi_level: # <<<<<<<<<<<<<< + * r.push_back(R[i]) + * for s in range(len_s_star[R_buf[i]]): + */ + } + } + + /* "cyext_acv.pyx":7277 + * sdp_global[s_star[R_buf[i], s]] += 1 + * + * for i in range(r.size()): # <<<<<<<<<<<<<< + * std_remove[vector[long].iterator, long](R.begin(), R.end(), r[i]) + * R.pop_back() + */ + __pyx_t_30 = __pyx_v_r.size(); + __pyx_t_31 = __pyx_t_30; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_31; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "cyext_acv.pyx":7278 + * + * for i in range(r.size()): + * std_remove[vector[long].iterator, long](R.begin(), R.end(), r[i]) # <<<<<<<<<<<<<< + * R.pop_back() + * + */ + (void)(std::remove ::iterator,long>(__pyx_v_R.begin(), __pyx_v_R.end(), (__pyx_v_r[__pyx_v_i]))); + + /* "cyext_acv.pyx":7279 + * for i in range(r.size()): + * std_remove[vector[long].iterator, long](R.begin(), R.end(), r[i]) + * R.pop_back() # <<<<<<<<<<<<<< + * + * if (R.size() == 0 or S_size >= X.shape[1]/2) and stop: + */ + __pyx_v_R.pop_back(); + } + + /* "cyext_acv.pyx":7281 + * R.pop_back() + * + * if (R.size() == 0 or S_size >= X.shape[1]/2) and stop: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_19 = ((__pyx_v_R.size() == 0) != 0); + if (!__pyx_t_19) { + } else { + goto __pyx_L57_next_and; + } + __pyx_t_19 = ((__pyx_v_S_size >= ((__pyx_v_X.shape[1]) / 2)) != 0); + if (__pyx_t_19) { + } else { + __pyx_t_12 = __pyx_t_19; + goto __pyx_L56_bool_binop_done; + } + __pyx_L57_next_and:; + __pyx_t_19 = (__pyx_v_stop != 0); + __pyx_t_12 = __pyx_t_19; + __pyx_L56_bool_binop_done:; + if (__pyx_t_12) { + + /* "cyext_acv.pyx":7282 + * + * if (R.size() == 0 or S_size >= X.shape[1]/2) and stop: + * break # <<<<<<<<<<<<<< + * + * return np.asarray(sdp_global)/X.shape[0], np.array(s_star, dtype=np.long), np.array(len_s_star, dtype=np.long), np.array(sdp) + */ + goto __pyx_L27_break; + + /* "cyext_acv.pyx":7281 + * R.pop_back() + * + * if (R.size() == 0 or S_size >= X.shape[1]/2) and stop: # <<<<<<<<<<<<<< + * break + * + */ + } + + /* "cyext_acv.pyx":7225 + * S_bar = np.zeros((data.shape[1]), dtype=np.int) + * + * for s_0 in tqdm(range(minimal, m+1)): # <<<<<<<<<<<<<< + * for s_1 in range(0, power_cpp[s_0].size()): + * for i in range(power_cpp[s_0][s_1].size()): + */ + } + __pyx_L27_break:; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "cyext_acv.pyx":7284 + * break + * + * return np.asarray(sdp_global)/X.shape[0], np.array(s_star, dtype=np.long), np.array(len_s_star, dtype=np.long), np.array(sdp) # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_24, __pyx_n_s_np); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_24, __pyx_n_s_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = __pyx_memoryview_fromslice(__pyx_v_sdp_global, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_24) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_24); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_X.shape[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_24 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_s_star, 2, (PyObject *(*)(char *)) __pyx_memview_get_long, (int (*)(char *, PyObject *)) __pyx_memview_set_long, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_long); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 7284, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __pyx_convert_vector_to_py_int(__pyx_v_len_s_star); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_44 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_long); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 7284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_44) < 0) __PYX_ERR(0, 7284, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0; + __pyx_t_44 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 7284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_44); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_sdp, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_24); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_24); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_44); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_44); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_4); + __pyx_t_24 = 0; + __pyx_t_1 = 0; + __pyx_t_44 = 0; + __pyx_t_4 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "cyext_acv.pyx":7151 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef global_cdp_rf(double[:, :] X, double[::1] y_X, double[::1] DOWN, double[::1] UP, double[:, :] data, double[::1] y_data, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * int max_depth, int min_node_size, int & classifier, double[:, :] & t, list C, double pi_level, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); + __Pyx_XDECREF(__pyx_t_6); + __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1); + __Pyx_XDECREF(__pyx_t_24); + __PYX_XDEC_MEMVIEW(&__pyx_t_27, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_36, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_37, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_38, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_39, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_40, 1); + __Pyx_XDECREF(__pyx_t_44); + __Pyx_AddTraceback("cyext_acv.global_cdp_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp_b, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp_ba, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp_global, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_in_data, 1); + __Pyx_XDECREF(__pyx_v_power); + __Pyx_XDECREF(__pyx_v_va_id); + __PYX_XDEC_MEMVIEW(&__pyx_v_R_buf, 1); + __Pyx_XDECREF(__pyx_v_X_arr); + __Pyx_XDECREF(__pyx_v_y_X_arr); + __Pyx_XDECREF(__pyx_v_down_arr); + __Pyx_XDECREF(__pyx_v_up_arr); + __Pyx_XDECREF(__pyx_v_t_arr); + __Pyx_XDECREF(__pyx_v_remove_va); + __Pyx_XDECREF(__pyx_v_power_b); + __Pyx_XDECREF(__pyx_v_co); + __PYX_XDEC_MEMVIEW(&__pyx_v_s_star, 1); + __Pyx_XDECREF(__pyx_v_S_bar); + __Pyx_XDECREF(__pyx_v_S_bar_set); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_9cyext_acv_121global_cdp_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_9cyext_acv_121global_cdp_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_DOWN = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_UP = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_features = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_thresholds = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_left = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_right = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_max_depth; + int __pyx_v_min_node_size; + int __pyx_v_classifier; + __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_C = 0; + double __pyx_v_pi_level; + int __pyx_v_minimal; + int __pyx_v_stop; + PyObject *__pyx_v_search_space = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("global_cdp_rf (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_y_X,&__pyx_n_s_DOWN,&__pyx_n_s_UP,&__pyx_n_s_data,&__pyx_n_s_y_data,&__pyx_n_s_features,&__pyx_n_s_thresholds,&__pyx_n_s_children_left,&__pyx_n_s_children_right,&__pyx_n_s_max_depth,&__pyx_n_s_min_node_size,&__pyx_n_s_classifier,&__pyx_n_s_t,&__pyx_n_s_C,&__pyx_n_s_pi_level,&__pyx_n_s_minimal,&__pyx_n_s_stop,&__pyx_n_s_search_space,0}; + PyObject* values[19] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18); + CYTHON_FALLTHROUGH; + case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17); + CYTHON_FALLTHROUGH; + case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16); + CYTHON_FALLTHROUGH; + case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15); + CYTHON_FALLTHROUGH; + case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_X)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_cdp_rf", 1, 19, 19, 1); __PYX_ERR(0, 7151, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_DOWN)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_cdp_rf", 1, 19, 19, 2); __PYX_ERR(0, 7151, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_UP)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_cdp_rf", 1, 19, 19, 3); __PYX_ERR(0, 7151, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_cdp_rf", 1, 19, 19, 4); __PYX_ERR(0, 7151, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_cdp_rf", 1, 19, 19, 5); __PYX_ERR(0, 7151, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_features)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_cdp_rf", 1, 19, 19, 6); __PYX_ERR(0, 7151, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thresholds)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_cdp_rf", 1, 19, 19, 7); __PYX_ERR(0, 7151, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_left)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_cdp_rf", 1, 19, 19, 8); __PYX_ERR(0, 7151, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_cdp_rf", 1, 19, 19, 9); __PYX_ERR(0, 7151, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_cdp_rf", 1, 19, 19, 10); __PYX_ERR(0, 7151, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_node_size)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_cdp_rf", 1, 19, 19, 11); __PYX_ERR(0, 7151, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classifier)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_cdp_rf", 1, 19, 19, 12); __PYX_ERR(0, 7151, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 13: + if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_cdp_rf", 1, 19, 19, 13); __PYX_ERR(0, 7151, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 14: + if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_cdp_rf", 1, 19, 19, 14); __PYX_ERR(0, 7151, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 15: + if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pi_level)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_cdp_rf", 1, 19, 19, 15); __PYX_ERR(0, 7151, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 16: + if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minimal)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_cdp_rf", 1, 19, 19, 16); __PYX_ERR(0, 7151, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 17: + if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_cdp_rf", 1, 19, 19, 17); __PYX_ERR(0, 7151, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 18: + if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_search_space)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_cdp_rf", 1, 19, 19, 18); __PYX_ERR(0, 7151, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "global_cdp_rf") < 0)) __PYX_ERR(0, 7151, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 19) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + values[15] = PyTuple_GET_ITEM(__pyx_args, 15); + values[16] = PyTuple_GET_ITEM(__pyx_args, 16); + values[17] = PyTuple_GET_ITEM(__pyx_args, 17); + values[18] = PyTuple_GET_ITEM(__pyx_args, 18); + } + __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 7151, __pyx_L3_error) + __pyx_v_y_X = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_X.memview)) __PYX_ERR(0, 7151, __pyx_L3_error) + __pyx_v_DOWN = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_DOWN.memview)) __PYX_ERR(0, 7151, __pyx_L3_error) + __pyx_v_UP = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_UP.memview)) __PYX_ERR(0, 7151, __pyx_L3_error) + __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 7151, __pyx_L3_error) + __pyx_v_y_data = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_data.memview)) __PYX_ERR(0, 7151, __pyx_L3_error) + __pyx_v_features = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_features.memview)) __PYX_ERR(0, 7152, __pyx_L3_error) + __pyx_v_thresholds = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_thresholds.memview)) __PYX_ERR(0, 7152, __pyx_L3_error) + __pyx_v_children_left = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_left.memview)) __PYX_ERR(0, 7152, __pyx_L3_error) + __pyx_v_children_right = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[9], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_right.memview)) __PYX_ERR(0, 7152, __pyx_L3_error) + __pyx_v_max_depth = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7153, __pyx_L3_error) + __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7153, __pyx_L3_error) + __pyx_v_classifier = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7153, __pyx_L3_error) + __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[13], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 7153, __pyx_L3_error) + __pyx_v_C = ((PyObject*)values[14]); + __pyx_v_pi_level = __pyx_PyFloat_AsDouble(values[15]); if (unlikely((__pyx_v_pi_level == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 7153, __pyx_L3_error) + __pyx_v_minimal = __Pyx_PyInt_As_int(values[16]); if (unlikely((__pyx_v_minimal == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7154, __pyx_L3_error) + __pyx_v_stop = __Pyx_PyObject_IsTrue(values[17]); if (unlikely((__pyx_v_stop == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7154, __pyx_L3_error) + __pyx_v_search_space = ((PyObject*)values[18]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("global_cdp_rf", 1, 19, 19, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7151, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cyext_acv.global_cdp_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_C), (&PyList_Type), 1, "C", 1))) __PYX_ERR(0, 7153, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_search_space), (&PyList_Type), 1, "search_space", 1))) __PYX_ERR(0, 7154, __pyx_L1_error) + __pyx_r = __pyx_pf_9cyext_acv_120global_cdp_rf(__pyx_self, __pyx_v_X, __pyx_v_y_X, __pyx_v_DOWN, __pyx_v_UP, __pyx_v_data, __pyx_v_y_data, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_v_C, __pyx_v_pi_level, __pyx_v_minimal, __pyx_v_stop, __pyx_v_search_space); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9cyext_acv_120global_cdp_rf(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_DOWN, __Pyx_memviewslice __pyx_v_UP, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t, PyObject *__pyx_v_C, double __pyx_v_pi_level, int __pyx_v_minimal, int __pyx_v_stop, PyObject *__pyx_v_search_space) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("global_cdp_rf", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundLocalError("X"); __PYX_ERR(0, 7151, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_X.memview)) { __Pyx_RaiseUnboundLocalError("y_X"); __PYX_ERR(0, 7151, __pyx_L1_error) } + if (unlikely(!__pyx_v_DOWN.memview)) { __Pyx_RaiseUnboundLocalError("DOWN"); __PYX_ERR(0, 7151, __pyx_L1_error) } + if (unlikely(!__pyx_v_UP.memview)) { __Pyx_RaiseUnboundLocalError("UP"); __PYX_ERR(0, 7151, __pyx_L1_error) } + if (unlikely(!__pyx_v_data.memview)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 7151, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_data.memview)) { __Pyx_RaiseUnboundLocalError("y_data"); __PYX_ERR(0, 7151, __pyx_L1_error) } + if (unlikely(!__pyx_v_features.memview)) { __Pyx_RaiseUnboundLocalError("features"); __PYX_ERR(0, 7151, __pyx_L1_error) } + if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 7151, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 7151, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 7151, __pyx_L1_error) } + if (unlikely(!__pyx_v_t.memview)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 7151, __pyx_L1_error) } + __pyx_t_1 = __pyx_f_9cyext_acv_global_cdp_rf(__pyx_v_X, __pyx_v_y_X, __pyx_v_DOWN, __pyx_v_UP, __pyx_v_data, __pyx_v_y_data, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_v_C, __pyx_v_pi_level, __pyx_v_minimal, __pyx_v_stop, __pyx_v_search_space, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cyext_acv.global_cdp_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_DOWN, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_UP, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_features, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_thresholds, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_left, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_right, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_t, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cyext_acv.pyx":7290 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cdef double single_compute_cdp_rule_weights(double[:] & x, double & y_x, double & down, double & up, double[:, :] & data, double[::1] & y_data, vector[int] & S, # <<<<<<<<<<<<<< + * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + * int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition, + */ + +static double __pyx_f_9cyext_acv_single_compute_cdp_rule_weights(__Pyx_memviewslice &__pyx_v_x, double &__pyx_v_y_x, double &__pyx_v_down, double &__pyx_v_up, __Pyx_memviewslice &__pyx_v_data, __Pyx_memviewslice &__pyx_v_y_data, std::vector &__pyx_v_S, __Pyx_memviewslice &__pyx_v_features, __Pyx_memviewslice &__pyx_v_thresholds, __Pyx_memviewslice &__pyx_v_children_left, __Pyx_memviewslice &__pyx_v_children_right, int &__pyx_v_max_depth, int &__pyx_v_min_node_size, int &__pyx_v_classifier, CYTHON_UNUSED __Pyx_memviewslice &__pyx_v_t, __Pyx_memviewslice &__pyx_v_partition, __Pyx_memviewslice &__pyx_v_w) { + unsigned int __pyx_v_n_trees; + unsigned int __pyx_v_N; + double __pyx_v_sdp; + int __pyx_v_b; + CYTHON_UNUSED int __pyx_v_level; + int __pyx_v_i; + int __pyx_v_it_node; + std::set __pyx_v_nodes_level; + std::set __pyx_v_nodes_child; + std::set __pyx_v_in_data; + std::set __pyx_v_in_data_b; + std::set ::iterator __pyx_v_it; + std::set ::iterator __pyx_v_it_point; + double __pyx_r; + unsigned int __pyx_t_1; + unsigned int __pyx_t_2; + int __pyx_t_3; + unsigned int __pyx_t_4; + unsigned int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + double __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "cyext_acv.pyx":7295 + * double[:] & w) nogil: + * + * cdef unsigned int n_trees = features.shape[0] # <<<<<<<<<<<<<< + * cdef unsigned int N = data.shape[0] + * cdef double s, sdp + */ + __pyx_v_n_trees = (__pyx_v_features.shape[0]); + + /* "cyext_acv.pyx":7296 + * + * cdef unsigned int n_trees = features.shape[0] + * cdef unsigned int N = data.shape[0] # <<<<<<<<<<<<<< + * cdef double s, sdp + * cdef int o + */ + __pyx_v_N = (__pyx_v_data.shape[0]); + + /* "cyext_acv.pyx":7299 + * cdef double s, sdp + * cdef int o + * sdp = 0 # <<<<<<<<<<<<<< + * + * cdef int b, level, i, it_node + */ + __pyx_v_sdp = 0.0; + + /* "cyext_acv.pyx":7305 + * cdef set[int].iterator it, it_point + * + * for b in range(n_trees): # <<<<<<<<<<<<<< + * nodes_child.clear() + * nodes_level.clear() + */ + __pyx_t_1 = __pyx_v_n_trees; + __pyx_t_2 = __pyx_t_1; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_b = __pyx_t_3; + + /* "cyext_acv.pyx":7306 + * + * for b in range(n_trees): + * nodes_child.clear() # <<<<<<<<<<<<<< + * nodes_level.clear() + * nodes_level.insert(0) + */ + __pyx_v_nodes_child.clear(); + + /* "cyext_acv.pyx":7307 + * for b in range(n_trees): + * nodes_child.clear() + * nodes_level.clear() # <<<<<<<<<<<<<< + * nodes_level.insert(0) + * + */ + __pyx_v_nodes_level.clear(); + + /* "cyext_acv.pyx":7308 + * nodes_child.clear() + * nodes_level.clear() + * nodes_level.insert(0) # <<<<<<<<<<<<<< + * + * in_data.clear() + */ + try { + __pyx_v_nodes_level.insert(0); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 7308, __pyx_L1_error) + } + + /* "cyext_acv.pyx":7310 + * nodes_level.insert(0) + * + * in_data.clear() # <<<<<<<<<<<<<< + * in_data_b.clear() + * for i in range(N): + */ + __pyx_v_in_data.clear(); + + /* "cyext_acv.pyx":7311 + * + * in_data.clear() + * in_data_b.clear() # <<<<<<<<<<<<<< + * for i in range(N): + * in_data.insert(i) + */ + __pyx_v_in_data_b.clear(); + + /* "cyext_acv.pyx":7312 + * in_data.clear() + * in_data_b.clear() + * for i in range(N): # <<<<<<<<<<<<<< + * in_data.insert(i) + * in_data_b.insert(i) + */ + __pyx_t_4 = __pyx_v_N; + __pyx_t_5 = __pyx_t_4; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "cyext_acv.pyx":7313 + * in_data_b.clear() + * for i in range(N): + * in_data.insert(i) # <<<<<<<<<<<<<< + * in_data_b.insert(i) + * + */ + try { + __pyx_v_in_data.insert(__pyx_v_i); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 7313, __pyx_L1_error) + } + + /* "cyext_acv.pyx":7314 + * for i in range(N): + * in_data.insert(i) + * in_data_b.insert(i) # <<<<<<<<<<<<<< + * + * for level in range(max_depth): + */ + try { + __pyx_v_in_data_b.insert(__pyx_v_i); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 7314, __pyx_L1_error) + } + } + + /* "cyext_acv.pyx":7316 + * in_data_b.insert(i) + * + * for level in range(max_depth): # <<<<<<<<<<<<<< + * it_point = nodes_level.begin() + * while(it_point != nodes_level.end()): + */ + __pyx_t_6 = __pyx_v_max_depth; + __pyx_t_7 = __pyx_t_6; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_level = __pyx_t_8; + + /* "cyext_acv.pyx":7317 + * + * for level in range(max_depth): + * it_point = nodes_level.begin() # <<<<<<<<<<<<<< + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) + */ + __pyx_v_it_point = __pyx_v_nodes_level.begin(); + + /* "cyext_acv.pyx":7318 + * for level in range(max_depth): + * it_point = nodes_level.begin() + * while(it_point != nodes_level.end()): # <<<<<<<<<<<<<< + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it_point != __pyx_v_nodes_level.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":7319 + * it_point = nodes_level.begin() + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) # <<<<<<<<<<<<<< + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * if x[features[b, it_node]] <= thresholds[b, it_node]: + */ + __pyx_v_it_node = (*__pyx_v_it_point); + + /* "cyext_acv.pyx":7320 + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): # <<<<<<<<<<<<<< + * if x[features[b, it_node]] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) + */ + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_9 = ((std::find ::iterator,int>(__pyx_v_S.begin(), __pyx_v_S.end(), (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_10 * __pyx_v_features.strides[0]) ) + __pyx_t_11 * __pyx_v_features.strides[1]) )))) != __pyx_v_S.end()) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":7321 + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * if x[features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * + */ + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_12 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_11 * __pyx_v_features.strides[0]) ) + __pyx_t_10 * __pyx_v_features.strides[1]) ))); + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_12 * __pyx_v_x.strides[0]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_13 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_14 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":7322 + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * if x[features[b, it_node]] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) # <<<<<<<<<<<<<< + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + */ + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_left.data + __pyx_t_14 * __pyx_v_children_left.strides[0]) ) + __pyx_t_13 * __pyx_v_children_left.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 7322, __pyx_L1_error) + } + + /* "cyext_acv.pyx":7324 + * nodes_child.insert(children_left[b, it_node]) + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 1] = thresholds[b, it_node] + * + */ + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + __pyx_t_10 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_13 * __pyx_v_features.strides[0]) ) + __pyx_t_14 * __pyx_v_features.strides[1]) ))); + __pyx_t_11 = 1; + __pyx_t_12 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_10 * __pyx_v_partition.strides[0]) ) + __pyx_t_11 * __pyx_v_partition.strides[1]) ))) >= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_12 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_15 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":7325 + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + * partition[features[b, it_node], 1] = thresholds[b, it_node] # <<<<<<<<<<<<<< + * + * it = in_data.begin() + */ + __pyx_t_15 = __pyx_v_b; + __pyx_t_12 = __pyx_v_it_node; + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_11 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_14 * __pyx_v_features.strides[0]) ) + __pyx_t_13 * __pyx_v_features.strides[1]) ))); + __pyx_t_10 = 1; + *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_11 * __pyx_v_partition.strides[0]) ) + __pyx_t_10 * __pyx_v_partition.strides[1]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_15 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_12 * __pyx_v_thresholds.strides[1]) ))); + + /* "cyext_acv.pyx":7324 + * nodes_child.insert(children_left[b, it_node]) + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 1] = thresholds[b, it_node] + * + */ + } + + /* "cyext_acv.pyx":7327 + * partition[features[b, it_node], 1] = thresholds[b, it_node] + * + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + */ + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":7328 + * + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":7329 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + __pyx_t_12 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_13 = (*__pyx_v_it); + __pyx_t_14 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_12 * __pyx_v_features.strides[0]) ) + __pyx_t_15 * __pyx_v_features.strides[1]) ))); + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_data.data + __pyx_t_13 * __pyx_v_data.strides[0]) ) + __pyx_t_14 * __pyx_v_data.strides[1]) ))) > (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_10 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_11 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":7330 + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) # <<<<<<<<<<<<<< + * inc(it) + * in_data = in_data_b + */ + (void)(__pyx_v_in_data_b.erase((*__pyx_v_it))); + + /* "cyext_acv.pyx":7329 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + } + + /* "cyext_acv.pyx":7331 + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + * inc(it) # <<<<<<<<<<<<<< + * in_data = in_data_b + * + */ + (void)((++__pyx_v_it)); + } + + /* "cyext_acv.pyx":7332 + * in_data_b.erase(deref(it)) + * inc(it) + * in_data = in_data_b # <<<<<<<<<<<<<< + * + * else: + */ + __pyx_v_in_data = __pyx_v_in_data_b; + + /* "cyext_acv.pyx":7321 + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * if x[features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * + */ + goto __pyx_L12; + } + + /* "cyext_acv.pyx":7335 + * + * else: + * nodes_child.insert(children_right[b, it_node]) # <<<<<<<<<<<<<< + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: + */ + /*else*/ { + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_right.data + __pyx_t_11 * __pyx_v_children_right.strides[0]) ) + __pyx_t_10 * __pyx_v_children_right.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 7335, __pyx_L1_error) + } + + /* "cyext_acv.pyx":7337 + * nodes_child.insert(children_right[b, it_node]) + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 0] = thresholds[b, it_node] + * + */ + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_15 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_10 * __pyx_v_features.strides[0]) ) + __pyx_t_11 * __pyx_v_features.strides[1]) ))); + __pyx_t_12 = 0; + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_15 * __pyx_v_partition.strides[0]) ) + __pyx_t_12 * __pyx_v_partition.strides[1]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_14 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_13 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":7338 + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: + * partition[features[b, it_node], 0] = thresholds[b, it_node] # <<<<<<<<<<<<<< + * + * it = in_data.begin() + */ + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_12 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_11 * __pyx_v_features.strides[0]) ) + __pyx_t_10 * __pyx_v_features.strides[1]) ))); + __pyx_t_15 = 0; + *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_12 * __pyx_v_partition.strides[0]) ) + __pyx_t_15 * __pyx_v_partition.strides[1]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_13 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_14 * __pyx_v_thresholds.strides[1]) ))); + + /* "cyext_acv.pyx":7337 + * nodes_child.insert(children_right[b, it_node]) + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 0] = thresholds[b, it_node] + * + */ + } + + /* "cyext_acv.pyx":7340 + * partition[features[b, it_node], 0] = thresholds[b, it_node] + * + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + */ + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":7341 + * + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":7342 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_10 = (*__pyx_v_it); + __pyx_t_11 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_14 * __pyx_v_features.strides[0]) ) + __pyx_t_13 * __pyx_v_features.strides[1]) ))); + __pyx_t_15 = __pyx_v_b; + __pyx_t_12 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_data.data + __pyx_t_10 * __pyx_v_data.strides[0]) ) + __pyx_t_11 * __pyx_v_data.strides[1]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_15 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_12 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":7343 + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) # <<<<<<<<<<<<<< + * inc(it) + * in_data = in_data_b + */ + (void)(__pyx_v_in_data_b.erase((*__pyx_v_it))); + + /* "cyext_acv.pyx":7342 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + } + + /* "cyext_acv.pyx":7344 + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + * inc(it) # <<<<<<<<<<<<<< + * in_data = in_data_b + * else: + */ + (void)((++__pyx_v_it)); + } + + /* "cyext_acv.pyx":7345 + * in_data_b.erase(deref(it)) + * inc(it) + * in_data = in_data_b # <<<<<<<<<<<<<< + * else: + * nodes_child.insert(children_left[b, it_node]) + */ + __pyx_v_in_data = __pyx_v_in_data_b; + } + __pyx_L12:; + + /* "cyext_acv.pyx":7320 + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): # <<<<<<<<<<<<<< + * if x[features[b, it_node]] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) + */ + goto __pyx_L11; + } + + /* "cyext_acv.pyx":7347 + * in_data = in_data_b + * else: + * nodes_child.insert(children_left[b, it_node]) # <<<<<<<<<<<<<< + * nodes_child.insert(children_right[b, it_node]) + * + */ + /*else*/ { + __pyx_t_12 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_left.data + __pyx_t_12 * __pyx_v_children_left.strides[0]) ) + __pyx_t_15 * __pyx_v_children_left.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 7347, __pyx_L1_error) + } + + /* "cyext_acv.pyx":7348 + * else: + * nodes_child.insert(children_left[b, it_node]) + * nodes_child.insert(children_right[b, it_node]) # <<<<<<<<<<<<<< + * + * if in_data.size() < min_node_size: + */ + __pyx_t_15 = __pyx_v_b; + __pyx_t_12 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_right.data + __pyx_t_15 * __pyx_v_children_right.strides[0]) ) + __pyx_t_12 * __pyx_v_children_right.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 7348, __pyx_L1_error) + } + } + __pyx_L11:; + + /* "cyext_acv.pyx":7350 + * nodes_child.insert(children_right[b, it_node]) + * + * if in_data.size() < min_node_size: # <<<<<<<<<<<<<< + * break + * inc(it_point) + */ + __pyx_t_9 = ((__pyx_v_in_data.size() < __pyx_v_min_node_size) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":7351 + * + * if in_data.size() < min_node_size: + * break # <<<<<<<<<<<<<< + * inc(it_point) + * + */ + goto __pyx_L10_break; + + /* "cyext_acv.pyx":7350 + * nodes_child.insert(children_right[b, it_node]) + * + * if in_data.size() < min_node_size: # <<<<<<<<<<<<<< + * break + * inc(it_point) + */ + } + + /* "cyext_acv.pyx":7352 + * if in_data.size() < min_node_size: + * break + * inc(it_point) # <<<<<<<<<<<<<< + * + * nodes_level = nodes_child + */ + (void)((++__pyx_v_it_point)); + } + __pyx_L10_break:; + + /* "cyext_acv.pyx":7354 + * inc(it_point) + * + * nodes_level = nodes_child # <<<<<<<<<<<<<< + * + * if classifier == 1: + */ + __pyx_v_nodes_level = __pyx_v_nodes_child; + } + + /* "cyext_acv.pyx":7356 + * nodes_level = nodes_child + * + * if classifier == 1: # <<<<<<<<<<<<<< + * it = in_data.begin() + * while(it != in_data.end()): + */ + __pyx_t_9 = ((__pyx_v_classifier == 1) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":7357 + * + * if classifier == 1: + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (y_x == y_data[deref(it)]) + */ + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":7358 + * if classifier == 1: + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * sdp += (1./(n_trees*in_data.size())) * (y_x == y_data[deref(it)]) + * w[deref(it)] += (1./(n_trees*in_data.size())) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":7359 + * it = in_data.begin() + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (y_x == y_data[deref(it)]) # <<<<<<<<<<<<<< + * w[deref(it)] += (1./(n_trees*in_data.size())) + * inc(it) + */ + __pyx_t_12 = (*__pyx_v_it); + __pyx_v_sdp = (__pyx_v_sdp + ((1. / (__pyx_v_n_trees * __pyx_v_in_data.size())) * (__pyx_v_y_x == (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_12)) )))))); + + /* "cyext_acv.pyx":7360 + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (y_x == y_data[deref(it)]) + * w[deref(it)] += (1./(n_trees*in_data.size())) # <<<<<<<<<<<<<< + * inc(it) + * else: + */ + __pyx_t_12 = (*__pyx_v_it); + *((double *) ( /* dim=0 */ (__pyx_v_w.data + __pyx_t_12 * __pyx_v_w.strides[0]) )) += (1. / (__pyx_v_n_trees * __pyx_v_in_data.size())); + + /* "cyext_acv.pyx":7361 + * sdp += (1./(n_trees*in_data.size())) * (y_x == y_data[deref(it)]) + * w[deref(it)] += (1./(n_trees*in_data.size())) + * inc(it) # <<<<<<<<<<<<<< + * else: + * it = in_data.begin() + */ + (void)((++__pyx_v_it)); + } + + /* "cyext_acv.pyx":7356 + * nodes_level = nodes_child + * + * if classifier == 1: # <<<<<<<<<<<<<< + * it = in_data.begin() + * while(it != in_data.end()): + */ + goto __pyx_L22; + } + + /* "cyext_acv.pyx":7363 + * inc(it) + * else: + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (down<=y_data[deref(it)]<=up) + */ + /*else*/ { + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":7364 + * else: + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * sdp += (1./(n_trees*in_data.size())) * (down<=y_data[deref(it)]<=up) + * w[deref(it)] += (1./(n_trees*in_data.size())) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":7365 + * it = in_data.begin() + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (down<=y_data[deref(it)]<=up) # <<<<<<<<<<<<<< + * w[deref(it)] += (1./(n_trees*in_data.size())) + * inc(it) + */ + __pyx_t_12 = (*__pyx_v_it); + __pyx_t_16 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_12)) ))); + __pyx_t_9 = (__pyx_v_down <= __pyx_t_16); + if (__pyx_t_9) { + __pyx_t_9 = (__pyx_t_16 <= __pyx_v_up); + } + __pyx_v_sdp = (__pyx_v_sdp + ((1. / (__pyx_v_n_trees * __pyx_v_in_data.size())) * __pyx_t_9)); + + /* "cyext_acv.pyx":7366 + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (down<=y_data[deref(it)]<=up) + * w[deref(it)] += (1./(n_trees*in_data.size())) # <<<<<<<<<<<<<< + * inc(it) + * + */ + __pyx_t_12 = (*__pyx_v_it); + *((double *) ( /* dim=0 */ (__pyx_v_w.data + __pyx_t_12 * __pyx_v_w.strides[0]) )) += (1. / (__pyx_v_n_trees * __pyx_v_in_data.size())); + + /* "cyext_acv.pyx":7367 + * sdp += (1./(n_trees*in_data.size())) * (down<=y_data[deref(it)]<=up) + * w[deref(it)] += (1./(n_trees*in_data.size())) + * inc(it) # <<<<<<<<<<<<<< + * + * return sdp + */ + (void)((++__pyx_v_it)); + } + } + __pyx_L22:; + } + + /* "cyext_acv.pyx":7369 + * inc(it) + * + * return sdp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_sdp; + goto __pyx_L0; + + /* "cyext_acv.pyx":7290 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cdef double single_compute_cdp_rule_weights(double[:] & x, double & y_x, double & down, double & up, double[:, :] & data, double[::1] & y_data, vector[int] & S, # <<<<<<<<<<<<<< + * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + * int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("cyext_acv.single_compute_cdp_rule_weights", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_r = 0; + __pyx_L0:; + return __pyx_r; +} + +/* "cyext_acv.pyx":7376 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_cdp_weights(double[:, :] X, double[::1] y_X, double[::1] down, double[::1] up, double[:, :] data, double[::1] y_data, vector[vector[int]] S, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * int max_depth, int min_node_size, int & classifier, double[:, :] & t, double & pi): + */ + +static PyObject *__pyx_pw_9cyext_acv_123compute_cdp_weights(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_cdp_weights(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_down, __Pyx_memviewslice __pyx_v_up, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, CYTHON_UNUSED double &__pyx_v_pi, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_buffer = NULL; + __Pyx_memviewslice __pyx_v_partition_byobs = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_N; + __Pyx_memviewslice __pyx_v_sdp = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_weights = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __Pyx_memviewslice __pyx_t_16 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_17 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_cdp_weights", 0); + + /* "cyext_acv.pyx":7380 + * int max_depth, int min_node_size, int & classifier, double[:, :] & t, double & pi): + * + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) # <<<<<<<<<<<<<< + * buffer[:, :, 0] = -1e+10 + * cdef double [:, :, :] partition_byobs = buffer + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7380, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ones); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7380, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7380, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_X.shape[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7380, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_X.shape[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7380, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7380, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_INCREF(__pyx_int_2); + __Pyx_GIVEREF(__pyx_int_2); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_2); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 7380, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7380, __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 = PyNumber_Multiply(__pyx_float_1e_10, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7380, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_buffer = __pyx_t_1; + __pyx_t_1 = 0; + + /* "cyext_acv.pyx":7381 + * + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + * buffer[:, :, 0] = -1e+10 # <<<<<<<<<<<<<< + * cdef double [:, :, :] partition_byobs = buffer + * + */ + if (unlikely(PyObject_SetItem(__pyx_v_buffer, __pyx_tuple__3, __pyx_float_neg_1e_10) < 0)) __PYX_ERR(0, 7381, __pyx_L1_error) + + /* "cyext_acv.pyx":7382 + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + * buffer[:, :, 0] = -1e+10 + * cdef double [:, :, :] partition_byobs = buffer # <<<<<<<<<<<<<< + * + * cdef int N = X.shape[0] + */ + __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_v_buffer, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 7382, __pyx_L1_error) + __pyx_v_partition_byobs = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "cyext_acv.pyx":7384 + * cdef double [:, :, :] partition_byobs = buffer + * + * cdef int N = X.shape[0] # <<<<<<<<<<<<<< + * cdef double[::1] sdp = np.zeros(N) + * cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + */ + __pyx_v_N = (__pyx_v_X.shape[0]); + + /* "cyext_acv.pyx":7385 + * + * cdef int N = X.shape[0] + * cdef double[::1] sdp = np.zeros(N) # <<<<<<<<<<<<<< + * cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + * cdef int i, j + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7385, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7385, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7385, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7385, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 7385, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp = __pyx_t_7; + __pyx_t_7.memview = NULL; + __pyx_t_7.data = NULL; + + /* "cyext_acv.pyx":7386 + * cdef int N = X.shape[0] + * cdef double[::1] sdp = np.zeros(N) + * cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) # <<<<<<<<<<<<<< + * cdef int i, j + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7386, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7386, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7386, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7386, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_data.shape[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7386, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7386, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __pyx_t_5 = 0; + __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_3) < 0) __PYX_ERR(0, 7386, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7386, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 7386, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_weights = __pyx_t_8; + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; + + /* "cyext_acv.pyx":7389 + * cdef int i, j + * + * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_cdp_rule_weights(X[i], y_X[i], down[i], up[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + __pyx_t_9 = __pyx_v_N; + if ((1 == 0)) abort(); + { + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) (x) + #define unlikely(x) (x) + #endif + __pyx_t_11 = (__pyx_t_9 - 0 + 1 - 1/abs(1)) / 1; + if (__pyx_t_11 > 0) + { + #ifdef _OPENMP + #pragma omp parallel private(__pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_18) firstprivate(__pyx_t_12, __pyx_t_16, __pyx_t_17, __pyx_t_8) + #endif /* _OPENMP */ + { + #ifdef _OPENMP + #pragma omp for firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) schedule(dynamic) + #endif /* _OPENMP */ + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_11; __pyx_t_10++){ + { + __pyx_v_i = (int)(0 + 1 * __pyx_t_10); + + /* "cyext_acv.pyx":7390 + * + * for i in prange(N, nogil=True, schedule='dynamic'): + * sdp[i] = single_compute_cdp_rule_weights(X[i], y_X[i], down[i], up[i], data, y_data, S[i], # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i]) + */ + __pyx_t_12.data = __pyx_v_X.data; + __pyx_t_12.memview = __pyx_v_X.memview; + __PYX_INC_MEMVIEW(&__pyx_t_12, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_X.strides[0]; + __pyx_t_12.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_12.shape[0] = __pyx_v_X.shape[1]; +__pyx_t_12.strides[0] = __pyx_v_X.strides[1]; + __pyx_t_12.suboffsets[0] = -1; + +__pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_i; + __pyx_t_15 = __pyx_v_i; + + /* "cyext_acv.pyx":7392 + * sdp[i] = single_compute_cdp_rule_weights(X[i], y_X[i], down[i], up[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i]) # <<<<<<<<<<<<<< + * + * return np.array(sdp), np.array(weights) + */ + __pyx_t_16.data = __pyx_v_t.data; + __pyx_t_16.memview = __pyx_v_t.memview; + __PYX_INC_MEMVIEW(&__pyx_t_16, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_t.strides[0]; + __pyx_t_16.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_16.shape[0] = __pyx_v_t.shape[1]; +__pyx_t_16.strides[0] = __pyx_v_t.strides[1]; + __pyx_t_16.suboffsets[0] = -1; + +__pyx_t_8.data = __pyx_v_partition_byobs.data; + __pyx_t_8.memview = __pyx_v_partition_byobs.memview; + __PYX_INC_MEMVIEW(&__pyx_t_8, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_partition_byobs.strides[0]; + __pyx_t_8.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_8.shape[0] = __pyx_v_partition_byobs.shape[1]; +__pyx_t_8.strides[0] = __pyx_v_partition_byobs.strides[1]; + __pyx_t_8.suboffsets[0] = -1; + +__pyx_t_8.shape[1] = __pyx_v_partition_byobs.shape[2]; +__pyx_t_8.strides[1] = __pyx_v_partition_byobs.strides[2]; + __pyx_t_8.suboffsets[1] = -1; + +__pyx_t_17.data = __pyx_v_weights.data; + __pyx_t_17.memview = __pyx_v_weights.memview; + __PYX_INC_MEMVIEW(&__pyx_t_17, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_weights.strides[0]; + __pyx_t_17.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_17.shape[0] = __pyx_v_weights.shape[1]; +__pyx_t_17.strides[0] = __pyx_v_weights.strides[1]; + __pyx_t_17.suboffsets[0] = -1; + +__pyx_t_18 = __pyx_v_i; + + /* "cyext_acv.pyx":7390 + * + * for i in prange(N, nogil=True, schedule='dynamic'): + * sdp[i] = single_compute_cdp_rule_weights(X[i], y_X[i], down[i], up[i], data, y_data, S[i], # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i]) + */ + *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_sdp.data) + __pyx_t_18)) )) = __pyx_f_9cyext_acv_single_compute_cdp_rule_weights(__pyx_t_12, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_13)) ))), (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_down.data) + __pyx_t_14)) ))), (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_up.data) + __pyx_t_15)) ))), __pyx_v_data, __pyx_v_y_data, (__pyx_v_S[__pyx_v_i]), __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_t_16, __pyx_t_8, __pyx_t_17); + __PYX_XDEC_MEMVIEW(&__pyx_t_12, 0); + __pyx_t_12.memview = NULL; + __pyx_t_12.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_16, 0); + __pyx_t_16.memview = NULL; + __pyx_t_16.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_8, 0); + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_17, 0); + __pyx_t_17.memview = NULL; + __pyx_t_17.data = NULL; + } + } + } + } + } + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #endif + } + + /* "cyext_acv.pyx":7389 + * cdef int i, j + * + * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_cdp_rule_weights(X[i], y_X[i], down[i], up[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "cyext_acv.pyx":7394 + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i]) + * + * return np.array(sdp), np.array(weights) # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_sdp, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_weights, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __pyx_t_3 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "cyext_acv.pyx":7376 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_cdp_weights(double[:, :] X, double[::1] y_X, double[::1] down, double[::1] up, double[:, :] data, double[::1] y_data, vector[vector[int]] S, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * int max_depth, int min_node_size, int & classifier, double[:, :] & t, double & pi): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1); + __Pyx_AddTraceback("cyext_acv.compute_cdp_weights", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_buffer); + __PYX_XDEC_MEMVIEW(&__pyx_v_partition_byobs, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_weights, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_9cyext_acv_123compute_cdp_weights(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_9cyext_acv_123compute_cdp_weights(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_down = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_up = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + std::vector > __pyx_v_S; + __Pyx_memviewslice __pyx_v_features = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_thresholds = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_left = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_right = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_max_depth; + int __pyx_v_min_node_size; + int __pyx_v_classifier; + __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } }; + double __pyx_v_pi; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("compute_cdp_weights (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_y_X,&__pyx_n_s_down,&__pyx_n_s_up,&__pyx_n_s_data,&__pyx_n_s_y_data,&__pyx_n_s_S,&__pyx_n_s_features,&__pyx_n_s_thresholds,&__pyx_n_s_children_left,&__pyx_n_s_children_right,&__pyx_n_s_max_depth,&__pyx_n_s_min_node_size,&__pyx_n_s_classifier,&__pyx_n_s_t,&__pyx_n_s_pi,0}; + PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15); + CYTHON_FALLTHROUGH; + case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_X)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_weights", 1, 16, 16, 1); __PYX_ERR(0, 7376, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_down)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_weights", 1, 16, 16, 2); __PYX_ERR(0, 7376, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_up)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_weights", 1, 16, 16, 3); __PYX_ERR(0, 7376, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_weights", 1, 16, 16, 4); __PYX_ERR(0, 7376, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_weights", 1, 16, 16, 5); __PYX_ERR(0, 7376, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_S)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_weights", 1, 16, 16, 6); __PYX_ERR(0, 7376, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_features)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_weights", 1, 16, 16, 7); __PYX_ERR(0, 7376, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thresholds)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_weights", 1, 16, 16, 8); __PYX_ERR(0, 7376, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_left)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_weights", 1, 16, 16, 9); __PYX_ERR(0, 7376, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_weights", 1, 16, 16, 10); __PYX_ERR(0, 7376, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_weights", 1, 16, 16, 11); __PYX_ERR(0, 7376, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_node_size)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_weights", 1, 16, 16, 12); __PYX_ERR(0, 7376, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 13: + if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classifier)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_weights", 1, 16, 16, 13); __PYX_ERR(0, 7376, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 14: + if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_weights", 1, 16, 16, 14); __PYX_ERR(0, 7376, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 15: + if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pi)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_weights", 1, 16, 16, 15); __PYX_ERR(0, 7376, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_cdp_weights") < 0)) __PYX_ERR(0, 7376, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 16) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + values[15] = PyTuple_GET_ITEM(__pyx_args, 15); + } + __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 7376, __pyx_L3_error) + __pyx_v_y_X = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_X.memview)) __PYX_ERR(0, 7376, __pyx_L3_error) + __pyx_v_down = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_down.memview)) __PYX_ERR(0, 7376, __pyx_L3_error) + __pyx_v_up = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_up.memview)) __PYX_ERR(0, 7376, __pyx_L3_error) + __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 7376, __pyx_L3_error) + __pyx_v_y_data = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_data.memview)) __PYX_ERR(0, 7376, __pyx_L3_error) + __pyx_v_S = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_int_3e___(values[6]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 7376, __pyx_L3_error) + __pyx_v_features = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_features.memview)) __PYX_ERR(0, 7377, __pyx_L3_error) + __pyx_v_thresholds = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_thresholds.memview)) __PYX_ERR(0, 7377, __pyx_L3_error) + __pyx_v_children_left = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[9], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_left.memview)) __PYX_ERR(0, 7377, __pyx_L3_error) + __pyx_v_children_right = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[10], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_right.memview)) __PYX_ERR(0, 7377, __pyx_L3_error) + __pyx_v_max_depth = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7378, __pyx_L3_error) + __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7378, __pyx_L3_error) + __pyx_v_classifier = __Pyx_PyInt_As_int(values[13]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7378, __pyx_L3_error) + __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[14], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 7378, __pyx_L3_error) + __pyx_v_pi = __pyx_PyFloat_AsDouble(values[15]); if (unlikely((__pyx_v_pi == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 7378, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("compute_cdp_weights", 1, 16, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7376, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cyext_acv.compute_cdp_weights", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_9cyext_acv_122compute_cdp_weights(__pyx_self, __pyx_v_X, __pyx_v_y_X, __pyx_v_down, __pyx_v_up, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_v_pi); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9cyext_acv_122compute_cdp_weights(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_down, __Pyx_memviewslice __pyx_v_up, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t, double __pyx_v_pi) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_cdp_weights", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundLocalError("X"); __PYX_ERR(0, 7376, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_X.memview)) { __Pyx_RaiseUnboundLocalError("y_X"); __PYX_ERR(0, 7376, __pyx_L1_error) } + if (unlikely(!__pyx_v_down.memview)) { __Pyx_RaiseUnboundLocalError("down"); __PYX_ERR(0, 7376, __pyx_L1_error) } + if (unlikely(!__pyx_v_up.memview)) { __Pyx_RaiseUnboundLocalError("up"); __PYX_ERR(0, 7376, __pyx_L1_error) } + if (unlikely(!__pyx_v_data.memview)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 7376, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_data.memview)) { __Pyx_RaiseUnboundLocalError("y_data"); __PYX_ERR(0, 7376, __pyx_L1_error) } + if (unlikely(!__pyx_v_features.memview)) { __Pyx_RaiseUnboundLocalError("features"); __PYX_ERR(0, 7376, __pyx_L1_error) } + if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 7376, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 7376, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 7376, __pyx_L1_error) } + if (unlikely(!__pyx_v_t.memview)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 7376, __pyx_L1_error) } + __pyx_t_1 = __pyx_f_9cyext_acv_compute_cdp_weights(__pyx_v_X, __pyx_v_y_X, __pyx_v_down, __pyx_v_up, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_v_pi, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7376, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cyext_acv.compute_cdp_weights", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_down, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_up, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_features, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_thresholds, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_left, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_right, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_t, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cyext_acv.pyx":7400 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_cdp_weights_verbose(double[:, :] X, double[::1] y_X, double[::1] down, double[::1] up, double[:, :] data, double[::1] y_data, vector[vector[int]] S, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * int max_depth, int min_node_size, int & classifier, double[:, :] & t, double & pi): + */ + +static PyObject *__pyx_pw_9cyext_acv_125compute_cdp_weights_verbose(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_cdp_weights_verbose(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_down, __Pyx_memviewslice __pyx_v_up, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, CYTHON_UNUSED double &__pyx_v_pi, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_buffer = NULL; + __Pyx_memviewslice __pyx_v_partition_byobs = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_N; + __Pyx_memviewslice __pyx_v_sdp = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_weights = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_9; + PyObject *(*__pyx_t_10)(PyObject *); + int __pyx_t_11; + __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __Pyx_memviewslice __pyx_t_16 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_17 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_cdp_weights_verbose", 0); + + /* "cyext_acv.pyx":7404 + * int max_depth, int min_node_size, int & classifier, double[:, :] & t, double & pi): + * + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) # <<<<<<<<<<<<<< + * buffer[:, :, 0] = -1e+10 + * cdef double [:, :, :] partition_byobs = buffer + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7404, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ones); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7404, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7404, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_X.shape[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7404, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_X.shape[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7404, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7404, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_INCREF(__pyx_int_2); + __Pyx_GIVEREF(__pyx_int_2); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_2); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 7404, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7404, __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 = PyNumber_Multiply(__pyx_float_1e_10, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7404, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_buffer = __pyx_t_1; + __pyx_t_1 = 0; + + /* "cyext_acv.pyx":7405 + * + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + * buffer[:, :, 0] = -1e+10 # <<<<<<<<<<<<<< + * cdef double [:, :, :] partition_byobs = buffer + * + */ + if (unlikely(PyObject_SetItem(__pyx_v_buffer, __pyx_tuple__3, __pyx_float_neg_1e_10) < 0)) __PYX_ERR(0, 7405, __pyx_L1_error) + + /* "cyext_acv.pyx":7406 + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + * buffer[:, :, 0] = -1e+10 + * cdef double [:, :, :] partition_byobs = buffer # <<<<<<<<<<<<<< + * + * cdef int N = X.shape[0] + */ + __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_v_buffer, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 7406, __pyx_L1_error) + __pyx_v_partition_byobs = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "cyext_acv.pyx":7408 + * cdef double [:, :, :] partition_byobs = buffer + * + * cdef int N = X.shape[0] # <<<<<<<<<<<<<< + * cdef double[::1] sdp = np.zeros(N) + * cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + */ + __pyx_v_N = (__pyx_v_X.shape[0]); + + /* "cyext_acv.pyx":7409 + * + * cdef int N = X.shape[0] + * cdef double[::1] sdp = np.zeros(N) # <<<<<<<<<<<<<< + * cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + * cdef int i, j + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 7409, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp = __pyx_t_7; + __pyx_t_7.memview = NULL; + __pyx_t_7.data = NULL; + + /* "cyext_acv.pyx":7410 + * cdef int N = X.shape[0] + * cdef double[::1] sdp = np.zeros(N) + * cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) # <<<<<<<<<<<<<< + * cdef int i, j + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7410, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7410, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7410, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7410, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_data.shape[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7410, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7410, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __pyx_t_5 = 0; + __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_3) < 0) __PYX_ERR(0, 7410, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7410, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 7410, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_weights = __pyx_t_8; + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; + + /* "cyext_acv.pyx":7413 + * cdef int i, j + * + * for i in tqdm(range(N)): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_cdp_rule_weights(X[i], y_X[i], down[i], up[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_tqdm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0; + __pyx_t_10 = NULL; + } else { + __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 7413, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (likely(!__pyx_t_10)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 7413, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } else { + if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 7413, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } + } else { + __pyx_t_3 = __pyx_t_10(__pyx_t_1); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 7413, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7413, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_i = __pyx_t_11; + + /* "cyext_acv.pyx":7414 + * + * for i in tqdm(range(N)): + * sdp[i] = single_compute_cdp_rule_weights(X[i], y_X[i], down[i], up[i], data, y_data, S[i], # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i]) + */ + __pyx_t_12.data = __pyx_v_X.data; + __pyx_t_12.memview = __pyx_v_X.memview; + __PYX_INC_MEMVIEW(&__pyx_t_12, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_X.strides[0]; + __pyx_t_12.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_12.shape[0] = __pyx_v_X.shape[1]; +__pyx_t_12.strides[0] = __pyx_v_X.strides[1]; + __pyx_t_12.suboffsets[0] = -1; + +__pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_i; + __pyx_t_15 = __pyx_v_i; + + /* "cyext_acv.pyx":7416 + * sdp[i] = single_compute_cdp_rule_weights(X[i], y_X[i], down[i], up[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i]) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_16.data = __pyx_v_t.data; + __pyx_t_16.memview = __pyx_v_t.memview; + __PYX_INC_MEMVIEW(&__pyx_t_16, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_t.strides[0]; + __pyx_t_16.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_16.shape[0] = __pyx_v_t.shape[1]; +__pyx_t_16.strides[0] = __pyx_v_t.strides[1]; + __pyx_t_16.suboffsets[0] = -1; + +__pyx_t_8.data = __pyx_v_partition_byobs.data; + __pyx_t_8.memview = __pyx_v_partition_byobs.memview; + __PYX_INC_MEMVIEW(&__pyx_t_8, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_partition_byobs.strides[0]; + __pyx_t_8.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_8.shape[0] = __pyx_v_partition_byobs.shape[1]; +__pyx_t_8.strides[0] = __pyx_v_partition_byobs.strides[1]; + __pyx_t_8.suboffsets[0] = -1; + +__pyx_t_8.shape[1] = __pyx_v_partition_byobs.shape[2]; +__pyx_t_8.strides[1] = __pyx_v_partition_byobs.strides[2]; + __pyx_t_8.suboffsets[1] = -1; + +__pyx_t_17.data = __pyx_v_weights.data; + __pyx_t_17.memview = __pyx_v_weights.memview; + __PYX_INC_MEMVIEW(&__pyx_t_17, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_weights.strides[0]; + __pyx_t_17.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_17.shape[0] = __pyx_v_weights.shape[1]; +__pyx_t_17.strides[0] = __pyx_v_weights.strides[1]; + __pyx_t_17.suboffsets[0] = -1; + +__pyx_t_18 = __pyx_v_i; + + /* "cyext_acv.pyx":7414 + * + * for i in tqdm(range(N)): + * sdp[i] = single_compute_cdp_rule_weights(X[i], y_X[i], down[i], up[i], data, y_data, S[i], # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i]) + */ + *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_sdp.data) + __pyx_t_18)) )) = __pyx_f_9cyext_acv_single_compute_cdp_rule_weights(__pyx_t_12, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_13)) ))), (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_down.data) + __pyx_t_14)) ))), (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_up.data) + __pyx_t_15)) ))), __pyx_v_data, __pyx_v_y_data, (__pyx_v_S[__pyx_v_i]), __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_t_16, __pyx_t_8, __pyx_t_17); + __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1); + __pyx_t_12.memview = NULL; + __pyx_t_12.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1); + __pyx_t_16.memview = NULL; + __pyx_t_16.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1); + __pyx_t_17.memview = NULL; + __pyx_t_17.data = NULL; + + /* "cyext_acv.pyx":7413 + * cdef int i, j + * + * for i in tqdm(range(N)): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_cdp_rule_weights(X[i], y_X[i], down[i], up[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "cyext_acv.pyx":7419 + * + * + * return np.array(sdp), np.array(weights) # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7419, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7419, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_sdp, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7419, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7419, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7419, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7419, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_weights, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7419, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7419, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7419, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __pyx_t_1 = 0; + __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "cyext_acv.pyx":7400 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_cdp_weights_verbose(double[:, :] X, double[::1] y_X, double[::1] down, double[::1] up, double[:, :] data, double[::1] y_data, vector[vector[int]] S, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * int max_depth, int min_node_size, int & classifier, double[:, :] & t, double & pi): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1); + __Pyx_AddTraceback("cyext_acv.compute_cdp_weights_verbose", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_buffer); + __PYX_XDEC_MEMVIEW(&__pyx_v_partition_byobs, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_weights, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_9cyext_acv_125compute_cdp_weights_verbose(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_9cyext_acv_125compute_cdp_weights_verbose(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_down = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_up = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + std::vector > __pyx_v_S; + __Pyx_memviewslice __pyx_v_features = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_thresholds = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_left = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_right = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_max_depth; + int __pyx_v_min_node_size; + int __pyx_v_classifier; + __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } }; + double __pyx_v_pi; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("compute_cdp_weights_verbose (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_y_X,&__pyx_n_s_down,&__pyx_n_s_up,&__pyx_n_s_data,&__pyx_n_s_y_data,&__pyx_n_s_S,&__pyx_n_s_features,&__pyx_n_s_thresholds,&__pyx_n_s_children_left,&__pyx_n_s_children_right,&__pyx_n_s_max_depth,&__pyx_n_s_min_node_size,&__pyx_n_s_classifier,&__pyx_n_s_t,&__pyx_n_s_pi,0}; + PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15); + CYTHON_FALLTHROUGH; + case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + CYTHON_FALLTHROUGH; + case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_X)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_weights_verbose", 1, 16, 16, 1); __PYX_ERR(0, 7400, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_down)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_weights_verbose", 1, 16, 16, 2); __PYX_ERR(0, 7400, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_up)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_weights_verbose", 1, 16, 16, 3); __PYX_ERR(0, 7400, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_weights_verbose", 1, 16, 16, 4); __PYX_ERR(0, 7400, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_weights_verbose", 1, 16, 16, 5); __PYX_ERR(0, 7400, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_S)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_weights_verbose", 1, 16, 16, 6); __PYX_ERR(0, 7400, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_features)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_weights_verbose", 1, 16, 16, 7); __PYX_ERR(0, 7400, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thresholds)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_weights_verbose", 1, 16, 16, 8); __PYX_ERR(0, 7400, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_left)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_weights_verbose", 1, 16, 16, 9); __PYX_ERR(0, 7400, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_weights_verbose", 1, 16, 16, 10); __PYX_ERR(0, 7400, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_weights_verbose", 1, 16, 16, 11); __PYX_ERR(0, 7400, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_node_size)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_weights_verbose", 1, 16, 16, 12); __PYX_ERR(0, 7400, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 13: + if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classifier)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_weights_verbose", 1, 16, 16, 13); __PYX_ERR(0, 7400, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 14: + if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_weights_verbose", 1, 16, 16, 14); __PYX_ERR(0, 7400, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 15: + if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pi)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_weights_verbose", 1, 16, 16, 15); __PYX_ERR(0, 7400, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_cdp_weights_verbose") < 0)) __PYX_ERR(0, 7400, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 16) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + values[15] = PyTuple_GET_ITEM(__pyx_args, 15); + } + __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 7400, __pyx_L3_error) + __pyx_v_y_X = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_X.memview)) __PYX_ERR(0, 7400, __pyx_L3_error) + __pyx_v_down = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_down.memview)) __PYX_ERR(0, 7400, __pyx_L3_error) + __pyx_v_up = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_up.memview)) __PYX_ERR(0, 7400, __pyx_L3_error) + __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 7400, __pyx_L3_error) + __pyx_v_y_data = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_data.memview)) __PYX_ERR(0, 7400, __pyx_L3_error) + __pyx_v_S = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_int_3e___(values[6]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 7400, __pyx_L3_error) + __pyx_v_features = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_features.memview)) __PYX_ERR(0, 7401, __pyx_L3_error) + __pyx_v_thresholds = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_thresholds.memview)) __PYX_ERR(0, 7401, __pyx_L3_error) + __pyx_v_children_left = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[9], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_left.memview)) __PYX_ERR(0, 7401, __pyx_L3_error) + __pyx_v_children_right = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[10], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_right.memview)) __PYX_ERR(0, 7401, __pyx_L3_error) + __pyx_v_max_depth = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7402, __pyx_L3_error) + __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7402, __pyx_L3_error) + __pyx_v_classifier = __Pyx_PyInt_As_int(values[13]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7402, __pyx_L3_error) + __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[14], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 7402, __pyx_L3_error) + __pyx_v_pi = __pyx_PyFloat_AsDouble(values[15]); if (unlikely((__pyx_v_pi == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 7402, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("compute_cdp_weights_verbose", 1, 16, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7400, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cyext_acv.compute_cdp_weights_verbose", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_9cyext_acv_124compute_cdp_weights_verbose(__pyx_self, __pyx_v_X, __pyx_v_y_X, __pyx_v_down, __pyx_v_up, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_v_pi); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_9cyext_acv_124compute_cdp_weights_verbose(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_down, __Pyx_memviewslice __pyx_v_up, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t, double __pyx_v_pi) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_cdp_weights_verbose", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundLocalError("X"); __PYX_ERR(0, 7400, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_X.memview)) { __Pyx_RaiseUnboundLocalError("y_X"); __PYX_ERR(0, 7400, __pyx_L1_error) } + if (unlikely(!__pyx_v_down.memview)) { __Pyx_RaiseUnboundLocalError("down"); __PYX_ERR(0, 7400, __pyx_L1_error) } + if (unlikely(!__pyx_v_up.memview)) { __Pyx_RaiseUnboundLocalError("up"); __PYX_ERR(0, 7400, __pyx_L1_error) } + if (unlikely(!__pyx_v_data.memview)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 7400, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_data.memview)) { __Pyx_RaiseUnboundLocalError("y_data"); __PYX_ERR(0, 7400, __pyx_L1_error) } + if (unlikely(!__pyx_v_features.memview)) { __Pyx_RaiseUnboundLocalError("features"); __PYX_ERR(0, 7400, __pyx_L1_error) } + if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 7400, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 7400, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 7400, __pyx_L1_error) } + if (unlikely(!__pyx_v_t.memview)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 7400, __pyx_L1_error) } + __pyx_t_1 = __pyx_f_9cyext_acv_compute_cdp_weights_verbose(__pyx_v_X, __pyx_v_y_X, __pyx_v_down, __pyx_v_up, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_v_pi, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7400, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cyext_acv.compute_cdp_weights_verbose", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_down, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_up, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_features, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_thresholds, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_left, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_right, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_t, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cyext_acv.pyx":7425 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cdef double single_compute_cdp_intv_rule_weights(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, # <<<<<<<<<<<<<< + * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + * int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition, + */ + +static double __pyx_f_9cyext_acv_single_compute_cdp_intv_rule_weights(CYTHON_UNUSED __Pyx_memviewslice &__pyx_v_x, double &__pyx_v_y_x, __Pyx_memviewslice &__pyx_v_data, __Pyx_memviewslice &__pyx_v_y_data, std::vector &__pyx_v_S, __Pyx_memviewslice &__pyx_v_features, __Pyx_memviewslice &__pyx_v_thresholds, __Pyx_memviewslice &__pyx_v_children_left, __Pyx_memviewslice &__pyx_v_children_right, int &__pyx_v_max_depth, int &__pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, __Pyx_memviewslice &__pyx_v_partition, __Pyx_memviewslice &__pyx_v_w, __Pyx_memviewslice &__pyx_v_cond) { + unsigned int __pyx_v_n_trees; + unsigned int __pyx_v_N; + double __pyx_v_sdp; + int __pyx_v_b; + CYTHON_UNUSED int __pyx_v_level; + int __pyx_v_i; + int __pyx_v_it_node; + std::set __pyx_v_nodes_level; + std::set __pyx_v_nodes_child; + std::set __pyx_v_in_data; + std::set __pyx_v_in_data_b; + std::set ::iterator __pyx_v_it; + std::set ::iterator __pyx_v_it_point; + double __pyx_r; + unsigned int __pyx_t_1; + unsigned int __pyx_t_2; + int __pyx_t_3; + unsigned int __pyx_t_4; + unsigned int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "cyext_acv.pyx":7430 + * double[:] & w, const double[:, :] & cond) nogil: + * + * cdef unsigned int n_trees = features.shape[0] # <<<<<<<<<<<<<< + * cdef unsigned int N = data.shape[0] + * cdef double s, sdp + */ + __pyx_v_n_trees = (__pyx_v_features.shape[0]); + + /* "cyext_acv.pyx":7431 + * + * cdef unsigned int n_trees = features.shape[0] + * cdef unsigned int N = data.shape[0] # <<<<<<<<<<<<<< + * cdef double s, sdp + * cdef int o + */ + __pyx_v_N = (__pyx_v_data.shape[0]); + + /* "cyext_acv.pyx":7434 + * cdef double s, sdp + * cdef int o + * sdp = 0 # <<<<<<<<<<<<<< + * + * cdef int b, level, i, it_node + */ + __pyx_v_sdp = 0.0; + + /* "cyext_acv.pyx":7440 + * cdef set[int].iterator it, it_point + * + * for b in range(n_trees): # <<<<<<<<<<<<<< + * nodes_child.clear() + * nodes_level.clear() + */ + __pyx_t_1 = __pyx_v_n_trees; + __pyx_t_2 = __pyx_t_1; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_b = __pyx_t_3; + + /* "cyext_acv.pyx":7441 + * + * for b in range(n_trees): + * nodes_child.clear() # <<<<<<<<<<<<<< + * nodes_level.clear() + * nodes_level.insert(0) + */ + __pyx_v_nodes_child.clear(); + + /* "cyext_acv.pyx":7442 + * for b in range(n_trees): + * nodes_child.clear() + * nodes_level.clear() # <<<<<<<<<<<<<< + * nodes_level.insert(0) + * + */ + __pyx_v_nodes_level.clear(); + + /* "cyext_acv.pyx":7443 + * nodes_child.clear() + * nodes_level.clear() + * nodes_level.insert(0) # <<<<<<<<<<<<<< + * + * in_data.clear() + */ + try { + __pyx_v_nodes_level.insert(0); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 7443, __pyx_L1_error) + } + + /* "cyext_acv.pyx":7445 + * nodes_level.insert(0) + * + * in_data.clear() # <<<<<<<<<<<<<< + * in_data_b.clear() + * for i in range(N): + */ + __pyx_v_in_data.clear(); + + /* "cyext_acv.pyx":7446 + * + * in_data.clear() + * in_data_b.clear() # <<<<<<<<<<<<<< + * for i in range(N): + * in_data.insert(i) + */ + __pyx_v_in_data_b.clear(); + + /* "cyext_acv.pyx":7447 + * in_data.clear() + * in_data_b.clear() + * for i in range(N): # <<<<<<<<<<<<<< + * in_data.insert(i) + * in_data_b.insert(i) + */ + __pyx_t_4 = __pyx_v_N; + __pyx_t_5 = __pyx_t_4; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "cyext_acv.pyx":7448 + * in_data_b.clear() + * for i in range(N): + * in_data.insert(i) # <<<<<<<<<<<<<< + * in_data_b.insert(i) + * + */ + try { + __pyx_v_in_data.insert(__pyx_v_i); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 7448, __pyx_L1_error) + } + + /* "cyext_acv.pyx":7449 + * for i in range(N): + * in_data.insert(i) + * in_data_b.insert(i) # <<<<<<<<<<<<<< + * + * for level in range(max_depth): + */ + try { + __pyx_v_in_data_b.insert(__pyx_v_i); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 7449, __pyx_L1_error) + } + } + + /* "cyext_acv.pyx":7451 + * in_data_b.insert(i) + * + * for level in range(max_depth): # <<<<<<<<<<<<<< + * it_point = nodes_level.begin() + * while(it_point != nodes_level.end()): + */ + __pyx_t_6 = __pyx_v_max_depth; + __pyx_t_7 = __pyx_t_6; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_level = __pyx_t_8; + + /* "cyext_acv.pyx":7452 + * + * for level in range(max_depth): + * it_point = nodes_level.begin() # <<<<<<<<<<<<<< + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) + */ + __pyx_v_it_point = __pyx_v_nodes_level.begin(); + + /* "cyext_acv.pyx":7453 + * for level in range(max_depth): + * it_point = nodes_level.begin() + * while(it_point != nodes_level.end()): # <<<<<<<<<<<<<< + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it_point != __pyx_v_nodes_level.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":7454 + * it_point = nodes_level.begin() + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) # <<<<<<<<<<<<<< + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * nodes_child.insert(children_left[b, it_node]) + */ + __pyx_v_it_node = (*__pyx_v_it_point); + + /* "cyext_acv.pyx":7455 + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * nodes_child.insert(children_right[b, it_node]) + */ + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_9 = ((std::find ::iterator,int>(__pyx_v_S.begin(), __pyx_v_S.end(), (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_10 * __pyx_v_features.strides[0]) ) + __pyx_t_11 * __pyx_v_features.strides[1]) )))) != __pyx_v_S.end()) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":7456 + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * nodes_child.insert(children_left[b, it_node]) # <<<<<<<<<<<<<< + * nodes_child.insert(children_right[b, it_node]) + * + */ + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_left.data + __pyx_t_11 * __pyx_v_children_left.strides[0]) ) + __pyx_t_10 * __pyx_v_children_left.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 7456, __pyx_L1_error) + } + + /* "cyext_acv.pyx":7457 + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + * nodes_child.insert(children_left[b, it_node]) + * nodes_child.insert(children_right[b, it_node]) # <<<<<<<<<<<<<< + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] <= thresholds[b, it_node]: + */ + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_right.data + __pyx_t_10 * __pyx_v_children_right.strides[0]) ) + __pyx_t_11 * __pyx_v_children_right.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 7457, __pyx_L1_error) + } + + /* "cyext_acv.pyx":7455 + * while(it_point != nodes_level.end()): + * it_node = deref(it_point) + * if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * nodes_child.insert(children_right[b, it_node]) + */ + goto __pyx_L11; + } + + /* "cyext_acv.pyx":7459 + * nodes_child.insert(children_right[b, it_node]) + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * + */ + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_12 = (((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_11 * __pyx_v_features.strides[0]) ) + __pyx_t_10 * __pyx_v_features.strides[1]) ))) >= 0) != 0); + if (__pyx_t_12) { + } else { + __pyx_t_9 = __pyx_t_12; + goto __pyx_L12_bool_binop_done; + } + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_13 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_10 * __pyx_v_features.strides[0]) ) + __pyx_t_11 * __pyx_v_features.strides[1]) ))); + __pyx_t_14 = 1; + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = __pyx_v_it_node; + __pyx_t_12 = (((*((double const *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_cond.data + __pyx_t_13 * __pyx_v_cond.strides[0]) ) + __pyx_t_14 * __pyx_v_cond.strides[1]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_15 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_16 * __pyx_v_thresholds.strides[1]) )))) != 0); + __pyx_t_9 = __pyx_t_12; + __pyx_L12_bool_binop_done:; + if (__pyx_t_9) { + + /* "cyext_acv.pyx":7460 + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) # <<<<<<<<<<<<<< + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + */ + __pyx_t_16 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_left.data + __pyx_t_16 * __pyx_v_children_left.strides[0]) ) + __pyx_t_15 * __pyx_v_children_left.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 7460, __pyx_L1_error) + } + + /* "cyext_acv.pyx":7462 + * nodes_child.insert(children_left[b, it_node]) + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 1] = thresholds[b, it_node] + * + */ + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = __pyx_v_it_node; + __pyx_t_11 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_15 * __pyx_v_features.strides[0]) ) + __pyx_t_16 * __pyx_v_features.strides[1]) ))); + __pyx_t_10 = 1; + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_11 * __pyx_v_partition.strides[0]) ) + __pyx_t_10 * __pyx_v_partition.strides[1]) ))) >= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_14 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_13 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":7463 + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + * partition[features[b, it_node], 1] = thresholds[b, it_node] # <<<<<<<<<<<<<< + * + * it = in_data.begin() + */ + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + __pyx_t_16 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_10 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_16 * __pyx_v_features.strides[0]) ) + __pyx_t_15 * __pyx_v_features.strides[1]) ))); + __pyx_t_11 = 1; + *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_10 * __pyx_v_partition.strides[0]) ) + __pyx_t_11 * __pyx_v_partition.strides[1]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_13 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_14 * __pyx_v_thresholds.strides[1]) ))); + + /* "cyext_acv.pyx":7462 + * nodes_child.insert(children_left[b, it_node]) + * + * if partition[features[b, it_node], 1] >= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 1] = thresholds[b, it_node] + * + */ + } + + /* "cyext_acv.pyx":7465 + * partition[features[b, it_node], 1] = thresholds[b, it_node] + * + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + */ + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":7466 + * + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":7467 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_15 = (*__pyx_v_it); + __pyx_t_16 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_14 * __pyx_v_features.strides[0]) ) + __pyx_t_13 * __pyx_v_features.strides[1]) ))); + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_data.data + __pyx_t_15 * __pyx_v_data.strides[0]) ) + __pyx_t_16 * __pyx_v_data.strides[1]) ))) > (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_11 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_10 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":7468 + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) # <<<<<<<<<<<<<< + * inc(it) + * in_data = in_data_b + */ + (void)(__pyx_v_in_data_b.erase((*__pyx_v_it))); + + /* "cyext_acv.pyx":7467 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + } + + /* "cyext_acv.pyx":7469 + * if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + * inc(it) # <<<<<<<<<<<<<< + * in_data = in_data_b + * + */ + (void)((++__pyx_v_it)); + } + + /* "cyext_acv.pyx":7470 + * in_data_b.erase(deref(it)) + * inc(it) + * in_data = in_data_b # <<<<<<<<<<<<<< + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 0] > thresholds[b, it_node]: + */ + __pyx_v_in_data = __pyx_v_in_data_b; + + /* "cyext_acv.pyx":7459 + * nodes_child.insert(children_right[b, it_node]) + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * + */ + goto __pyx_L11; + } + + /* "cyext_acv.pyx":7472 + * in_data = in_data_b + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 0] > thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_right[b, it_node]) + * + */ + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_12 = (((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_10 * __pyx_v_features.strides[0]) ) + __pyx_t_11 * __pyx_v_features.strides[1]) ))) >= 0) != 0); + if (__pyx_t_12) { + } else { + __pyx_t_9 = __pyx_t_12; + goto __pyx_L18_bool_binop_done; + } + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_13 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_11 * __pyx_v_features.strides[0]) ) + __pyx_t_10 * __pyx_v_features.strides[1]) ))); + __pyx_t_14 = 0; + __pyx_t_16 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_12 = (((*((double const *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_cond.data + __pyx_t_13 * __pyx_v_cond.strides[0]) ) + __pyx_t_14 * __pyx_v_cond.strides[1]) ))) > (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_16 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_15 * __pyx_v_thresholds.strides[1]) )))) != 0); + __pyx_t_9 = __pyx_t_12; + __pyx_L18_bool_binop_done:; + if (__pyx_t_9) { + + /* "cyext_acv.pyx":7473 + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 0] > thresholds[b, it_node]: + * nodes_child.insert(children_right[b, it_node]) # <<<<<<<<<<<<<< + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: + */ + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_right.data + __pyx_t_15 * __pyx_v_children_right.strides[0]) ) + __pyx_t_16 * __pyx_v_children_right.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 7473, __pyx_L1_error) + } + + /* "cyext_acv.pyx":7475 + * nodes_child.insert(children_right[b, it_node]) + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 0] = thresholds[b, it_node] + * + */ + __pyx_t_16 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_10 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_16 * __pyx_v_features.strides[0]) ) + __pyx_t_15 * __pyx_v_features.strides[1]) ))); + __pyx_t_11 = 0; + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_10 * __pyx_v_partition.strides[0]) ) + __pyx_t_11 * __pyx_v_partition.strides[1]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_14 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_13 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":7476 + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: + * partition[features[b, it_node], 0] = thresholds[b, it_node] # <<<<<<<<<<<<<< + * + * it = in_data.begin() + */ + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = __pyx_v_it_node; + __pyx_t_11 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_15 * __pyx_v_features.strides[0]) ) + __pyx_t_16 * __pyx_v_features.strides[1]) ))); + __pyx_t_10 = 0; + *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_partition.data + __pyx_t_11 * __pyx_v_partition.strides[0]) ) + __pyx_t_10 * __pyx_v_partition.strides[1]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_13 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_14 * __pyx_v_thresholds.strides[1]) ))); + + /* "cyext_acv.pyx":7475 + * nodes_child.insert(children_right[b, it_node]) + * + * if partition[features[b, it_node], 0] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * partition[features[b, it_node], 0] = thresholds[b, it_node] + * + */ + } + + /* "cyext_acv.pyx":7478 + * partition[features[b, it_node], 0] = thresholds[b, it_node] + * + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + */ + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":7479 + * + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":7480 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_16 = (*__pyx_v_it); + __pyx_t_15 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_14 * __pyx_v_features.strides[0]) ) + __pyx_t_13 * __pyx_v_features.strides[1]) ))); + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_9 = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_data.data + __pyx_t_16 * __pyx_v_data.strides[0]) ) + __pyx_t_15 * __pyx_v_data.strides[1]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_10 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_11 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":7481 + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) # <<<<<<<<<<<<<< + * inc(it) + * in_data = in_data_b + */ + (void)(__pyx_v_in_data_b.erase((*__pyx_v_it))); + + /* "cyext_acv.pyx":7480 + * it = in_data.begin() + * while(it != in_data.end()): + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * in_data_b.erase(deref(it)) + * inc(it) + */ + } + + /* "cyext_acv.pyx":7482 + * if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + * in_data_b.erase(deref(it)) + * inc(it) # <<<<<<<<<<<<<< + * in_data = in_data_b + * + */ + (void)((++__pyx_v_it)); + } + + /* "cyext_acv.pyx":7483 + * in_data_b.erase(deref(it)) + * inc(it) + * in_data = in_data_b # <<<<<<<<<<<<<< + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] >= thresholds[b, it_node] and cond[features[b, it_node], 0] <= thresholds[b, it_node]: + */ + __pyx_v_in_data = __pyx_v_in_data_b; + + /* "cyext_acv.pyx":7472 + * in_data = in_data_b + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 0] > thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_right[b, it_node]) + * + */ + goto __pyx_L11; + } + + /* "cyext_acv.pyx":7485 + * in_data = in_data_b + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] >= thresholds[b, it_node] and cond[features[b, it_node], 0] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * nodes_child.insert(children_right[b, it_node]) + */ + __pyx_t_11 = __pyx_v_b; + __pyx_t_10 = __pyx_v_it_node; + __pyx_t_12 = (((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_11 * __pyx_v_features.strides[0]) ) + __pyx_t_10 * __pyx_v_features.strides[1]) ))) >= 0) != 0); + if (__pyx_t_12) { + } else { + __pyx_t_9 = __pyx_t_12; + goto __pyx_L24_bool_binop_done; + } + __pyx_t_10 = __pyx_v_b; + __pyx_t_11 = __pyx_v_it_node; + __pyx_t_13 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_10 * __pyx_v_features.strides[0]) ) + __pyx_t_11 * __pyx_v_features.strides[1]) ))); + __pyx_t_14 = 1; + __pyx_t_15 = __pyx_v_b; + __pyx_t_16 = __pyx_v_it_node; + __pyx_t_12 = (((*((double const *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_cond.data + __pyx_t_13 * __pyx_v_cond.strides[0]) ) + __pyx_t_14 * __pyx_v_cond.strides[1]) ))) >= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_15 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_16 * __pyx_v_thresholds.strides[1]) )))) != 0); + if (__pyx_t_12) { + } else { + __pyx_t_9 = __pyx_t_12; + goto __pyx_L24_bool_binop_done; + } + __pyx_t_16 = __pyx_v_b; + __pyx_t_15 = __pyx_v_it_node; + __pyx_t_11 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_features.data + __pyx_t_16 * __pyx_v_features.strides[0]) ) + __pyx_t_15 * __pyx_v_features.strides[1]) ))); + __pyx_t_10 = 0; + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + __pyx_t_12 = (((*((double const *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_cond.data + __pyx_t_11 * __pyx_v_cond.strides[0]) ) + __pyx_t_10 * __pyx_v_cond.strides[1]) ))) <= (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_thresholds.data + __pyx_t_14 * __pyx_v_thresholds.strides[0]) ) + __pyx_t_13 * __pyx_v_thresholds.strides[1]) )))) != 0); + __pyx_t_9 = __pyx_t_12; + __pyx_L24_bool_binop_done:; + if (__pyx_t_9) { + + /* "cyext_acv.pyx":7486 + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] >= thresholds[b, it_node] and cond[features[b, it_node], 0] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) # <<<<<<<<<<<<<< + * nodes_child.insert(children_right[b, it_node]) + * + */ + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_left.data + __pyx_t_13 * __pyx_v_children_left.strides[0]) ) + __pyx_t_14 * __pyx_v_children_left.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 7486, __pyx_L1_error) + } + + /* "cyext_acv.pyx":7487 + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] >= thresholds[b, it_node] and cond[features[b, it_node], 0] <= thresholds[b, it_node]: + * nodes_child.insert(children_left[b, it_node]) + * nodes_child.insert(children_right[b, it_node]) # <<<<<<<<<<<<<< + * + * # if partition[features[b, it_node], 0] <= thresholds[b, it_node]: # TO DO: compute correctly the partition in this case + */ + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_right.data + __pyx_t_14 * __pyx_v_children_right.strides[0]) ) + __pyx_t_13 * __pyx_v_children_right.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 7487, __pyx_L1_error) + } + + /* "cyext_acv.pyx":7485 + * in_data = in_data_b + * + * elif features[b, it_node] >=0 and cond[features[b, it_node], 1] >= thresholds[b, it_node] and cond[features[b, it_node], 0] <= thresholds[b, it_node]: # <<<<<<<<<<<<<< + * nodes_child.insert(children_left[b, it_node]) + * nodes_child.insert(children_right[b, it_node]) + */ + goto __pyx_L11; + } + + /* "cyext_acv.pyx":7503 + * + * else: + * nodes_child.insert(children_left[b, it_node]) # <<<<<<<<<<<<<< + * nodes_child.insert(children_right[b, it_node]) + * + */ + /*else*/ { + __pyx_t_13 = __pyx_v_b; + __pyx_t_14 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_left.data + __pyx_t_13 * __pyx_v_children_left.strides[0]) ) + __pyx_t_14 * __pyx_v_children_left.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 7503, __pyx_L1_error) + } + + /* "cyext_acv.pyx":7504 + * else: + * nodes_child.insert(children_left[b, it_node]) + * nodes_child.insert(children_right[b, it_node]) # <<<<<<<<<<<<<< + * + * if in_data.size() < min_node_size: + */ + __pyx_t_14 = __pyx_v_b; + __pyx_t_13 = __pyx_v_it_node; + try { + __pyx_v_nodes_child.insert((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_children_right.data + __pyx_t_14 * __pyx_v_children_right.strides[0]) ) + __pyx_t_13 * __pyx_v_children_right.strides[1]) )))); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 7504, __pyx_L1_error) + } + } + __pyx_L11:; + + /* "cyext_acv.pyx":7506 + * nodes_child.insert(children_right[b, it_node]) + * + * if in_data.size() < min_node_size: # <<<<<<<<<<<<<< + * break + * inc(it_point) + */ + __pyx_t_9 = ((__pyx_v_in_data.size() < __pyx_v_min_node_size) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":7507 + * + * if in_data.size() < min_node_size: + * break # <<<<<<<<<<<<<< + * inc(it_point) + * + */ + goto __pyx_L10_break; + + /* "cyext_acv.pyx":7506 + * nodes_child.insert(children_right[b, it_node]) + * + * if in_data.size() < min_node_size: # <<<<<<<<<<<<<< + * break + * inc(it_point) + */ + } + + /* "cyext_acv.pyx":7508 + * if in_data.size() < min_node_size: + * break + * inc(it_point) # <<<<<<<<<<<<<< + * + * nodes_level = nodes_child + */ + (void)((++__pyx_v_it_point)); + } + __pyx_L10_break:; + + /* "cyext_acv.pyx":7510 + * inc(it_point) + * + * nodes_level = nodes_child # <<<<<<<<<<<<<< + * + * if classifier == 1: + */ + __pyx_v_nodes_level = __pyx_v_nodes_child; + } + + /* "cyext_acv.pyx":7512 + * nodes_level = nodes_child + * + * if classifier == 1: # <<<<<<<<<<<<<< + * it = in_data.begin() + * while(it != in_data.end()): + */ + __pyx_t_9 = ((__pyx_v_classifier == 1) != 0); + if (__pyx_t_9) { + + /* "cyext_acv.pyx":7513 + * + * if classifier == 1: + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) + */ + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":7514 + * if classifier == 1: + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) + * w[deref(it)] += (1./(n_trees*in_data.size())) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":7515 + * it = in_data.begin() + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) # <<<<<<<<<<<<<< + * w[deref(it)] += (1./(n_trees*in_data.size())) + * inc(it) + */ + __pyx_t_13 = (*__pyx_v_it); + __pyx_v_sdp = (__pyx_v_sdp + ((1. / (__pyx_v_n_trees * __pyx_v_in_data.size())) * (__pyx_v_y_x != (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_13)) )))))); + + /* "cyext_acv.pyx":7516 + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) + * w[deref(it)] += (1./(n_trees*in_data.size())) # <<<<<<<<<<<<<< + * inc(it) + * else: + */ + __pyx_t_13 = (*__pyx_v_it); + *((double *) ( /* dim=0 */ (__pyx_v_w.data + __pyx_t_13 * __pyx_v_w.strides[0]) )) += (1. / (__pyx_v_n_trees * __pyx_v_in_data.size())); + + /* "cyext_acv.pyx":7517 + * sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) + * w[deref(it)] += (1./(n_trees*in_data.size())) + * inc(it) # <<<<<<<<<<<<<< + * else: + * it = in_data.begin() + */ + (void)((++__pyx_v_it)); + } + + /* "cyext_acv.pyx":7512 + * nodes_level = nodes_child + * + * if classifier == 1: # <<<<<<<<<<<<<< + * it = in_data.begin() + * while(it != in_data.end()): + */ + goto __pyx_L28; + } + + /* "cyext_acv.pyx":7519 + * inc(it) + * else: + * it = in_data.begin() # <<<<<<<<<<<<<< + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * ((t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) + */ + /*else*/ { + __pyx_v_it = __pyx_v_in_data.begin(); + + /* "cyext_acv.pyx":7520 + * else: + * it = in_data.begin() + * while(it != in_data.end()): # <<<<<<<<<<<<<< + * sdp += (1./(n_trees*in_data.size())) * ((t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) + * w[deref(it)] += (1./(n_trees*in_data.size())) + */ + while (1) { + __pyx_t_9 = ((__pyx_v_it != __pyx_v_in_data.end()) != 0); + if (!__pyx_t_9) break; + + /* "cyext_acv.pyx":7521 + * it = in_data.begin() + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * ((t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) # <<<<<<<<<<<<<< + * w[deref(it)] += (1./(n_trees*in_data.size())) + * inc(it) + */ + __pyx_t_13 = 0; + __pyx_t_14 = (*__pyx_v_it); + __pyx_t_15 = (*__pyx_v_it); + __pyx_t_16 = 1; + __pyx_v_sdp = (__pyx_v_sdp + ((1. / (__pyx_v_n_trees * __pyx_v_in_data.size())) * (((*((double *) ( /* dim=0 */ (__pyx_v_t.data + __pyx_t_13 * __pyx_v_t.strides[0]) ))) <= (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_14)) )))) * ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_data.data) + __pyx_t_15)) ))) <= (*((double *) ( /* dim=0 */ (__pyx_v_t.data + __pyx_t_16 * __pyx_v_t.strides[0]) ))))))); + + /* "cyext_acv.pyx":7522 + * while(it != in_data.end()): + * sdp += (1./(n_trees*in_data.size())) * ((t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) + * w[deref(it)] += (1./(n_trees*in_data.size())) # <<<<<<<<<<<<<< + * inc(it) + * + */ + __pyx_t_16 = (*__pyx_v_it); + *((double *) ( /* dim=0 */ (__pyx_v_w.data + __pyx_t_16 * __pyx_v_w.strides[0]) )) += (1. / (__pyx_v_n_trees * __pyx_v_in_data.size())); + + /* "cyext_acv.pyx":7523 + * sdp += (1./(n_trees*in_data.size())) * ((t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) + * w[deref(it)] += (1./(n_trees*in_data.size())) + * inc(it) # <<<<<<<<<<<<<< + * + * return sdp + */ + (void)((++__pyx_v_it)); + } + } + __pyx_L28:; + } + + /* "cyext_acv.pyx":7525 + * inc(it) + * + * return sdp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_sdp; + goto __pyx_L0; + + /* "cyext_acv.pyx":7425 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cdef double single_compute_cdp_intv_rule_weights(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, # <<<<<<<<<<<<<< + * int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + * int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("cyext_acv.single_compute_cdp_intv_rule_weights", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_r = 0; + __pyx_L0:; + return __pyx_r; +} + +/* "cyext_acv.pyx":7532 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_cdp_intv_weights(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * const double [:, :, :] & cond, + */ + +static PyObject *__pyx_pw_9cyext_acv_127compute_cdp_intv_weights(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_cdp_intv_weights(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, __Pyx_memviewslice &__pyx_v_cond, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_buffer = NULL; + __Pyx_memviewslice __pyx_v_partition_byobs = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_N; + __Pyx_memviewslice __pyx_v_sdp = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_weights = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_13; + __Pyx_memviewslice __pyx_t_14 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_15 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_16 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_cdp_intv_weights", 0); + + /* "cyext_acv.pyx":7537 + * int max_depth, int min_node_size, int & classifier, double[:, :] & t): + * + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) # <<<<<<<<<<<<<< + * buffer[:, :, 0] = -1e+10 + * cdef double [:, :, :] partition_byobs = buffer + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ones); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_X.shape[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_X.shape[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_INCREF(__pyx_int_2); + __Pyx_GIVEREF(__pyx_int_2); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_2); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 7537, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7537, __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 = PyNumber_Multiply(__pyx_float_1e_10, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_buffer = __pyx_t_1; + __pyx_t_1 = 0; + + /* "cyext_acv.pyx":7538 + * + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + * buffer[:, :, 0] = -1e+10 # <<<<<<<<<<<<<< + * cdef double [:, :, :] partition_byobs = buffer + * + */ + if (unlikely(PyObject_SetItem(__pyx_v_buffer, __pyx_tuple__3, __pyx_float_neg_1e_10) < 0)) __PYX_ERR(0, 7538, __pyx_L1_error) + + /* "cyext_acv.pyx":7539 + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + * buffer[:, :, 0] = -1e+10 + * cdef double [:, :, :] partition_byobs = buffer # <<<<<<<<<<<<<< + * + * cdef int N = X.shape[0] + */ + __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_v_buffer, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 7539, __pyx_L1_error) + __pyx_v_partition_byobs = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "cyext_acv.pyx":7541 + * cdef double [:, :, :] partition_byobs = buffer + * + * cdef int N = X.shape[0] # <<<<<<<<<<<<<< + * cdef double[::1] sdp = np.zeros(N) + * cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + */ + __pyx_v_N = (__pyx_v_X.shape[0]); + + /* "cyext_acv.pyx":7542 + * + * cdef int N = X.shape[0] + * cdef double[::1] sdp = np.zeros(N) # <<<<<<<<<<<<<< + * cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + * cdef int i, j + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 7542, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp = __pyx_t_7; + __pyx_t_7.memview = NULL; + __pyx_t_7.data = NULL; + + /* "cyext_acv.pyx":7543 + * cdef int N = X.shape[0] + * cdef double[::1] sdp = np.zeros(N) + * cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) # <<<<<<<<<<<<<< + * cdef int i, j + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_data.shape[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __pyx_t_5 = 0; + __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_3) < 0) __PYX_ERR(0, 7543, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 7543, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_weights = __pyx_t_8; + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; - /* "cyext_acv.pyx":5607 - * sdp_ba = compute_sdp_rf_same_set(X_arr[np.array(in_data, dtype=bool)], - * y_X_arr[np.array(in_data, dtype=bool)], - * data, y_data, S[:S_size], features, thresholds, children_left, # <<<<<<<<<<<<<< - * children_right, max_depth, min_node_size, classifier, t) + /* "cyext_acv.pyx":7546 + * cdef int i, j * + * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_cdp_intv_rule_weights(X[i], y_X[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, */ - __pyx_t_3 = __pyx_convert_vector_to_py_int(__pyx_v_S); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5607, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_3, 0, __pyx_v_S_size, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5607, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __pyx_convert_vector_from_py_int(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5607, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + __pyx_t_9 = __pyx_v_N; + if ((1 == 0)) abort(); + { + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) (x) + #define unlikely(x) (x) + #endif + __pyx_t_11 = (__pyx_t_9 - 0 + 1 - 1/abs(1)) / 1; + if (__pyx_t_11 > 0) + { + #ifdef _OPENMP + #pragma omp parallel private(__pyx_t_13, __pyx_t_17) firstprivate(__pyx_t_12, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_8) + #endif /* _OPENMP */ + { + #ifdef _OPENMP + #pragma omp for firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) schedule(dynamic) + #endif /* _OPENMP */ + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_11; __pyx_t_10++){ + { + __pyx_v_i = (int)(0 + 1 * __pyx_t_10); - /* "cyext_acv.pyx":5605 - * # max_depth, min_node_size, classifier, t) + /* "cyext_acv.pyx":7547 * - * sdp_ba = compute_sdp_rf_same_set(X_arr[np.array(in_data, dtype=bool)], # <<<<<<<<<<<<<< - * y_X_arr[np.array(in_data, dtype=bool)], - * data, y_data, S[:S_size], features, thresholds, children_left, + * for i in prange(N, nogil=True, schedule='dynamic'): + * sdp[i] = single_compute_cdp_intv_rule_weights(X[i], y_X[i], data, y_data, S[i], # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i], cond[i]) */ - __pyx_t_1 = __pyx_f_9cyext_acv_compute_sdp_rf_same_set(__pyx_t_34, __pyx_t_35, __pyx_v_data, __pyx_v_y_data, __pyx_t_7, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5605, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __PYX_XDEC_MEMVIEW(&__pyx_t_34, 1); - __pyx_t_34.memview = NULL; - __pyx_t_34.data = NULL; - __PYX_XDEC_MEMVIEW(&__pyx_t_35, 1); - __pyx_t_35.memview = NULL; - __pyx_t_35.data = NULL; - __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 5605, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_XDEC_MEMVIEW(&__pyx_v_sdp_ba, 1); - __pyx_v_sdp_ba = __pyx_t_5; - __pyx_t_5.memview = NULL; - __pyx_t_5.data = NULL; + __pyx_t_12.data = __pyx_v_X.data; + __pyx_t_12.memview = __pyx_v_X.memview; + __PYX_INC_MEMVIEW(&__pyx_t_12, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_X.strides[0]; + __pyx_t_12.data += __pyx_tmp_idx * __pyx_tmp_stride; +} - /* "cyext_acv.pyx":5610 - * children_right, max_depth, min_node_size, classifier, t) - * - * for i in range(N): # <<<<<<<<<<<<<< - * sdp_b[R_buf[i]] = sdp_ba[i] - * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: - */ - __pyx_t_8 = __pyx_v_N; - __pyx_t_9 = __pyx_t_8; - for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_9; __pyx_t_22+=1) { - __pyx_v_i = __pyx_t_22; +__pyx_t_12.shape[0] = __pyx_v_X.shape[1]; +__pyx_t_12.strides[0] = __pyx_v_X.strides[1]; + __pyx_t_12.suboffsets[0] = -1; - /* "cyext_acv.pyx":5611 +__pyx_t_13 = __pyx_v_i; + + /* "cyext_acv.pyx":7549 + * sdp[i] = single_compute_cdp_intv_rule_weights(X[i], y_X[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i], cond[i]) # <<<<<<<<<<<<<< * - * for i in range(N): - * sdp_b[R_buf[i]] = sdp_ba[i] # <<<<<<<<<<<<<< - * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: - * sdp[R_buf[i]] = sdp_b[R_buf[i]] + * return np.array(sdp), np.array(weights) */ - __pyx_t_32 = __pyx_v_i; - __pyx_t_33 = __pyx_v_i; - __pyx_t_36 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_33 * __pyx_v_R_buf.strides[0]) ))); - *((double *) ( /* dim=0 */ (__pyx_v_sdp_b.data + __pyx_t_36 * __pyx_v_sdp_b.strides[0]) )) = (*((double *) ( /* dim=0 */ (__pyx_v_sdp_ba.data + __pyx_t_32 * __pyx_v_sdp_ba.strides[0]) ))); + __pyx_t_14.data = __pyx_v_t.data; + __pyx_t_14.memview = __pyx_v_t.memview; + __PYX_INC_MEMVIEW(&__pyx_t_14, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_t.strides[0]; + __pyx_t_14.data += __pyx_tmp_idx * __pyx_tmp_stride; +} - /* "cyext_acv.pyx":5612 - * for i in range(N): - * sdp_b[R_buf[i]] = sdp_ba[i] - * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: # <<<<<<<<<<<<<< - * sdp[R_buf[i]] = sdp_b[R_buf[i]] - * len_s_star[R_buf[i]] = S_size - */ - __pyx_t_32 = __pyx_v_i; - __pyx_t_33 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_32 * __pyx_v_R_buf.strides[0]) ))); - __pyx_t_36 = __pyx_v_i; - __pyx_t_37 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_36 * __pyx_v_R_buf.strides[0]) ))); - __pyx_t_12 = (((*((double *) ( /* dim=0 */ (__pyx_v_sdp_b.data + __pyx_t_33 * __pyx_v_sdp_b.strides[0]) ))) >= (*((double *) ( /* dim=0 */ (__pyx_v_sdp.data + __pyx_t_37 * __pyx_v_sdp.strides[0]) )))) != 0); - if (__pyx_t_12) { +__pyx_t_14.shape[0] = __pyx_v_t.shape[1]; +__pyx_t_14.strides[0] = __pyx_v_t.strides[1]; + __pyx_t_14.suboffsets[0] = -1; - /* "cyext_acv.pyx":5613 - * sdp_b[R_buf[i]] = sdp_ba[i] - * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: - * sdp[R_buf[i]] = sdp_b[R_buf[i]] # <<<<<<<<<<<<<< - * len_s_star[R_buf[i]] = S_size - * for s in range(S_size): - */ - __pyx_t_36 = __pyx_v_i; - __pyx_t_37 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_36 * __pyx_v_R_buf.strides[0]) ))); - __pyx_t_32 = __pyx_v_i; - __pyx_t_33 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_32 * __pyx_v_R_buf.strides[0]) ))); - *((double *) ( /* dim=0 */ (__pyx_v_sdp.data + __pyx_t_33 * __pyx_v_sdp.strides[0]) )) = (*((double *) ( /* dim=0 */ (__pyx_v_sdp_b.data + __pyx_t_37 * __pyx_v_sdp_b.strides[0]) ))); +__pyx_t_8.data = __pyx_v_partition_byobs.data; + __pyx_t_8.memview = __pyx_v_partition_byobs.memview; + __PYX_INC_MEMVIEW(&__pyx_t_8, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_partition_byobs.strides[0]; + __pyx_t_8.data += __pyx_tmp_idx * __pyx_tmp_stride; +} - /* "cyext_acv.pyx":5614 - * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: - * sdp[R_buf[i]] = sdp_b[R_buf[i]] - * len_s_star[R_buf[i]] = S_size # <<<<<<<<<<<<<< - * for s in range(S_size): - * s_star[R_buf[i], s] = S[s] - */ - __pyx_t_36 = __pyx_v_i; - (__pyx_v_len_s_star[(*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_36 * __pyx_v_R_buf.strides[0]) )))]) = __pyx_v_S_size; +__pyx_t_8.shape[0] = __pyx_v_partition_byobs.shape[1]; +__pyx_t_8.strides[0] = __pyx_v_partition_byobs.strides[1]; + __pyx_t_8.suboffsets[0] = -1; - /* "cyext_acv.pyx":5615 - * sdp[R_buf[i]] = sdp_b[R_buf[i]] - * len_s_star[R_buf[i]] = S_size - * for s in range(S_size): # <<<<<<<<<<<<<< - * s_star[R_buf[i], s] = S[s] - * - */ - __pyx_t_38 = __pyx_v_S_size; - __pyx_t_39 = __pyx_t_38; - for (__pyx_t_40 = 0; __pyx_t_40 < __pyx_t_39; __pyx_t_40+=1) { - __pyx_v_s = __pyx_t_40; +__pyx_t_8.shape[1] = __pyx_v_partition_byobs.shape[2]; +__pyx_t_8.strides[1] = __pyx_v_partition_byobs.strides[2]; + __pyx_t_8.suboffsets[1] = -1; - /* "cyext_acv.pyx":5616 - * len_s_star[R_buf[i]] = S_size - * for s in range(S_size): - * s_star[R_buf[i], s] = S[s] # <<<<<<<<<<<<<< - * - * if S_size == X.shape[1]: - */ - __pyx_t_36 = __pyx_v_i; - __pyx_t_37 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_36 * __pyx_v_R_buf.strides[0]) ))); - __pyx_t_32 = __pyx_v_s; - *((long *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_s_star.data + __pyx_t_37 * __pyx_v_s_star.strides[0]) ) + __pyx_t_32 * __pyx_v_s_star.strides[1]) )) = (__pyx_v_S[__pyx_v_s]); - } +__pyx_t_15.data = __pyx_v_weights.data; + __pyx_t_15.memview = __pyx_v_weights.memview; + __PYX_INC_MEMVIEW(&__pyx_t_15, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_weights.strides[0]; + __pyx_t_15.data += __pyx_tmp_idx * __pyx_tmp_stride; +} - /* "cyext_acv.pyx":5612 - * for i in range(N): - * sdp_b[R_buf[i]] = sdp_ba[i] - * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: # <<<<<<<<<<<<<< - * sdp[R_buf[i]] = sdp_b[R_buf[i]] - * len_s_star[R_buf[i]] = S_size - */ +__pyx_t_15.shape[0] = __pyx_v_weights.shape[1]; +__pyx_t_15.strides[0] = __pyx_v_weights.strides[1]; + __pyx_t_15.suboffsets[0] = -1; + +__pyx_t_16.data = __pyx_v_cond.data; + __pyx_t_16.memview = __pyx_v_cond.memview; + __PYX_INC_MEMVIEW(&__pyx_t_16, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_cond.strides[0]; + __pyx_t_16.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_16.shape[0] = __pyx_v_cond.shape[1]; +__pyx_t_16.strides[0] = __pyx_v_cond.strides[1]; + __pyx_t_16.suboffsets[0] = -1; + +__pyx_t_16.shape[1] = __pyx_v_cond.shape[2]; +__pyx_t_16.strides[1] = __pyx_v_cond.strides[2]; + __pyx_t_16.suboffsets[1] = -1; + +__pyx_t_17 = __pyx_v_i; + + /* "cyext_acv.pyx":7547 + * + * for i in prange(N, nogil=True, schedule='dynamic'): + * sdp[i] = single_compute_cdp_intv_rule_weights(X[i], y_X[i], data, y_data, S[i], # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i], cond[i]) + */ + *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_sdp.data) + __pyx_t_17)) )) = __pyx_f_9cyext_acv_single_compute_cdp_intv_rule_weights(__pyx_t_12, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_13)) ))), __pyx_v_data, __pyx_v_y_data, (__pyx_v_S[__pyx_v_i]), __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_t_14, __pyx_t_8, __pyx_t_15, __pyx_t_16); + __PYX_XDEC_MEMVIEW(&__pyx_t_12, 0); + __pyx_t_12.memview = NULL; + __pyx_t_12.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_14, 0); + __pyx_t_14.memview = NULL; + __pyx_t_14.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_8, 0); + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_15, 0); + __pyx_t_15.memview = NULL; + __pyx_t_15.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_16, 0); + __pyx_t_16.memview = NULL; + __pyx_t_16.data = NULL; + } + } + } + } } + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #endif + } - /* "cyext_acv.pyx":5618 - * s_star[R_buf[i], s] = S[s] + /* "cyext_acv.pyx":7546 + * cdef int i, j * - * if S_size == X.shape[1]: # <<<<<<<<<<<<<< - * sdp[R_buf[i]] = 1 - * len_s_star[R_buf[i]] = S_size + * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_cdp_intv_rule_weights(X[i], y_X[i], data, y_data, S[i], + * features, thresholds, children_left, children_right, */ - __pyx_t_12 = ((__pyx_v_S_size == (__pyx_v_X.shape[1])) != 0); - if (__pyx_t_12) { + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } - /* "cyext_acv.pyx":5619 + /* "cyext_acv.pyx":7551 + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i], cond[i]) + * + * return np.array(sdp), np.array(weights) # <<<<<<<<<<<<<< + * * - * if S_size == X.shape[1]: - * sdp[R_buf[i]] = 1 # <<<<<<<<<<<<<< - * len_s_star[R_buf[i]] = S_size - * for s in range(S_size): */ - __pyx_t_36 = __pyx_v_i; - __pyx_t_32 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_36 * __pyx_v_R_buf.strides[0]) ))); - *((double *) ( /* dim=0 */ (__pyx_v_sdp.data + __pyx_t_32 * __pyx_v_sdp.strides[0]) )) = 1.0; + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7551, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7551, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_sdp, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7551, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7551, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7551, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7551, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_weights, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7551, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7551, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7551, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __pyx_t_3 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; - /* "cyext_acv.pyx":5620 - * if S_size == X.shape[1]: - * sdp[R_buf[i]] = 1 - * len_s_star[R_buf[i]] = S_size # <<<<<<<<<<<<<< - * for s in range(S_size): - * s_star[R_buf[i], s] = S[s] + /* "cyext_acv.pyx":7532 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_cdp_intv_weights(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * const double [:, :, :] & cond, */ - __pyx_t_36 = __pyx_v_i; - (__pyx_v_len_s_star[(*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_36 * __pyx_v_R_buf.strides[0]) )))]) = __pyx_v_S_size; - /* "cyext_acv.pyx":5621 - * sdp[R_buf[i]] = 1 - * len_s_star[R_buf[i]] = S_size - * for s in range(S_size): # <<<<<<<<<<<<<< - * s_star[R_buf[i], s] = S[s] - * for s in range(len_s_star[R_buf[i]], X.shape[1]): # to filter (important for coalition) - */ - __pyx_t_38 = __pyx_v_S_size; - __pyx_t_39 = __pyx_t_38; - for (__pyx_t_40 = 0; __pyx_t_40 < __pyx_t_39; __pyx_t_40+=1) { - __pyx_v_s = __pyx_t_40; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_15, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1); + __Pyx_AddTraceback("cyext_acv.compute_cdp_intv_weights", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_buffer); + __PYX_XDEC_MEMVIEW(&__pyx_v_partition_byobs, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_weights, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "cyext_acv.pyx":5622 - * len_s_star[R_buf[i]] = S_size - * for s in range(S_size): - * s_star[R_buf[i], s] = S[s] # <<<<<<<<<<<<<< - * for s in range(len_s_star[R_buf[i]], X.shape[1]): # to filter (important for coalition) - * s_star[R_buf[i], s] = -1 - */ - __pyx_t_36 = __pyx_v_i; - __pyx_t_32 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_36 * __pyx_v_R_buf.strides[0]) ))); - __pyx_t_37 = __pyx_v_s; - *((long *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_s_star.data + __pyx_t_32 * __pyx_v_s_star.strides[0]) ) + __pyx_t_37 * __pyx_v_s_star.strides[1]) )) = (__pyx_v_S[__pyx_v_s]); - } +/* Python wrapper */ +static PyObject *__pyx_pw_9cyext_acv_127compute_cdp_intv_weights(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_9cyext_acv_127compute_cdp_intv_weights(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_X = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_y_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + std::vector > __pyx_v_S; + __Pyx_memviewslice __pyx_v_features = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_thresholds = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_left = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_children_right = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_cond = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_max_depth; + int __pyx_v_min_node_size; + int __pyx_v_classifier; + __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("compute_cdp_intv_weights (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_y_X,&__pyx_n_s_data,&__pyx_n_s_y_data,&__pyx_n_s_S,&__pyx_n_s_features,&__pyx_n_s_thresholds,&__pyx_n_s_children_left,&__pyx_n_s_children_right,&__pyx_n_s_cond,&__pyx_n_s_max_depth,&__pyx_n_s_min_node_size,&__pyx_n_s_classifier,&__pyx_n_s_t,0}; + PyObject* values[14] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + CYTHON_FALLTHROUGH; + case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + CYTHON_FALLTHROUGH; + case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + CYTHON_FALLTHROUGH; + case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + CYTHON_FALLTHROUGH; + case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_X)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_intv_weights", 1, 14, 14, 1); __PYX_ERR(0, 7532, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_intv_weights", 1, 14, 14, 2); __PYX_ERR(0, 7532, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_intv_weights", 1, 14, 14, 3); __PYX_ERR(0, 7532, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_S)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_intv_weights", 1, 14, 14, 4); __PYX_ERR(0, 7532, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_features)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_intv_weights", 1, 14, 14, 5); __PYX_ERR(0, 7532, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thresholds)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_intv_weights", 1, 14, 14, 6); __PYX_ERR(0, 7532, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_left)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_intv_weights", 1, 14, 14, 7); __PYX_ERR(0, 7532, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_right)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_intv_weights", 1, 14, 14, 8); __PYX_ERR(0, 7532, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_intv_weights", 1, 14, 14, 9); __PYX_ERR(0, 7532, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 10: + if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_intv_weights", 1, 14, 14, 10); __PYX_ERR(0, 7532, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 11: + if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_node_size)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_intv_weights", 1, 14, 14, 11); __PYX_ERR(0, 7532, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 12: + if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classifier)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_intv_weights", 1, 14, 14, 12); __PYX_ERR(0, 7532, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 13: + if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("compute_cdp_intv_weights", 1, 14, 14, 13); __PYX_ERR(0, 7532, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_cdp_intv_weights") < 0)) __PYX_ERR(0, 7532, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 14) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + values[8] = PyTuple_GET_ITEM(__pyx_args, 8); + values[9] = PyTuple_GET_ITEM(__pyx_args, 9); + values[10] = PyTuple_GET_ITEM(__pyx_args, 10); + values[11] = PyTuple_GET_ITEM(__pyx_args, 11); + values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + } + __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 7532, __pyx_L3_error) + __pyx_v_y_X = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_X.memview)) __PYX_ERR(0, 7532, __pyx_L3_error) + __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 7532, __pyx_L3_error) + __pyx_v_y_data = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_data.memview)) __PYX_ERR(0, 7532, __pyx_L3_error) + __pyx_v_S = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_int_3e___(values[4]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 7532, __pyx_L3_error) + __pyx_v_features = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_features.memview)) __PYX_ERR(0, 7533, __pyx_L3_error) + __pyx_v_thresholds = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_thresholds.memview)) __PYX_ERR(0, 7533, __pyx_L3_error) + __pyx_v_children_left = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_left.memview)) __PYX_ERR(0, 7533, __pyx_L3_error) + __pyx_v_children_right = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_right.memview)) __PYX_ERR(0, 7533, __pyx_L3_error) + __pyx_v_cond = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double__const__(values[9], 0); if (unlikely(!__pyx_v_cond.memview)) __PYX_ERR(0, 7534, __pyx_L3_error) + __pyx_v_max_depth = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7535, __pyx_L3_error) + __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7535, __pyx_L3_error) + __pyx_v_classifier = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7535, __pyx_L3_error) + __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[13], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 7535, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("compute_cdp_intv_weights", 1, 14, 14, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7532, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cyext_acv.compute_cdp_intv_weights", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_9cyext_acv_126compute_cdp_intv_weights(__pyx_self, __pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_cond, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t); - /* "cyext_acv.pyx":5623 - * for s in range(S_size): - * s_star[R_buf[i], s] = S[s] - * for s in range(len_s_star[R_buf[i]], X.shape[1]): # to filter (important for coalition) # <<<<<<<<<<<<<< - * s_star[R_buf[i], s] = -1 - * - */ - __pyx_t_14 = (__pyx_v_X.shape[1]); - __pyx_t_36 = __pyx_v_i; - __pyx_t_15 = __pyx_t_14; - for (__pyx_t_38 = (__pyx_v_len_s_star[(*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_36 * __pyx_v_R_buf.strides[0]) )))]); __pyx_t_38 < __pyx_t_15; __pyx_t_38+=1) { - __pyx_v_s = __pyx_t_38; + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "cyext_acv.pyx":5624 - * s_star[R_buf[i], s] = S[s] - * for s in range(len_s_star[R_buf[i]], X.shape[1]): # to filter (important for coalition) - * s_star[R_buf[i], s] = -1 # <<<<<<<<<<<<<< - * - * for i in range(N): - */ - __pyx_t_37 = __pyx_v_i; - __pyx_t_32 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_37 * __pyx_v_R_buf.strides[0]) ))); - __pyx_t_33 = __pyx_v_s; - *((long *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_s_star.data + __pyx_t_32 * __pyx_v_s_star.strides[0]) ) + __pyx_t_33 * __pyx_v_s_star.strides[1]) )) = -1L; - } +static PyObject *__pyx_pf_9cyext_acv_126compute_cdp_intv_weights(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector > __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, __Pyx_memviewslice __pyx_v_cond, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_cdp_intv_weights", 0); + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundLocalError("X"); __PYX_ERR(0, 7532, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_X.memview)) { __Pyx_RaiseUnboundLocalError("y_X"); __PYX_ERR(0, 7532, __pyx_L1_error) } + if (unlikely(!__pyx_v_data.memview)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 7532, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_data.memview)) { __Pyx_RaiseUnboundLocalError("y_data"); __PYX_ERR(0, 7532, __pyx_L1_error) } + if (unlikely(!__pyx_v_features.memview)) { __Pyx_RaiseUnboundLocalError("features"); __PYX_ERR(0, 7532, __pyx_L1_error) } + if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 7532, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 7532, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 7532, __pyx_L1_error) } + if (unlikely(!__pyx_v_cond.memview)) { __Pyx_RaiseUnboundLocalError("cond"); __PYX_ERR(0, 7532, __pyx_L1_error) } + if (unlikely(!__pyx_v_t.memview)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 7532, __pyx_L1_error) } + __pyx_t_1 = __pyx_f_9cyext_acv_compute_cdp_intv_weights(__pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_cond, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7532, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cyext_acv.compute_cdp_intv_weights", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_X, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_y_data, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_features, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_thresholds, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_left, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_children_right, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_cond, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_t, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "cyext_acv.pyx":5618 - * s_star[R_buf[i], s] = S[s] - * - * if S_size == X.shape[1]: # <<<<<<<<<<<<<< - * sdp[R_buf[i]] = 1 - * len_s_star[R_buf[i]] = S_size +/* "cyext_acv.pyx":7558 + * @cython.nonecheck(False) + * @cython.cdivision(True) + * cpdef compute_cdp_intv_same_set(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[int] S, # <<<<<<<<<<<<<< + * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + * const double [:, :, :] & cond, */ - } - } - } - /* "cyext_acv.pyx":5626 - * s_star[R_buf[i], s] = -1 - * - * for i in range(N): # <<<<<<<<<<<<<< - * if sdp[R_buf[i]] >= pi_level: - * r.push_back(R[i]) - */ - __pyx_t_8 = __pyx_v_N; - __pyx_t_9 = __pyx_t_8; - for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { - __pyx_v_i = __pyx_t_10; +static PyObject *__pyx_pw_9cyext_acv_129compute_cdp_intv_same_set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_compute_cdp_intv_same_set(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, __Pyx_memviewslice &__pyx_v_cond, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_buffer = NULL; + __Pyx_memviewslice __pyx_v_partition_byobs = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_N; + __Pyx_memviewslice __pyx_v_sdp = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_weights = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_13; + __Pyx_memviewslice __pyx_t_14 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_15 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_16 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("compute_cdp_intv_same_set", 0); - /* "cyext_acv.pyx":5627 + /* "cyext_acv.pyx":7563 + * int max_depth, int min_node_size, int & classifier, double[:, :] & t): * - * for i in range(N): - * if sdp[R_buf[i]] >= pi_level: # <<<<<<<<<<<<<< - * r.push_back(R[i]) - * for s in range(len_s_star[R_buf[i]]): + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) # <<<<<<<<<<<<<< + * buffer[:, :, 0] = -1e+10 + * cdef double [:, :, :] partition_byobs = buffer */ - __pyx_t_36 = __pyx_v_i; - __pyx_t_37 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_36 * __pyx_v_R_buf.strides[0]) ))); - __pyx_t_12 = (((*((double *) ( /* dim=0 */ (__pyx_v_sdp.data + __pyx_t_37 * __pyx_v_sdp.strides[0]) ))) >= __pyx_v_pi_level) != 0); - if (__pyx_t_12) { + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ones); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_X.shape[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_X.shape[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_INCREF(__pyx_int_2); + __Pyx_GIVEREF(__pyx_int_2); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_2); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 7563, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7563, __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 = PyNumber_Multiply(__pyx_float_1e_10, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_buffer = __pyx_t_1; + __pyx_t_1 = 0; - /* "cyext_acv.pyx":5628 - * for i in range(N): - * if sdp[R_buf[i]] >= pi_level: - * r.push_back(R[i]) # <<<<<<<<<<<<<< - * for s in range(len_s_star[R_buf[i]]): - * sdp_global[s_star[R_buf[i], s]] += 1 + /* "cyext_acv.pyx":7564 + * + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + * buffer[:, :, 0] = -1e+10 # <<<<<<<<<<<<<< + * cdef double [:, :, :] partition_byobs = buffer + * */ - try { - __pyx_v_r.push_back((__pyx_v_R[__pyx_v_i])); - } catch(...) { - __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 5628, __pyx_L1_error) - } + if (unlikely(PyObject_SetItem(__pyx_v_buffer, __pyx_tuple__3, __pyx_float_neg_1e_10) < 0)) __PYX_ERR(0, 7564, __pyx_L1_error) - /* "cyext_acv.pyx":5629 - * if sdp[R_buf[i]] >= pi_level: - * r.push_back(R[i]) - * for s in range(len_s_star[R_buf[i]]): # <<<<<<<<<<<<<< - * sdp_global[s_star[R_buf[i], s]] += 1 + /* "cyext_acv.pyx":7565 + * buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + * buffer[:, :, 0] = -1e+10 + * cdef double [:, :, :] partition_byobs = buffer # <<<<<<<<<<<<<< * + * cdef int N = X.shape[0] */ - __pyx_t_36 = __pyx_v_i; - __pyx_t_22 = (__pyx_v_len_s_star[(*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_36 * __pyx_v_R_buf.strides[0]) )))]); - __pyx_t_38 = __pyx_t_22; - for (__pyx_t_39 = 0; __pyx_t_39 < __pyx_t_38; __pyx_t_39+=1) { - __pyx_v_s = __pyx_t_39; + __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_v_buffer, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 7565, __pyx_L1_error) + __pyx_v_partition_byobs = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; - /* "cyext_acv.pyx":5630 - * r.push_back(R[i]) - * for s in range(len_s_star[R_buf[i]]): - * sdp_global[s_star[R_buf[i], s]] += 1 # <<<<<<<<<<<<<< + /* "cyext_acv.pyx":7567 + * cdef double [:, :, :] partition_byobs = buffer * - * for i in range(r.size()): + * cdef int N = X.shape[0] # <<<<<<<<<<<<<< + * cdef double[::1] sdp = np.zeros(N) + * cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) */ - __pyx_t_36 = __pyx_v_i; - __pyx_t_37 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_36 * __pyx_v_R_buf.strides[0]) ))); - __pyx_t_33 = __pyx_v_s; - __pyx_t_32 = (*((long *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_s_star.data + __pyx_t_37 * __pyx_v_s_star.strides[0]) ) + __pyx_t_33 * __pyx_v_s_star.strides[1]) ))); - *((double *) ( /* dim=0 */ (__pyx_v_sdp_global.data + __pyx_t_32 * __pyx_v_sdp_global.strides[0]) )) += 1.0; - } + __pyx_v_N = (__pyx_v_X.shape[0]); - /* "cyext_acv.pyx":5627 + /* "cyext_acv.pyx":7568 * - * for i in range(N): - * if sdp[R_buf[i]] >= pi_level: # <<<<<<<<<<<<<< - * r.push_back(R[i]) - * for s in range(len_s_star[R_buf[i]]): + * cdef int N = X.shape[0] + * cdef double[::1] sdp = np.zeros(N) # <<<<<<<<<<<<<< + * cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + * cdef int i, j */ - } + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7568, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7568, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7568, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7568, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 7568, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp = __pyx_t_7; + __pyx_t_7.memview = NULL; + __pyx_t_7.data = NULL; - /* "cyext_acv.pyx":5632 - * sdp_global[s_star[R_buf[i], s]] += 1 + /* "cyext_acv.pyx":7569 + * cdef int N = X.shape[0] + * cdef double[::1] sdp = np.zeros(N) + * cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) # <<<<<<<<<<<<<< + * cdef int i, j * - * for i in range(r.size()): # <<<<<<<<<<<<<< - * std_remove[vector[long].iterator, long](R.begin(), R.end(), r[i]) - * R.pop_back() */ - __pyx_t_30 = __pyx_v_r.size(); - __pyx_t_31 = __pyx_t_30; - for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_31; __pyx_t_10+=1) { - __pyx_v_i = __pyx_t_10; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_data.shape[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __pyx_t_5 = 0; + __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_3) < 0) __PYX_ERR(0, 7569, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 7569, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_weights = __pyx_t_8; + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; - /* "cyext_acv.pyx":5633 - * - * for i in range(r.size()): - * std_remove[vector[long].iterator, long](R.begin(), R.end(), r[i]) # <<<<<<<<<<<<<< - * R.pop_back() + /* "cyext_acv.pyx":7572 + * cdef int i, j * + * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_cdp_intv_rule_weights(X[i], y_X[i], data, y_data, S, + * features, thresholds, children_left, children_right, */ - (void)(std::remove ::iterator,long>(__pyx_v_R.begin(), __pyx_v_R.end(), (__pyx_v_r[__pyx_v_i]))); + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + __pyx_t_9 = __pyx_v_N; + if ((1 == 0)) abort(); + { + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) (x) + #define unlikely(x) (x) + #endif + __pyx_t_11 = (__pyx_t_9 - 0 + 1 - 1/abs(1)) / 1; + if (__pyx_t_11 > 0) + { + #ifdef _OPENMP + #pragma omp parallel private(__pyx_t_13, __pyx_t_17) firstprivate(__pyx_t_12, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_8) + #endif /* _OPENMP */ + { + #ifdef _OPENMP + #pragma omp for firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) schedule(dynamic) + #endif /* _OPENMP */ + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_11; __pyx_t_10++){ + { + __pyx_v_i = (int)(0 + 1 * __pyx_t_10); - /* "cyext_acv.pyx":5634 - * for i in range(r.size()): - * std_remove[vector[long].iterator, long](R.begin(), R.end(), r[i]) - * R.pop_back() # <<<<<<<<<<<<<< + /* "cyext_acv.pyx":7573 * - * if (R.size() == 0 or S_size >= X.shape[1]/2) and stop: + * for i in prange(N, nogil=True, schedule='dynamic'): + * sdp[i] = single_compute_cdp_intv_rule_weights(X[i], y_X[i], data, y_data, S, # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i], cond[i]) */ - __pyx_v_R.pop_back(); - } + __pyx_t_12.data = __pyx_v_X.data; + __pyx_t_12.memview = __pyx_v_X.memview; + __PYX_INC_MEMVIEW(&__pyx_t_12, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_X.strides[0]; + __pyx_t_12.data += __pyx_tmp_idx * __pyx_tmp_stride; +} - /* "cyext_acv.pyx":5636 - * R.pop_back() - * - * if (R.size() == 0 or S_size >= X.shape[1]/2) and stop: # <<<<<<<<<<<<<< - * break - * - */ - __pyx_t_19 = ((__pyx_v_R.size() == 0) != 0); - if (!__pyx_t_19) { - } else { - goto __pyx_L53_next_and; - } - __pyx_t_19 = ((__pyx_v_S_size >= ((__pyx_v_X.shape[1]) / 2)) != 0); - if (__pyx_t_19) { - } else { - __pyx_t_12 = __pyx_t_19; - goto __pyx_L52_bool_binop_done; - } - __pyx_L53_next_and:; - __pyx_t_19 = (__pyx_v_stop != 0); - __pyx_t_12 = __pyx_t_19; - __pyx_L52_bool_binop_done:; - if (__pyx_t_12) { +__pyx_t_12.shape[0] = __pyx_v_X.shape[1]; +__pyx_t_12.strides[0] = __pyx_v_X.strides[1]; + __pyx_t_12.suboffsets[0] = -1; - /* "cyext_acv.pyx":5637 - * - * if (R.size() == 0 or S_size >= X.shape[1]/2) and stop: - * break # <<<<<<<<<<<<<< +__pyx_t_13 = __pyx_v_i; + + /* "cyext_acv.pyx":7575 + * sdp[i] = single_compute_cdp_intv_rule_weights(X[i], y_X[i], data, y_data, S, + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i], cond[i]) # <<<<<<<<<<<<<< * - * return np.asarray(sdp_global)/X.shape[0], np.array(s_star, dtype=np.long), np.array(len_s_star, dtype=np.long), np.array(sdp) + * return np.array(sdp) */ - goto __pyx_L27_break; + __pyx_t_14.data = __pyx_v_t.data; + __pyx_t_14.memview = __pyx_v_t.memview; + __PYX_INC_MEMVIEW(&__pyx_t_14, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_t.strides[0]; + __pyx_t_14.data += __pyx_tmp_idx * __pyx_tmp_stride; +} - /* "cyext_acv.pyx":5636 - * R.pop_back() - * - * if (R.size() == 0 or S_size >= X.shape[1]/2) and stop: # <<<<<<<<<<<<<< - * break +__pyx_t_14.shape[0] = __pyx_v_t.shape[1]; +__pyx_t_14.strides[0] = __pyx_v_t.strides[1]; + __pyx_t_14.suboffsets[0] = -1; + +__pyx_t_8.data = __pyx_v_partition_byobs.data; + __pyx_t_8.memview = __pyx_v_partition_byobs.memview; + __PYX_INC_MEMVIEW(&__pyx_t_8, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_partition_byobs.strides[0]; + __pyx_t_8.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_8.shape[0] = __pyx_v_partition_byobs.shape[1]; +__pyx_t_8.strides[0] = __pyx_v_partition_byobs.strides[1]; + __pyx_t_8.suboffsets[0] = -1; + +__pyx_t_8.shape[1] = __pyx_v_partition_byobs.shape[2]; +__pyx_t_8.strides[1] = __pyx_v_partition_byobs.strides[2]; + __pyx_t_8.suboffsets[1] = -1; + +__pyx_t_15.data = __pyx_v_weights.data; + __pyx_t_15.memview = __pyx_v_weights.memview; + __PYX_INC_MEMVIEW(&__pyx_t_15, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_weights.strides[0]; + __pyx_t_15.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_15.shape[0] = __pyx_v_weights.shape[1]; +__pyx_t_15.strides[0] = __pyx_v_weights.strides[1]; + __pyx_t_15.suboffsets[0] = -1; + +__pyx_t_16.data = __pyx_v_cond.data; + __pyx_t_16.memview = __pyx_v_cond.memview; + __PYX_INC_MEMVIEW(&__pyx_t_16, 0); + { + Py_ssize_t __pyx_tmp_idx = __pyx_v_i; + Py_ssize_t __pyx_tmp_stride = __pyx_v_cond.strides[0]; + __pyx_t_16.data += __pyx_tmp_idx * __pyx_tmp_stride; +} + +__pyx_t_16.shape[0] = __pyx_v_cond.shape[1]; +__pyx_t_16.strides[0] = __pyx_v_cond.strides[1]; + __pyx_t_16.suboffsets[0] = -1; + +__pyx_t_16.shape[1] = __pyx_v_cond.shape[2]; +__pyx_t_16.strides[1] = __pyx_v_cond.strides[2]; + __pyx_t_16.suboffsets[1] = -1; + +__pyx_t_17 = __pyx_v_i; + + /* "cyext_acv.pyx":7573 * - */ - } + * for i in prange(N, nogil=True, schedule='dynamic'): + * sdp[i] = single_compute_cdp_intv_rule_weights(X[i], y_X[i], data, y_data, S, # <<<<<<<<<<<<<< + * features, thresholds, children_left, children_right, + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i], cond[i]) + */ + *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_sdp.data) + __pyx_t_17)) )) = __pyx_f_9cyext_acv_single_compute_cdp_intv_rule_weights(__pyx_t_12, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_X.data) + __pyx_t_13)) ))), __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_t_14, __pyx_t_8, __pyx_t_15, __pyx_t_16); + __PYX_XDEC_MEMVIEW(&__pyx_t_12, 0); + __pyx_t_12.memview = NULL; + __pyx_t_12.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_14, 0); + __pyx_t_14.memview = NULL; + __pyx_t_14.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_8, 0); + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_15, 0); + __pyx_t_15.memview = NULL; + __pyx_t_15.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_16, 0); + __pyx_t_16.memview = NULL; + __pyx_t_16.data = NULL; + } + } + } + } + } + #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) + #undef likely + #undef unlikely + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #endif + } - /* "cyext_acv.pyx":5588 - * S = np.zeros((data.shape[1]), dtype=np.int) + /* "cyext_acv.pyx":7572 + * cdef int i, j * - * for s_0 in tqdm(range(minimal, m + 1)): # <<<<<<<<<<<<<< - * for s_1 in range(0, power_cpp[s_0].size()): - * for i in range(power_cpp[s_0][s_1].size()): + * for i in prange(N, nogil=True, schedule='dynamic'): # <<<<<<<<<<<<<< + * sdp[i] = single_compute_cdp_intv_rule_weights(X[i], y_X[i], data, y_data, S, + * features, thresholds, children_left, children_right, */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } } - __pyx_L27_break:; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "cyext_acv.pyx":5639 - * break + /* "cyext_acv.pyx":7577 + * max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i], cond[i]) * - * return np.asarray(sdp_global)/X.shape[0], np.array(s_star, dtype=np.long), np.array(len_s_star, dtype=np.long), np.array(sdp) # <<<<<<<<<<<<<< + * return np.array(sdp) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5639, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_sdp_global, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5639, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_sdp, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_24 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_24 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_24)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_24); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_2, function); } } - __pyx_t_4 = (__pyx_t_24) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_24, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); - __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_X.shape[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_s_star, 2, (PyObject *(*)(char *)) __pyx_memview_get_long, (int (*)(char *, PyObject *)) __pyx_memview_set_long, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_24 = PyTuple_New(1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 5639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_24); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_long); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 5639, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_24, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 5639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_24); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_convert_vector_to_py_int(__pyx_v_len_s_star); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5639, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_41 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_long); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 5639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_41); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_41) < 0) __PYX_ERR(0, 5639, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0; - __pyx_t_41 = __Pyx_PyObject_Call(__pyx_t_24, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 5639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_41); - __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 5639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_24); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_sdp, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_24))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_24); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_24); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_24, function); - } - } - __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_24, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_24, __pyx_t_4); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; - __pyx_t_24 = PyTuple_New(4); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 5639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_24); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_41); - PyTuple_SET_ITEM(__pyx_t_24, 2, __pyx_t_41); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_24, 3, __pyx_t_3); - __pyx_t_1 = 0; - __pyx_t_6 = 0; - __pyx_t_41 = 0; + __pyx_r = __pyx_t_3; __pyx_t_3 = 0; - __pyx_r = __pyx_t_24; - __pyx_t_24 = 0; goto __pyx_L0; - /* "cyext_acv.pyx":5517 + /* "cyext_acv.pyx":7558 * @cython.nonecheck(False) * @cython.cdivision(True) - * cpdef global_sdp_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, # <<<<<<<<<<<<<< + * cpdef compute_cdp_intv_same_set(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[int] S, # <<<<<<<<<<<<<< * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, - * int max_depth, int min_node_size, int & classifier, double & t, list C, double pi_level, + * const double [:, :, :] & cond, */ /* function exit code */ @@ -86628,75 +117265,56 @@ static PyObject *__pyx_f_9cyext_acv_global_sdp_rf(__Pyx_memviewslice __pyx_v_X, __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); - __Pyx_XDECREF(__pyx_t_6); - __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1); - __Pyx_XDECREF(__pyx_t_24); - __PYX_XDEC_MEMVIEW(&__pyx_t_27, 1); - __PYX_XDEC_MEMVIEW(&__pyx_t_34, 1); - __PYX_XDEC_MEMVIEW(&__pyx_t_35, 1); - __Pyx_XDECREF(__pyx_t_41); - __Pyx_AddTraceback("cyext_acv.global_sdp_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_5); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_15, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1); + __Pyx_AddTraceback("cyext_acv.compute_cdp_intv_same_set", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_buffer); + __PYX_XDEC_MEMVIEW(&__pyx_v_partition_byobs, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_sdp, 1); - __PYX_XDEC_MEMVIEW(&__pyx_v_sdp_b, 1); - __PYX_XDEC_MEMVIEW(&__pyx_v_sdp_ba, 1); - __PYX_XDEC_MEMVIEW(&__pyx_v_sdp_global, 1); - __PYX_XDEC_MEMVIEW(&__pyx_v_in_data, 1); - __Pyx_XDECREF(__pyx_v_power); - __Pyx_XDECREF(__pyx_v_va_id); - __PYX_XDEC_MEMVIEW(&__pyx_v_R_buf, 1); - __Pyx_XDECREF(__pyx_v_X_arr); - __Pyx_XDECREF(__pyx_v_y_X_arr); - __Pyx_XDECREF(__pyx_v_remove_va); - __Pyx_XDECREF(__pyx_v_power_b); - __Pyx_XDECREF(__pyx_v_co); - __PYX_XDEC_MEMVIEW(&__pyx_v_s_star, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_weights, 1); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ -static PyObject *__pyx_pw_9cyext_acv_87global_sdp_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_9cyext_acv_87global_sdp_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_9cyext_acv_129compute_cdp_intv_same_set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_9cyext_acv_129compute_cdp_intv_same_set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { __Pyx_memviewslice __pyx_v_X = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_y_X = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_y_data = { 0, 0, { 0 }, { 0 }, { 0 } }; + std::vector __pyx_v_S; __Pyx_memviewslice __pyx_v_features = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_thresholds = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_children_left = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_children_right = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_cond = { 0, 0, { 0 }, { 0 }, { 0 } }; int __pyx_v_max_depth; int __pyx_v_min_node_size; int __pyx_v_classifier; - double __pyx_v_t; - PyObject *__pyx_v_C = 0; - double __pyx_v_pi_level; - int __pyx_v_minimal; - int __pyx_v_stop; - PyObject *__pyx_v_search_space = 0; + __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } }; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("global_sdp_rf (wrapper)", 0); + __Pyx_RefNannySetupContext("compute_cdp_intv_same_set (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_y_X,&__pyx_n_s_data,&__pyx_n_s_y_data,&__pyx_n_s_features,&__pyx_n_s_thresholds,&__pyx_n_s_children_left,&__pyx_n_s_children_right,&__pyx_n_s_max_depth,&__pyx_n_s_min_node_size,&__pyx_n_s_classifier,&__pyx_n_s_t,&__pyx_n_s_C,&__pyx_n_s_pi_level,&__pyx_n_s_minimal,&__pyx_n_s_stop,&__pyx_n_s_search_space,0}; - PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_y_X,&__pyx_n_s_data,&__pyx_n_s_y_data,&__pyx_n_s_S,&__pyx_n_s_features,&__pyx_n_s_thresholds,&__pyx_n_s_children_left,&__pyx_n_s_children_right,&__pyx_n_s_cond,&__pyx_n_s_max_depth,&__pyx_n_s_min_node_size,&__pyx_n_s_classifier,&__pyx_n_s_t,0}; + PyObject* values[14] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { - case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16); - CYTHON_FALLTHROUGH; - case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15); - CYTHON_FALLTHROUGH; - case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); - CYTHON_FALLTHROUGH; case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); CYTHON_FALLTHROUGH; case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); @@ -86737,103 +117355,85 @@ static PyObject *__pyx_pw_9cyext_acv_87global_sdp_rf(PyObject *__pyx_self, PyObj case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_X)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, 1); __PYX_ERR(0, 5517, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_cdp_intv_same_set", 1, 14, 14, 1); __PYX_ERR(0, 7558, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, 2); __PYX_ERR(0, 5517, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_cdp_intv_same_set", 1, 14, 14, 2); __PYX_ERR(0, 7558, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_data)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, 3); __PYX_ERR(0, 5517, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_cdp_intv_same_set", 1, 14, 14, 3); __PYX_ERR(0, 7558, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_features)) != 0)) kw_args--; + if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_S)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, 4); __PYX_ERR(0, 5517, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_cdp_intv_same_set", 1, 14, 14, 4); __PYX_ERR(0, 7558, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: - if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thresholds)) != 0)) kw_args--; + if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_features)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, 5); __PYX_ERR(0, 5517, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_cdp_intv_same_set", 1, 14, 14, 5); __PYX_ERR(0, 7558, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: - if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_left)) != 0)) kw_args--; + if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thresholds)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, 6); __PYX_ERR(0, 5517, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_cdp_intv_same_set", 1, 14, 14, 6); __PYX_ERR(0, 7558, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: - if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_right)) != 0)) kw_args--; + if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_left)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, 7); __PYX_ERR(0, 5517, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_cdp_intv_same_set", 1, 14, 14, 7); __PYX_ERR(0, 7558, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 8: - if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; + if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_right)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, 8); __PYX_ERR(0, 5517, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_cdp_intv_same_set", 1, 14, 14, 8); __PYX_ERR(0, 7558, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 9: - if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_node_size)) != 0)) kw_args--; + if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cond)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, 9); __PYX_ERR(0, 5517, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_cdp_intv_same_set", 1, 14, 14, 9); __PYX_ERR(0, 7558, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 10: - if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classifier)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, 10); __PYX_ERR(0, 5517, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 11: - if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, 11); __PYX_ERR(0, 5517, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 12: - if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, 12); __PYX_ERR(0, 5517, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 13: - if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pi_level)) != 0)) kw_args--; + if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, 13); __PYX_ERR(0, 5517, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_cdp_intv_same_set", 1, 14, 14, 10); __PYX_ERR(0, 7558, __pyx_L3_error) } CYTHON_FALLTHROUGH; - case 14: - if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minimal)) != 0)) kw_args--; + case 11: + if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_node_size)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, 14); __PYX_ERR(0, 5517, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_cdp_intv_same_set", 1, 14, 14, 11); __PYX_ERR(0, 7558, __pyx_L3_error) } CYTHON_FALLTHROUGH; - case 15: - if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--; + case 12: + if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classifier)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, 15); __PYX_ERR(0, 5517, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_cdp_intv_same_set", 1, 14, 14, 12); __PYX_ERR(0, 7558, __pyx_L3_error) } CYTHON_FALLTHROUGH; - case 16: - if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_search_space)) != 0)) kw_args--; + case 13: + if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, 16); __PYX_ERR(0, 5517, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_cdp_intv_same_set", 1, 14, 14, 13); __PYX_ERR(0, 7558, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "global_sdp_rf") < 0)) __PYX_ERR(0, 5517, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_cdp_intv_same_set") < 0)) __PYX_ERR(0, 7558, __pyx_L3_error) } - } else if (PyTuple_GET_SIZE(__pyx_args) != 17) { + } else if (PyTuple_GET_SIZE(__pyx_args) != 14) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); @@ -86850,67 +117450,57 @@ static PyObject *__pyx_pw_9cyext_acv_87global_sdp_rf(PyObject *__pyx_self, PyObj values[11] = PyTuple_GET_ITEM(__pyx_args, 11); values[12] = PyTuple_GET_ITEM(__pyx_args, 12); values[13] = PyTuple_GET_ITEM(__pyx_args, 13); - values[14] = PyTuple_GET_ITEM(__pyx_args, 14); - values[15] = PyTuple_GET_ITEM(__pyx_args, 15); - values[16] = PyTuple_GET_ITEM(__pyx_args, 16); } - __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 5517, __pyx_L3_error) - __pyx_v_y_X = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_X.memview)) __PYX_ERR(0, 5517, __pyx_L3_error) - __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 5517, __pyx_L3_error) - __pyx_v_y_data = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_data.memview)) __PYX_ERR(0, 5517, __pyx_L3_error) - __pyx_v_features = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_features.memview)) __PYX_ERR(0, 5518, __pyx_L3_error) - __pyx_v_thresholds = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_thresholds.memview)) __PYX_ERR(0, 5518, __pyx_L3_error) - __pyx_v_children_left = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_left.memview)) __PYX_ERR(0, 5518, __pyx_L3_error) - __pyx_v_children_right = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_right.memview)) __PYX_ERR(0, 5518, __pyx_L3_error) - __pyx_v_max_depth = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5519, __pyx_L3_error) - __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5519, __pyx_L3_error) - __pyx_v_classifier = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5519, __pyx_L3_error) - __pyx_v_t = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5519, __pyx_L3_error) - __pyx_v_C = ((PyObject*)values[12]); - __pyx_v_pi_level = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_pi_level == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5519, __pyx_L3_error) - __pyx_v_minimal = __Pyx_PyInt_As_int(values[14]); if (unlikely((__pyx_v_minimal == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5520, __pyx_L3_error) - __pyx_v_stop = __Pyx_PyObject_IsTrue(values[15]); if (unlikely((__pyx_v_stop == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5520, __pyx_L3_error) - __pyx_v_search_space = ((PyObject*)values[16]); + __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 7558, __pyx_L3_error) + __pyx_v_y_X = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_X.memview)) __PYX_ERR(0, 7558, __pyx_L3_error) + __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 7558, __pyx_L3_error) + __pyx_v_y_data = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_data.memview)) __PYX_ERR(0, 7558, __pyx_L3_error) + __pyx_v_S = __pyx_convert_vector_from_py_int(values[4]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 7558, __pyx_L3_error) + __pyx_v_features = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_features.memview)) __PYX_ERR(0, 7559, __pyx_L3_error) + __pyx_v_thresholds = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_thresholds.memview)) __PYX_ERR(0, 7559, __pyx_L3_error) + __pyx_v_children_left = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_left.memview)) __PYX_ERR(0, 7559, __pyx_L3_error) + __pyx_v_children_right = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[8], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_right.memview)) __PYX_ERR(0, 7559, __pyx_L3_error) + __pyx_v_cond = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double__const__(values[9], 0); if (unlikely(!__pyx_v_cond.memview)) __PYX_ERR(0, 7560, __pyx_L3_error) + __pyx_v_max_depth = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7561, __pyx_L3_error) + __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7561, __pyx_L3_error) + __pyx_v_classifier = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7561, __pyx_L3_error) + __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[13], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 7561, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("global_sdp_rf", 1, 17, 17, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5517, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compute_cdp_intv_same_set", 1, 14, 14, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7558, __pyx_L3_error) __pyx_L3_error:; - __Pyx_AddTraceback("cyext_acv.global_sdp_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("cyext_acv.compute_cdp_intv_same_set", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_C), (&PyList_Type), 1, "C", 1))) __PYX_ERR(0, 5519, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_search_space), (&PyList_Type), 1, "search_space", 1))) __PYX_ERR(0, 5520, __pyx_L1_error) - __pyx_r = __pyx_pf_9cyext_acv_86global_sdp_rf(__pyx_self, __pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_v_C, __pyx_v_pi_level, __pyx_v_minimal, __pyx_v_stop, __pyx_v_search_space); + __pyx_r = __pyx_pf_9cyext_acv_128compute_cdp_intv_same_set(__pyx_self, __pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_cond, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t); /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_9cyext_acv_86global_sdp_rf(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, double __pyx_v_t, PyObject *__pyx_v_C, double __pyx_v_pi_level, int __pyx_v_minimal, int __pyx_v_stop, PyObject *__pyx_v_search_space) { +static PyObject *__pyx_pf_9cyext_acv_128compute_cdp_intv_same_set(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, std::vector __pyx_v_S, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, __Pyx_memviewslice __pyx_v_cond, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("global_sdp_rf", 0); + __Pyx_RefNannySetupContext("compute_cdp_intv_same_set", 0); __Pyx_XDECREF(__pyx_r); - if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundLocalError("X"); __PYX_ERR(0, 5517, __pyx_L1_error) } - if (unlikely(!__pyx_v_y_X.memview)) { __Pyx_RaiseUnboundLocalError("y_X"); __PYX_ERR(0, 5517, __pyx_L1_error) } - if (unlikely(!__pyx_v_data.memview)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 5517, __pyx_L1_error) } - if (unlikely(!__pyx_v_y_data.memview)) { __Pyx_RaiseUnboundLocalError("y_data"); __PYX_ERR(0, 5517, __pyx_L1_error) } - if (unlikely(!__pyx_v_features.memview)) { __Pyx_RaiseUnboundLocalError("features"); __PYX_ERR(0, 5517, __pyx_L1_error) } - if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 5517, __pyx_L1_error) } - if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 5517, __pyx_L1_error) } - if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 5517, __pyx_L1_error) } - __pyx_t_1 = __pyx_f_9cyext_acv_global_sdp_rf(__pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_v_C, __pyx_v_pi_level, __pyx_v_minimal, __pyx_v_stop, __pyx_v_search_space, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5517, __pyx_L1_error) + if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundLocalError("X"); __PYX_ERR(0, 7558, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_X.memview)) { __Pyx_RaiseUnboundLocalError("y_X"); __PYX_ERR(0, 7558, __pyx_L1_error) } + if (unlikely(!__pyx_v_data.memview)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 7558, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_data.memview)) { __Pyx_RaiseUnboundLocalError("y_data"); __PYX_ERR(0, 7558, __pyx_L1_error) } + if (unlikely(!__pyx_v_features.memview)) { __Pyx_RaiseUnboundLocalError("features"); __PYX_ERR(0, 7558, __pyx_L1_error) } + if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 7558, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 7558, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 7558, __pyx_L1_error) } + if (unlikely(!__pyx_v_cond.memview)) { __Pyx_RaiseUnboundLocalError("cond"); __PYX_ERR(0, 7558, __pyx_L1_error) } + if (unlikely(!__pyx_v_t.memview)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 7558, __pyx_L1_error) } + __pyx_t_1 = __pyx_f_9cyext_acv_compute_cdp_intv_same_set(__pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_S, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_cond, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -86919,7 +117509,7 @@ static PyObject *__pyx_pf_9cyext_acv_86global_sdp_rf(CYTHON_UNUSED PyObject *__p /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cyext_acv.global_sdp_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("cyext_acv.compute_cdp_intv_same_set", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __PYX_XDEC_MEMVIEW(&__pyx_v_X, 1); @@ -86930,51 +117520,56 @@ static PyObject *__pyx_pf_9cyext_acv_86global_sdp_rf(CYTHON_UNUSED PyObject *__p __PYX_XDEC_MEMVIEW(&__pyx_v_thresholds, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_children_left, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_children_right, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_cond, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_t, 1); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "cyext_acv.pyx":5646 +/* "cyext_acv.pyx":7584 * @cython.nonecheck(False) * @cython.cdivision(True) - * cpdef sufficient_expl_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, # <<<<<<<<<<<<<< + * cpdef global_cdp_intv(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, # <<<<<<<<<<<<<< * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, - * int max_depth, int min_node_size, int & classifier, double & t, list C, double pi_level, + * const double [:, :, :] & cond, */ -static PyObject *__pyx_pw_9cyext_acv_89sufficient_expl_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_f_9cyext_acv_sufficient_expl_rf(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, double &__pyx_v_t, PyObject *__pyx_v_C, double __pyx_v_pi_level, int __pyx_v_minimal, CYTHON_UNUSED int __pyx_v_stop, PyObject *__pyx_v_search_space, CYTHON_UNUSED int __pyx_skip_dispatch) { +static PyObject *__pyx_pw_9cyext_acv_131global_cdp_intv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_9cyext_acv_global_cdp_intv(__Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, __Pyx_memviewslice &__pyx_v_cond, int __pyx_v_max_depth, int __pyx_v_min_node_size, int &__pyx_v_classifier, __Pyx_memviewslice &__pyx_v_t, PyObject *__pyx_v_C, double __pyx_v_pi_level, int __pyx_v_minimal, int __pyx_v_stop, PyObject *__pyx_v_search_space, CYTHON_UNUSED int __pyx_skip_dispatch) { unsigned int __pyx_v_N; unsigned int __pyx_v_m; __Pyx_memviewslice __pyx_v_sdp = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_sdp_b = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_sdp_ba = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_sdp_global = { 0, 0, { 0 }, { 0 }, { 0 } }; - double __pyx_v_K; + __Pyx_memviewslice __pyx_v_in_data = { 0, 0, { 0 }, { 0 }, { 0 } }; int __pyx_v_i; int __pyx_v_s; int __pyx_v_s_0; int __pyx_v_s_1; int __pyx_v_S_size; - int __pyx_v_j; int __pyx_v_max_size; int __pyx_v_size; - int __pyx_v_subset; - int __pyx_v_a; - int __pyx_v_k; std::vector __pyx_v_S; - CYTHON_UNUSED std::vector __pyx_v_len_s_star; + std::vector __pyx_v_len_s_star; PyObject *__pyx_v_power = 0; PyObject *__pyx_v_va_id = 0; + std::vector __pyx_v_R; + std::vector __pyx_v_r; + __Pyx_memviewslice __pyx_v_R_buf = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_X_arr = NULL; + PyObject *__pyx_v_y_X_arr = NULL; + PyObject *__pyx_v_cond_arr = NULL; + PyObject *__pyx_v_t_arr = NULL; PyObject *__pyx_v_remove_va = NULL; Py_ssize_t __pyx_v_ci; Py_ssize_t __pyx_v_cj; PyObject *__pyx_v_power_b = NULL; PyObject *__pyx_v_co = NULL; std::vector > > __pyx_v_power_cpp; - CYTHON_UNUSED __Pyx_memviewslice __pyx_v_s_star = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_s_star = { 0, 0, { 0 }, { 0 }, { 0 } }; CYTHON_UNUSED long __pyx_v_power_set_size; - std::vector > > __pyx_v_sufficient; - std::vector > __pyx_v_sufficient_sdp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -86984,42 +117579,48 @@ static PyObject *__pyx_f_9cyext_acv_sufficient_expl_rf(__Pyx_memviewslice __pyx_ __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } }; PyObject *__pyx_t_6 = NULL; std::vector __pyx_t_7; - int __pyx_t_8; - Py_ssize_t __pyx_t_9; - Py_ssize_t __pyx_t_10; - Py_ssize_t __pyx_t_11; - Py_ssize_t __pyx_t_12; + unsigned int __pyx_t_8; + unsigned int __pyx_t_9; + int __pyx_t_10; + __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_t_12; Py_ssize_t __pyx_t_13; Py_ssize_t __pyx_t_14; - int __pyx_t_15; - int __pyx_t_16; - long __pyx_t_17; - long __pyx_t_18; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; int __pyx_t_19; - PyObject *(*__pyx_t_20)(PyObject *); - PyObject *__pyx_t_21 = NULL; + long __pyx_t_20; + long __pyx_t_21; int __pyx_t_22; - std::vector > > __pyx_t_23; - __Pyx_memviewslice __pyx_t_24 = { 0, 0, { 0 }, { 0 }, { 0 } }; - unsigned int __pyx_t_25; - unsigned int __pyx_t_26; - std::vector > __pyx_t_27; + PyObject *(*__pyx_t_23)(PyObject *); + PyObject *__pyx_t_24 = NULL; + int __pyx_t_25; + std::vector > > __pyx_t_26; + __Pyx_memviewslice __pyx_t_27 = { 0, 0, { 0 }, { 0 }, { 0 } }; std::vector > ::size_type __pyx_t_28; std::vector > ::size_type __pyx_t_29; std::vector ::size_type __pyx_t_30; std::vector ::size_type __pyx_t_31; Py_ssize_t __pyx_t_32; - std::vector > ::size_type __pyx_t_33; - std::vector > ::size_type __pyx_t_34; - int __pyx_t_35; - int __pyx_t_36; - int __pyx_t_37; + Py_ssize_t __pyx_t_33; + __Pyx_memviewslice __pyx_t_34 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_35 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_36 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_37 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + int __pyx_t_40; + int __pyx_t_41; + int __pyx_t_42; + PyObject *__pyx_t_43 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("sufficient_expl_rf", 0); + __Pyx_RefNannySetupContext("global_cdp_intv", 0); - /* "cyext_acv.pyx":5651 + /* "cyext_acv.pyx":7590 * int minimal, bint stop, list search_space): * * cdef unsigned int N = X.shape[0] # <<<<<<<<<<<<<< @@ -87028,7 +117629,7 @@ static PyObject *__pyx_f_9cyext_acv_sufficient_expl_rf(__Pyx_memviewslice __pyx_ */ __pyx_v_N = (__pyx_v_X.shape[0]); - /* "cyext_acv.pyx":5652 + /* "cyext_acv.pyx":7591 * * cdef unsigned int N = X.shape[0] * cdef unsigned int m = X.shape[1] # <<<<<<<<<<<<<< @@ -87037,19 +117638,19 @@ static PyObject *__pyx_f_9cyext_acv_sufficient_expl_rf(__Pyx_memviewslice __pyx_ */ __pyx_v_m = (__pyx_v_X.shape[1]); - /* "cyext_acv.pyx":5656 - * cdef double[:] sdp, sdp_b, sdp_ba + /* "cyext_acv.pyx":7596 * cdef double[:] sdp_global + * cdef double[:] in_data * sdp = np.zeros((N)) # <<<<<<<<<<<<<< + * sdp_b = np.zeros((N)) * sdp_global = np.zeros((m)) - * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5656, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5656, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5656, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -87064,28 +117665,28 @@ static PyObject *__pyx_f_9cyext_acv_sufficient_expl_rf(__Pyx_memviewslice __pyx_ __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5656, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 5656, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 7596, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sdp = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL; - /* "cyext_acv.pyx":5657 - * cdef double[:] sdp_global + /* "cyext_acv.pyx":7597 + * cdef double[:] in_data * sdp = np.zeros((N)) - * sdp_global = np.zeros((m)) # <<<<<<<<<<<<<< - * - * cdef unsigned int it, it_s, a_it, b_it, o_all, p, p_s, nb_leaf, p_u, p_d, p_su, p_sd, down, up + * sdp_b = np.zeros((N)) # <<<<<<<<<<<<<< + * sdp_global = np.zeros((m)) + * in_data = np.zeros(N) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5657, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5657, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_m); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5657, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -87100,63 +117701,356 @@ static PyObject *__pyx_f_9cyext_acv_sufficient_expl_rf(__Pyx_memviewslice __pyx_ __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5657, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 5657, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 7597, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sdp_b = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; + + /* "cyext_acv.pyx":7598 + * sdp = np.zeros((N)) + * sdp_b = np.zeros((N)) + * sdp_global = np.zeros((m)) # <<<<<<<<<<<<<< + * in_data = np.zeros(N) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_m); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 7598, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sdp_global = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL; - /* "cyext_acv.pyx":5662 - * cdef double ss, ss_a, ss_u, ss_d, K - * cdef int b, leaf_numb, i, s, s_0, s_1, S_size, j, max_size, size, subset, a, k - * K = 0 # <<<<<<<<<<<<<< + /* "cyext_acv.pyx":7599 + * sdp_b = np.zeros((N)) + * sdp_global = np.zeros((m)) + * in_data = np.zeros(N) # <<<<<<<<<<<<<< * - * cdef vector[int] S, len_s_star + * cdef unsigned int it, it_s, a_it, b_it, o_all, p, p_s, nb_leaf, p_u, p_d, p_su, p_sd, down, up */ - __pyx_v_K = 0.0; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 7599, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_in_data = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; - /* "cyext_acv.pyx":5665 + /* "cyext_acv.pyx":7606 * * cdef vector[int] S, len_s_star * len_s_star = np.zeros((N), dtype=np.int) # <<<<<<<<<<<<<< * * cdef list power, va_id */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5665, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5665, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5665, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5665, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5665, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5665, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5665, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 5665, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 7606, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5665, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __pyx_convert_vector_from_py_int(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5665, __pyx_L1_error) + __pyx_t_7 = __pyx_convert_vector_from_py_int(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 7606, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_len_s_star = __pyx_t_7; - /* "cyext_acv.pyx":5669 - * cdef list power, va_id + /* "cyext_acv.pyx":7611 + * + * cdef vector[long] R, r + * R.resize(N) # <<<<<<<<<<<<<< + * for i in range(N): + * R[i] = i + */ + try { + __pyx_v_R.resize(__pyx_v_N); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 7611, __pyx_L1_error) + } + + /* "cyext_acv.pyx":7612 + * cdef vector[long] R, r + * R.resize(N) + * for i in range(N): # <<<<<<<<<<<<<< + * R[i] = i + * r.resize(N) + */ + __pyx_t_8 = __pyx_v_N; + __pyx_t_9 = __pyx_t_8; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "cyext_acv.pyx":7613 + * R.resize(N) + * for i in range(N): + * R[i] = i # <<<<<<<<<<<<<< + * r.resize(N) + * + */ + (__pyx_v_R[__pyx_v_i]) = __pyx_v_i; + } + + /* "cyext_acv.pyx":7614 + * for i in range(N): + * R[i] = i + * r.resize(N) # <<<<<<<<<<<<<< + * + * cdef long[:] R_buf + */ + try { + __pyx_v_r.resize(__pyx_v_N); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 7614, __pyx_L1_error) + } + + /* "cyext_acv.pyx":7617 + * + * cdef long[:] R_buf + * R_buf = np.zeros((N), dtype=np.int) # <<<<<<<<<<<<<< + * + * X_arr = np.array(X, dtype=np.double) + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 7617, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7617, __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(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_long(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 7617, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_R_buf = __pyx_t_11; + __pyx_t_11.memview = NULL; + __pyx_t_11.data = NULL; + + /* "cyext_acv.pyx":7619 + * R_buf = np.zeros((N), dtype=np.int) + * + * X_arr = np.array(X, dtype=np.double) # <<<<<<<<<<<<<< + * y_X_arr = np.array(y_X, dtype=np.double) + * cond_arr = np.array(cond) + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_X, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_double); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 7619, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_X_arr = __pyx_t_2; + __pyx_t_2 = 0; + + /* "cyext_acv.pyx":7620 + * + * X_arr = np.array(X, dtype=np.double) + * y_X_arr = np.array(y_X, dtype=np.double) # <<<<<<<<<<<<<< + * cond_arr = np.array(cond) + * t_arr = np.array(t, dtype=np.double) + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_y_X, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_double); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 7620, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_y_X_arr = __pyx_t_1; + __pyx_t_1 = 0; + + /* "cyext_acv.pyx":7621 + * X_arr = np.array(X, dtype=np.double) + * y_X_arr = np.array(y_X, dtype=np.double) + * cond_arr = np.array(cond) # <<<<<<<<<<<<<< + * t_arr = np.array(t, dtype=np.double) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7621, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7621, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_cond, 3, (PyObject *(*)(char *)) __pyx_memview_get_double__const__, (int (*)(char *, PyObject *)) NULL, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7621, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7621, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_cond_arr = __pyx_t_1; + __pyx_t_1 = 0; + + /* "cyext_acv.pyx":7622 + * y_X_arr = np.array(y_X, dtype=np.double) + * cond_arr = np.array(cond) + * t_arr = np.array(t, dtype=np.double) # <<<<<<<<<<<<<< + * + * # buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7622, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7622, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_t, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7622, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7622, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7622, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7622, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7622, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 7622, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7622, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_t_arr = __pyx_t_6; + __pyx_t_6 = 0; + + /* "cyext_acv.pyx":7629 + * # cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) * * if C[0] != []: # <<<<<<<<<<<<<< * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] @@ -87164,104 +118058,104 @@ static PyObject *__pyx_f_9cyext_acv_sufficient_expl_rf(__Pyx_memviewslice __pyx_ */ if (unlikely(__pyx_v_C == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 5669, __pyx_L1_error) + __PYX_ERR(0, 7629, __pyx_L1_error) } - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5669, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyObject_RichCompare(PyList_GET_ITEM(__pyx_v_C, 0), __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5669, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(PyList_GET_ITEM(__pyx_v_C, 0), __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7629, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 5669, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 7629, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_8) { + if (__pyx_t_12) { - /* "cyext_acv.pyx":5670 + /* "cyext_acv.pyx":7630 * * if C[0] != []: * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] # <<<<<<<<<<<<<< * va_id = [[i] for i in search_space if i not in remove_va] * for ci in range(len(C)): */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5670, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_C == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 5670, __pyx_L1_error) + __PYX_ERR(0, 7630, __pyx_L1_error) } - __pyx_t_9 = PyList_GET_SIZE(__pyx_v_C); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5670, __pyx_L1_error) - __pyx_t_10 = __pyx_t_9; - for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { - __pyx_v_ci = __pyx_t_11; + __pyx_t_13 = PyList_GET_SIZE(__pyx_v_C); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 7630, __pyx_L1_error) + __pyx_t_14 = __pyx_t_13; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_ci = __pyx_t_15; if (unlikely(__pyx_v_C == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 5670, __pyx_L1_error) + __PYX_ERR(0, 7630, __pyx_L1_error) } __pyx_t_6 = PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci); __Pyx_INCREF(__pyx_t_6); - __pyx_t_12 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5670, __pyx_L1_error) + __pyx_t_16 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(0, 7630, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_13 = __pyx_t_12; - for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { - __pyx_v_cj = __pyx_t_14; + __pyx_t_17 = __pyx_t_16; + for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { + __pyx_v_cj = __pyx_t_18; if (unlikely(__pyx_v_C == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 5670, __pyx_L1_error) + __PYX_ERR(0, 7630, __pyx_L1_error) } - __pyx_t_6 = __Pyx_GetItemInt(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci), __pyx_v_cj, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5670, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci), __pyx_v_cj, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 5670, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 7630, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __pyx_v_remove_va = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "cyext_acv.pyx":5671 + /* "cyext_acv.pyx":7631 * if C[0] != []: * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] * va_id = [[i] for i in search_space if i not in remove_va] # <<<<<<<<<<<<<< * for ci in range(len(C)): * i = 0 */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5671, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_search_space == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 5671, __pyx_L1_error) + __PYX_ERR(0, 7631, __pyx_L1_error) } - __pyx_t_6 = __pyx_v_search_space; __Pyx_INCREF(__pyx_t_6); __pyx_t_9 = 0; + __pyx_t_6 = __pyx_v_search_space; __Pyx_INCREF(__pyx_t_6); __pyx_t_13 = 0; for (;;) { - if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_6)) break; + if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 5671, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 7631, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7631, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); #endif - __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5671, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_i = __pyx_t_15; - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_t_3, __pyx_v_remove_va, Py_NE)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 5671, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_16 = (__pyx_t_8 != 0); - if (__pyx_t_16) { - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5671, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7631, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_i = __pyx_t_10; + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7631, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_v_remove_va, Py_NE)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 7631, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_19 = (__pyx_t_12 != 0); + if (__pyx_t_19) { + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); - __pyx_t_3 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 5671, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7631, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __pyx_t_2 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 7631, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_va_id = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "cyext_acv.pyx":5672 + /* "cyext_acv.pyx":7632 * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] * va_id = [[i] for i in search_space if i not in remove_va] * for ci in range(len(C)): # <<<<<<<<<<<<<< @@ -87270,14 +118164,14 @@ static PyObject *__pyx_f_9cyext_acv_sufficient_expl_rf(__Pyx_memviewslice __pyx_ */ if (unlikely(__pyx_v_C == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 5672, __pyx_L1_error) + __PYX_ERR(0, 7632, __pyx_L1_error) } - __pyx_t_9 = PyList_GET_SIZE(__pyx_v_C); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5672, __pyx_L1_error) - __pyx_t_10 = __pyx_t_9; - for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { - __pyx_v_ci = __pyx_t_11; + __pyx_t_13 = PyList_GET_SIZE(__pyx_v_C); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 7632, __pyx_L1_error) + __pyx_t_14 = __pyx_t_13; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_ci = __pyx_t_15; - /* "cyext_acv.pyx":5673 + /* "cyext_acv.pyx":7633 * va_id = [[i] for i in search_space if i not in remove_va] * for ci in range(len(C)): * i = 0 # <<<<<<<<<<<<<< @@ -87286,7 +118180,7 @@ static PyObject *__pyx_f_9cyext_acv_sufficient_expl_rf(__Pyx_memviewslice __pyx_ */ __pyx_v_i = 0; - /* "cyext_acv.pyx":5674 + /* "cyext_acv.pyx":7634 * for ci in range(len(C)): * i = 0 * for cj in range(len(C[ci])): # <<<<<<<<<<<<<< @@ -87295,17 +118189,17 @@ static PyObject *__pyx_f_9cyext_acv_sufficient_expl_rf(__Pyx_memviewslice __pyx_ */ if (unlikely(__pyx_v_C == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 5674, __pyx_L1_error) + __PYX_ERR(0, 7634, __pyx_L1_error) } __pyx_t_1 = PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci); __Pyx_INCREF(__pyx_t_1); - __pyx_t_12 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5674, __pyx_L1_error) + __pyx_t_16 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(0, 7634, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_13 = __pyx_t_12; - for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { - __pyx_v_cj = __pyx_t_14; + __pyx_t_17 = __pyx_t_16; + for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { + __pyx_v_cj = __pyx_t_18; - /* "cyext_acv.pyx":5675 + /* "cyext_acv.pyx":7635 * i = 0 * for cj in range(len(C[ci])): * if C[ci][cj] in search_space: # <<<<<<<<<<<<<< @@ -87314,16 +118208,16 @@ static PyObject *__pyx_f_9cyext_acv_sufficient_expl_rf(__Pyx_memviewslice __pyx_ */ if (unlikely(__pyx_v_C == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 5675, __pyx_L1_error) + __PYX_ERR(0, 7635, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci), __pyx_v_cj, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5675, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci), __pyx_v_cj, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_16 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_search_space, Py_EQ)); if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(0, 5675, __pyx_L1_error) + __pyx_t_19 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_search_space, Py_EQ)); if (unlikely(__pyx_t_19 < 0)) __PYX_ERR(0, 7635, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_8 = (__pyx_t_16 != 0); - if (__pyx_t_8) { + __pyx_t_12 = (__pyx_t_19 != 0); + if (__pyx_t_12) { - /* "cyext_acv.pyx":5676 + /* "cyext_acv.pyx":7636 * for cj in range(len(C[ci])): * if C[ci][cj] in search_space: * i += 1 # <<<<<<<<<<<<<< @@ -87332,16 +118226,16 @@ static PyObject *__pyx_f_9cyext_acv_sufficient_expl_rf(__Pyx_memviewslice __pyx_ */ __pyx_v_i = (__pyx_v_i + 1); - /* "cyext_acv.pyx":5677 + /* "cyext_acv.pyx":7637 * if C[ci][cj] in search_space: * i += 1 * break # <<<<<<<<<<<<<< * if i != 0: * va_id += [C[ci]] */ - goto __pyx_L14_break; + goto __pyx_L16_break; - /* "cyext_acv.pyx":5675 + /* "cyext_acv.pyx":7635 * i = 0 * for cj in range(len(C[ci])): * if C[ci][cj] in search_space: # <<<<<<<<<<<<<< @@ -87350,19 +118244,19 @@ static PyObject *__pyx_f_9cyext_acv_sufficient_expl_rf(__Pyx_memviewslice __pyx_ */ } } - __pyx_L14_break:; + __pyx_L16_break:; - /* "cyext_acv.pyx":5678 + /* "cyext_acv.pyx":7638 * i += 1 * break * if i != 0: # <<<<<<<<<<<<<< * va_id += [C[ci]] * else: */ - __pyx_t_8 = ((__pyx_v_i != 0) != 0); - if (__pyx_t_8) { + __pyx_t_12 = ((__pyx_v_i != 0) != 0); + if (__pyx_t_12) { - /* "cyext_acv.pyx":5679 + /* "cyext_acv.pyx":7639 * break * if i != 0: * va_id += [C[ci]] # <<<<<<<<<<<<<< @@ -87371,20 +118265,20 @@ static PyObject *__pyx_f_9cyext_acv_sufficient_expl_rf(__Pyx_memviewslice __pyx_ */ if (unlikely(__pyx_v_C == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 5679, __pyx_L1_error) + __PYX_ERR(0, 7639, __pyx_L1_error) } - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5679, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci)); __Pyx_GIVEREF(PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci)); PyList_SET_ITEM(__pyx_t_1, 0, PyList_GET_ITEM(__pyx_v_C, __pyx_v_ci)); - __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_va_id, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5679, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_va_id, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_va_id, ((PyObject*)__pyx_t_6)); __pyx_t_6 = 0; - /* "cyext_acv.pyx":5678 + /* "cyext_acv.pyx":7638 * i += 1 * break * if i != 0: # <<<<<<<<<<<<<< @@ -87394,17 +118288,17 @@ static PyObject *__pyx_f_9cyext_acv_sufficient_expl_rf(__Pyx_memviewslice __pyx_ } } - /* "cyext_acv.pyx":5669 - * cdef list power, va_id + /* "cyext_acv.pyx":7629 + * # cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) * * if C[0] != []: # <<<<<<<<<<<<<< * remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] * va_id = [[i] for i in search_space if i not in remove_va] */ - goto __pyx_L3; + goto __pyx_L5; } - /* "cyext_acv.pyx":5681 + /* "cyext_acv.pyx":7641 * va_id += [C[ci]] * else: * va_id = [[i] for i in search_space] # <<<<<<<<<<<<<< @@ -87412,63 +118306,63 @@ static PyObject *__pyx_f_9cyext_acv_sufficient_expl_rf(__Pyx_memviewslice __pyx_ * m = len(va_id) */ /*else*/ { - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5681, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (unlikely(__pyx_v_search_space == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 5681, __pyx_L1_error) + __PYX_ERR(0, 7641, __pyx_L1_error) } - __pyx_t_1 = __pyx_v_search_space; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0; + __pyx_t_1 = __pyx_v_search_space; __Pyx_INCREF(__pyx_t_1); __pyx_t_13 = 0; for (;;) { - if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1)) break; + if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 5681, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 7641, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5681, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - #endif - __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5681, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_i = __pyx_t_15; - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5681, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5681, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_2); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - __pyx_t_2 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 5681, __pyx_L1_error) + #endif + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7641, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_i = __pyx_t_10; + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7641, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7641, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __pyx_t_3 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 7641, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_va_id = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; } - __pyx_L3:; + __pyx_L5:; - /* "cyext_acv.pyx":5683 + /* "cyext_acv.pyx":7643 * va_id = [[i] for i in search_space] * * m = len(va_id) # <<<<<<<<<<<<<< * power = [] * max_size = 0 */ - __pyx_t_9 = PyList_GET_SIZE(__pyx_v_va_id); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5683, __pyx_L1_error) - __pyx_v_m = __pyx_t_9; + __pyx_t_13 = PyList_GET_SIZE(__pyx_v_va_id); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 7643, __pyx_L1_error) + __pyx_v_m = __pyx_t_13; - /* "cyext_acv.pyx":5684 + /* "cyext_acv.pyx":7644 * * m = len(va_id) * power = [] # <<<<<<<<<<<<<< * max_size = 0 * for size in range(m + 1): */ - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5684, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_power = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; - /* "cyext_acv.pyx":5685 + /* "cyext_acv.pyx":7645 * m = len(va_id) * power = [] * max_size = 0 # <<<<<<<<<<<<<< @@ -87477,126 +118371,126 @@ static PyObject *__pyx_f_9cyext_acv_sufficient_expl_rf(__Pyx_memviewslice __pyx_ */ __pyx_v_max_size = 0; - /* "cyext_acv.pyx":5686 + /* "cyext_acv.pyx":7646 * power = [] * max_size = 0 * for size in range(m + 1): # <<<<<<<<<<<<<< * power_b = [] * for co in itertools.combinations(va_id, size): */ - __pyx_t_17 = (__pyx_v_m + 1); - __pyx_t_18 = __pyx_t_17; - for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_18; __pyx_t_15+=1) { - __pyx_v_size = __pyx_t_15; + __pyx_t_20 = (__pyx_v_m + 1); + __pyx_t_21 = __pyx_t_20; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_21; __pyx_t_10+=1) { + __pyx_v_size = __pyx_t_10; - /* "cyext_acv.pyx":5687 + /* "cyext_acv.pyx":7647 * max_size = 0 * for size in range(m + 1): * power_b = [] # <<<<<<<<<<<<<< * for co in itertools.combinations(va_id, size): * power_b.append(np.array(sum(list(co),[]))) */ - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5687, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_power_b, ((PyObject*)__pyx_t_6)); __pyx_t_6 = 0; - /* "cyext_acv.pyx":5688 + /* "cyext_acv.pyx":7648 * for size in range(m + 1): * power_b = [] * for co in itertools.combinations(va_id, size): # <<<<<<<<<<<<<< * power_b.append(np.array(sum(list(co),[]))) * max_size += 1 */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_itertools); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5688, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_itertools); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_combinations); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5688, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_combinations); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7648, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5688, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = NULL; - __pyx_t_19 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_22 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_19 = 1; + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_22 = 1; } } #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_3)) { - PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_va_id, __pyx_t_1}; - __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_19, 2+__pyx_t_19); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5688, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_va_id, __pyx_t_1}; + __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7648, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { - PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_va_id, __pyx_t_1}; - __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_19, 2+__pyx_t_19); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5688, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_va_id, __pyx_t_1}; + __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7648, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_4 = PyTuple_New(2+__pyx_t_19); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5688, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2+__pyx_t_22); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (__pyx_t_2) { - __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL; + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_v_va_id); __Pyx_GIVEREF(__pyx_v_va_id); - PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_19, __pyx_v_va_id); + PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_22, __pyx_v_va_id); __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_19, __pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_22, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5688, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) { - __pyx_t_3 = __pyx_t_6; __Pyx_INCREF(__pyx_t_3); __pyx_t_9 = 0; - __pyx_t_20 = NULL; + __pyx_t_2 = __pyx_t_6; __Pyx_INCREF(__pyx_t_2); __pyx_t_13 = 0; + __pyx_t_23 = NULL; } else { - __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5688, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_20 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 5688, __pyx_L1_error) + __pyx_t_13 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7648, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_23 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 7648, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; for (;;) { - if (likely(!__pyx_t_20)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { - if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_3)) break; + if (likely(!__pyx_t_23)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 5688, __pyx_L1_error) + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 7648, __pyx_L1_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5688, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { - if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 5688, __pyx_L1_error) + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 7648, __pyx_L1_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5688, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } } else { - __pyx_t_6 = __pyx_t_20(__pyx_t_3); + __pyx_t_6 = __pyx_t_23(__pyx_t_2); if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 5688, __pyx_L1_error) + else __PYX_ERR(0, 7648, __pyx_L1_error) } break; } @@ -87605,53 +118499,53 @@ static PyObject *__pyx_f_9cyext_acv_sufficient_expl_rf(__Pyx_memviewslice __pyx_ __Pyx_XDECREF_SET(__pyx_v_co, __pyx_t_6); __pyx_t_6 = 0; - /* "cyext_acv.pyx":5689 + /* "cyext_acv.pyx":7649 * power_b = [] * for co in itertools.combinations(va_id, size): * power_b.append(np.array(sum(list(co),[]))) # <<<<<<<<<<<<<< * max_size += 1 * power.append(power_b) */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5689, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5689, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PySequence_List(__pyx_v_co); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5689, __pyx_L1_error) + __pyx_t_4 = PySequence_List(__pyx_v_co); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_21 = PyTuple_New(2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_21); + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7649, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_24 = PyTuple_New(2); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7649, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_3); __pyx_t_4 = 0; - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; - __pyx_t_21 = NULL; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_24, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7649, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_21)) { + __pyx_t_24 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_24)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_21); + __Pyx_INCREF(__pyx_t_24); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } - __pyx_t_6 = (__pyx_t_21) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_21, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); - __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5689, __pyx_L1_error) + __pyx_t_6 = (__pyx_t_24) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_24, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_22 = __Pyx_PyList_Append(__pyx_v_power_b, __pyx_t_6); if (unlikely(__pyx_t_22 == ((int)-1))) __PYX_ERR(0, 5689, __pyx_L1_error) + __pyx_t_25 = __Pyx_PyList_Append(__pyx_v_power_b, __pyx_t_6); if (unlikely(__pyx_t_25 == ((int)-1))) __PYX_ERR(0, 7649, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "cyext_acv.pyx":5690 + /* "cyext_acv.pyx":7650 * for co in itertools.combinations(va_id, size): * power_b.append(np.array(sum(list(co),[]))) * max_size += 1 # <<<<<<<<<<<<<< @@ -87660,7 +118554,7 @@ static PyObject *__pyx_f_9cyext_acv_sufficient_expl_rf(__Pyx_memviewslice __pyx_ */ __pyx_v_max_size = (__pyx_v_max_size + 1); - /* "cyext_acv.pyx":5688 + /* "cyext_acv.pyx":7648 * for size in range(m + 1): * power_b = [] * for co in itertools.combinations(va_id, size): # <<<<<<<<<<<<<< @@ -87668,37 +118562,37 @@ static PyObject *__pyx_f_9cyext_acv_sufficient_expl_rf(__Pyx_memviewslice __pyx_ * max_size += 1 */ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cyext_acv.pyx":5691 + /* "cyext_acv.pyx":7651 * power_b.append(np.array(sum(list(co),[]))) * max_size += 1 * power.append(power_b) # <<<<<<<<<<<<<< * if max_size >= 2**15: * break */ - __pyx_t_22 = __Pyx_PyList_Append(__pyx_v_power, __pyx_v_power_b); if (unlikely(__pyx_t_22 == ((int)-1))) __PYX_ERR(0, 5691, __pyx_L1_error) + __pyx_t_25 = __Pyx_PyList_Append(__pyx_v_power, __pyx_v_power_b); if (unlikely(__pyx_t_25 == ((int)-1))) __PYX_ERR(0, 7651, __pyx_L1_error) - /* "cyext_acv.pyx":5692 + /* "cyext_acv.pyx":7652 * max_size += 1 * power.append(power_b) * if max_size >= 2**15: # <<<<<<<<<<<<<< * break * */ - __pyx_t_8 = ((__pyx_v_max_size >= 0x8000) != 0); - if (__pyx_t_8) { + __pyx_t_12 = ((__pyx_v_max_size >= 0x8000) != 0); + if (__pyx_t_12) { - /* "cyext_acv.pyx":5693 + /* "cyext_acv.pyx":7653 * power.append(power_b) * if max_size >= 2**15: * break # <<<<<<<<<<<<<< * * cdef vector[vector[vector[long]]] power_cpp = power */ - goto __pyx_L20_break; + goto __pyx_L22_break; - /* "cyext_acv.pyx":5692 + /* "cyext_acv.pyx":7652 * max_size += 1 * power.append(power_b) * if max_size >= 2**15: # <<<<<<<<<<<<<< @@ -87707,71 +118601,71 @@ static PyObject *__pyx_f_9cyext_acv_sufficient_expl_rf(__Pyx_memviewslice __pyx_ */ } } - __pyx_L20_break:; + __pyx_L22_break:; - /* "cyext_acv.pyx":5695 + /* "cyext_acv.pyx":7655 * break * * cdef vector[vector[vector[long]]] power_cpp = power # <<<<<<<<<<<<<< * cdef long[:, :] s_star * s_star = -1*np.ones((N, X.shape[1]), dtype=np.int) */ - __pyx_t_23 = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_std_3a__3a_vector_3c_long_3e____3e___(__pyx_v_power); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5695, __pyx_L1_error) - __pyx_v_power_cpp = __pyx_t_23; + __pyx_t_26 = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_std_3a__3a_vector_3c_long_3e____3e___(__pyx_v_power); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 7655, __pyx_L1_error) + __pyx_v_power_cpp = __pyx_t_26; - /* "cyext_acv.pyx":5697 + /* "cyext_acv.pyx":7657 * cdef vector[vector[vector[long]]] power_cpp = power * cdef long[:, :] s_star * s_star = -1*np.ones((N, X.shape[1]), dtype=np.int) # <<<<<<<<<<<<<< * * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5697, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ones); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5697, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7657, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ones); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5697, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_X.shape[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5697, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5697, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); - __pyx_t_3 = 0; - __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5697, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_X.shape[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7657, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5697, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5697, __pyx_L1_error) + __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7657, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5697, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_21); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_21) < 0) __PYX_ERR(0, 5697, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; - __pyx_t_21 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5697, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_21); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Multiply(__pyx_int_neg_1, __pyx_t_21); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5697, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; - __pyx_t_24 = __Pyx_PyObject_to_MemoryviewSlice_dsds_long(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_24.memview)) __PYX_ERR(0, 5697, __pyx_L1_error) + __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7657, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_s_star = __pyx_t_24; - __pyx_t_24.memview = NULL; - __pyx_t_24.data = NULL; + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_24) < 0) __PYX_ERR(0, 7657, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7657, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Multiply(__pyx_int_neg_1, __pyx_t_24); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7657, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_27 = __Pyx_PyObject_to_MemoryviewSlice_dsds_long(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_27.memview)) __PYX_ERR(0, 7657, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_s_star = __pyx_t_27; + __pyx_t_27.memview = NULL; + __pyx_t_27.data = NULL; - /* "cyext_acv.pyx":5700 + /* "cyext_acv.pyx":7660 * * * cdef long power_set_size = 2**m # <<<<<<<<<<<<<< @@ -87780,183 +118674,128 @@ static PyObject *__pyx_f_9cyext_acv_sufficient_expl_rf(__Pyx_memviewslice __pyx_ */ __pyx_v_power_set_size = __Pyx_pow_long(2, ((long)__pyx_v_m)); - /* "cyext_acv.pyx":5701 + /* "cyext_acv.pyx":7661 * * cdef long power_set_size = 2**m * S = np.zeros((data.shape[1]), dtype=np.int) # <<<<<<<<<<<<<< * - * cdef vector[vector[vector[long]]] sufficient = [[[-1]] for i in range(N)] + * for s_0 in tqdm(range(minimal, m + 1)): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_21); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_data.shape[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5701, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 5701, __pyx_L1_error) + __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_21, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5701, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_data.shape[1])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 7661, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_7 = __pyx_convert_vector_from_py_int(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5701, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_24, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = __pyx_convert_vector_from_py_int(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 7661, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_S = __pyx_t_7; - /* "cyext_acv.pyx":5703 + /* "cyext_acv.pyx":7663 * S = np.zeros((data.shape[1]), dtype=np.int) * - * cdef vector[vector[vector[long]]] sufficient = [[[-1]] for i in range(N)] # <<<<<<<<<<<<<< - * cdef vector[vector[double]] sufficient_sdp = [[-1] for i in range(N)] - * - */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5703, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_25 = __pyx_v_N; - __pyx_t_26 = __pyx_t_25; - for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_26; __pyx_t_15+=1) { - __pyx_v_i = __pyx_t_15; - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5703, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_int_neg_1); - __Pyx_GIVEREF(__pyx_int_neg_1); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_neg_1); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5703, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); - __pyx_t_2 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 5703, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_t_23 = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_std_3a__3a_vector_3c_long_3e____3e___(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5703, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_sufficient = __pyx_t_23; - - /* "cyext_acv.pyx":5704 - * - * cdef vector[vector[vector[long]]] sufficient = [[[-1]] for i in range(N)] - * cdef vector[vector[double]] sufficient_sdp = [[-1] for i in range(N)] # <<<<<<<<<<<<<< - * - * for s_0 in tqdm(range(minimal, m + 1)): - */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_25 = __pyx_v_N; - __pyx_t_26 = __pyx_t_25; - for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_26; __pyx_t_15+=1) { - __pyx_v_i = __pyx_t_15; - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_int_neg_1); - __Pyx_GIVEREF(__pyx_int_neg_1); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_neg_1); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 5704, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_t_27 = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5704, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_sufficient_sdp = __pyx_t_27; - - /* "cyext_acv.pyx":5706 - * cdef vector[vector[double]] sufficient_sdp = [[-1] for i in range(N)] - * * for s_0 in tqdm(range(minimal, m + 1)): # <<<<<<<<<<<<<< * for s_1 in range(0, power_cpp[s_0].size()): * for i in range(power_cpp[s_0][s_1].size()): */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_tqdm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5706, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_tqdm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7663, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_minimal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_minimal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5706, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_21 = __Pyx_PyInt_From_long((__pyx_v_m + 1)); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5706, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_21); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5706, __pyx_L1_error) + __pyx_t_24 = __Pyx_PyInt_From_long((__pyx_v_m + 1)); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7663, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_21); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_21); - __pyx_t_2 = 0; - __pyx_t_21 = 0; - __pyx_t_21 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_6, NULL); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5706, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_21); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_24); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_24); + __pyx_t_1 = 0; + __pyx_t_24 = 0; + __pyx_t_24 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_6, NULL); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7663, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); + __Pyx_DECREF_SET(__pyx_t_3, function); } } - __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_21) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_21); + __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_t_24) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_24); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5706, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0; - __pyx_t_20 = NULL; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7663, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_13 = 0; + __pyx_t_23 = NULL; } else { - __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5706, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_20 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 5706, __pyx_L1_error) + __pyx_t_13 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7663, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_23 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 7663, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { - if (likely(!__pyx_t_20)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1)) break; + if (likely(!__pyx_t_23)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 5706, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 7663, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5706, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7663, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); #endif } else { - if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 5706, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 7663, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5706, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7663, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); #endif } } else { - __pyx_t_3 = __pyx_t_20(__pyx_t_1); - if (unlikely(!__pyx_t_3)) { + __pyx_t_2 = __pyx_t_23(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 5706, __pyx_L1_error) + else __PYX_ERR(0, 7663, __pyx_L1_error) } break; } - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5706, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_s_0 = __pyx_t_15; + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7663, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_s_0 = __pyx_t_10; - /* "cyext_acv.pyx":5707 + /* "cyext_acv.pyx":7664 * * for s_0 in tqdm(range(minimal, m + 1)): * for s_1 in range(0, power_cpp[s_0].size()): # <<<<<<<<<<<<<< @@ -87965,10 +118804,10 @@ static PyObject *__pyx_f_9cyext_acv_sufficient_expl_rf(__Pyx_memviewslice __pyx_ */ __pyx_t_28 = (__pyx_v_power_cpp[__pyx_v_s_0]).size(); __pyx_t_29 = __pyx_t_28; - for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_29; __pyx_t_15+=1) { - __pyx_v_s_1 = __pyx_t_15; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_29; __pyx_t_10+=1) { + __pyx_v_s_1 = __pyx_t_10; - /* "cyext_acv.pyx":5708 + /* "cyext_acv.pyx":7665 * for s_0 in tqdm(range(minimal, m + 1)): * for s_1 in range(0, power_cpp[s_0].size()): * for i in range(power_cpp[s_0][s_1].size()): # <<<<<<<<<<<<<< @@ -87977,10 +118816,10 @@ static PyObject *__pyx_f_9cyext_acv_sufficient_expl_rf(__Pyx_memviewslice __pyx_ */ __pyx_t_30 = ((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1]).size(); __pyx_t_31 = __pyx_t_30; - for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_31; __pyx_t_19+=1) { - __pyx_v_i = __pyx_t_19; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_31; __pyx_t_22+=1) { + __pyx_v_i = __pyx_t_22; - /* "cyext_acv.pyx":5709 + /* "cyext_acv.pyx":7666 * for s_1 in range(0, power_cpp[s_0].size()): * for i in range(power_cpp[s_0][s_1].size()): * S[i] = power_cpp[s_0][s_1][i] # <<<<<<<<<<<<<< @@ -87990,348 +118829,752 @@ static PyObject *__pyx_f_9cyext_acv_sufficient_expl_rf(__Pyx_memviewslice __pyx_ (__pyx_v_S[__pyx_v_i]) = (((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1])[__pyx_v_i]); } - /* "cyext_acv.pyx":5711 + /* "cyext_acv.pyx":7668 * S[i] = power_cpp[s_0][s_1][i] * * S_size = power_cpp[s_0][s_1].size() # <<<<<<<<<<<<<< - * sdp = compute_sdp_rf_same_set(X, y_X, data, y_data, S[:S_size], features, thresholds, children_left, - * children_right, max_depth, min_node_size, classifier, t) + * r.clear() + * N = R.size() */ __pyx_v_S_size = ((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1]).size(); - /* "cyext_acv.pyx":5712 + /* "cyext_acv.pyx":7669 * * S_size = power_cpp[s_0][s_1].size() - * sdp = compute_sdp_rf_same_set(X, y_X, data, y_data, S[:S_size], features, thresholds, children_left, # <<<<<<<<<<<<<< - * children_right, max_depth, min_node_size, classifier, t) - * + * r.clear() # <<<<<<<<<<<<<< + * N = R.size() + * in_data = np.zeros(X.shape[0]) */ - __pyx_t_3 = __pyx_convert_vector_to_py_int(__pyx_v_S); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5712, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_21 = __Pyx_PyObject_GetSlice(__pyx_t_3, 0, __pyx_v_S_size, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5712, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_21); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __pyx_convert_vector_from_py_int(__pyx_t_21); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5712, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __pyx_v_r.clear(); - /* "cyext_acv.pyx":5713 + /* "cyext_acv.pyx":7670 * S_size = power_cpp[s_0][s_1].size() - * sdp = compute_sdp_rf_same_set(X, y_X, data, y_data, S[:S_size], features, thresholds, children_left, - * children_right, max_depth, min_node_size, classifier, t) # <<<<<<<<<<<<<< + * r.clear() + * N = R.size() # <<<<<<<<<<<<<< + * in_data = np.zeros(X.shape[0]) + * + */ + __pyx_v_N = __pyx_v_R.size(); + + /* "cyext_acv.pyx":7671 + * r.clear() + * N = R.size() + * in_data = np.zeros(X.shape[0]) # <<<<<<<<<<<<<< * * for i in range(N): */ - __pyx_t_21 = __pyx_f_9cyext_acv_compute_sdp_rf_same_set(__pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_t_7, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, 0); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5712, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_21); + __Pyx_GetModuleGlobalName(__pyx_t_24, __pyx_n_s_np); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_24, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = PyInt_FromSsize_t((__pyx_v_X.shape[0])); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_1, __pyx_t_24) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_24); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 7671, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_in_data, 1); + __pyx_v_in_data = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; - /* "cyext_acv.pyx":5712 + /* "cyext_acv.pyx":7673 + * in_data = np.zeros(X.shape[0]) * - * S_size = power_cpp[s_0][s_1].size() - * sdp = compute_sdp_rf_same_set(X, y_X, data, y_data, S[:S_size], features, thresholds, children_left, # <<<<<<<<<<<<<< - * children_right, max_depth, min_node_size, classifier, t) + * for i in range(N): # <<<<<<<<<<<<<< + * R_buf[i] = R[i] + * in_data[R_buf[i]] = 1 + */ + __pyx_t_8 = __pyx_v_N; + __pyx_t_9 = __pyx_t_8; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_9; __pyx_t_22+=1) { + __pyx_v_i = __pyx_t_22; + + /* "cyext_acv.pyx":7674 + * + * for i in range(N): + * R_buf[i] = R[i] # <<<<<<<<<<<<<< + * in_data[R_buf[i]] = 1 * */ - __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_21, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 5712, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; - __PYX_XDEC_MEMVIEW(&__pyx_v_sdp, 1); - __pyx_v_sdp = __pyx_t_5; + __pyx_t_32 = __pyx_v_i; + *((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_32 * __pyx_v_R_buf.strides[0]) )) = (__pyx_v_R[__pyx_v_i]); + + /* "cyext_acv.pyx":7675 + * for i in range(N): + * R_buf[i] = R[i] + * in_data[R_buf[i]] = 1 # <<<<<<<<<<<<<< + * + * # sdp_b[R_buf[i]] = single_compute_cdp_intv_rule_weights(X[R_buf[i]], y_X[R_buf[i]], data, y_data, S[:S_size], + */ + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_32 * __pyx_v_R_buf.strides[0]) ))); + *((double *) ( /* dim=0 */ (__pyx_v_in_data.data + __pyx_t_33 * __pyx_v_in_data.strides[0]) )) = 1.0; + } + + /* "cyext_acv.pyx":7682 + * # partition_byobs[R_buf[i]], weights[R_buf[i]], cond[R_buf[i]]) + * + * sdp_ba = compute_cdp_intv_same_set(X_arr[np.array(in_data, dtype=bool)], # <<<<<<<<<<<<<< + * y_X_arr[np.array(in_data, dtype=bool)], + * data, y_data, S[:S_size], features, thresholds, children_left, + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_in_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_24 = PyTuple_New(1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 7682, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_24, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_X_arr, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_34 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_34.memview)) __PYX_ERR(0, 7682, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "cyext_acv.pyx":7683 + * + * sdp_ba = compute_cdp_intv_same_set(X_arr[np.array(in_data, dtype=bool)], + * y_X_arr[np.array(in_data, dtype=bool)], # <<<<<<<<<<<<<< + * data, y_data, S[:S_size], features, thresholds, children_left, + * children_right, cond_arr[np.array(in_data, dtype=bool)], max_depth, min_node_size, classifier, t_arr[np.array(in_data, dtype=bool)]) + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_in_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_24 = PyTuple_New(1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 7683, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_24, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_y_X_arr, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_35 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_35.memview)) __PYX_ERR(0, 7683, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "cyext_acv.pyx":7684 + * sdp_ba = compute_cdp_intv_same_set(X_arr[np.array(in_data, dtype=bool)], + * y_X_arr[np.array(in_data, dtype=bool)], + * data, y_data, S[:S_size], features, thresholds, children_left, # <<<<<<<<<<<<<< + * children_right, cond_arr[np.array(in_data, dtype=bool)], max_depth, min_node_size, classifier, t_arr[np.array(in_data, dtype=bool)]) + * + */ + __pyx_t_2 = __pyx_convert_vector_to_py_int(__pyx_v_S); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, __pyx_v_S_size, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __pyx_convert_vector_from_py_int(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 7684, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "cyext_acv.pyx":7685 + * y_X_arr[np.array(in_data, dtype=bool)], + * data, y_data, S[:S_size], features, thresholds, children_left, + * children_right, cond_arr[np.array(in_data, dtype=bool)], max_depth, min_node_size, classifier, t_arr[np.array(in_data, dtype=bool)]) # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_in_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_24 = PyTuple_New(1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 7685, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_24, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_cond_arr, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_36 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double__const__(__pyx_t_6, 0); if (unlikely(!__pyx_t_36.memview)) __PYX_ERR(0, 7685, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_in_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_24 = PyTuple_New(1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 7685, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_24, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_t_arr, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_37 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_37.memview)) __PYX_ERR(0, 7685, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "cyext_acv.pyx":7682 + * # partition_byobs[R_buf[i]], weights[R_buf[i]], cond[R_buf[i]]) + * + * sdp_ba = compute_cdp_intv_same_set(X_arr[np.array(in_data, dtype=bool)], # <<<<<<<<<<<<<< + * y_X_arr[np.array(in_data, dtype=bool)], + * data, y_data, S[:S_size], features, thresholds, children_left, + */ + __pyx_t_6 = __pyx_f_9cyext_acv_compute_cdp_intv_same_set(__pyx_t_34, __pyx_t_35, __pyx_v_data, __pyx_v_y_data, __pyx_t_7, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_t_36, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_t_37, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __PYX_XDEC_MEMVIEW(&__pyx_t_34, 1); + __pyx_t_34.memview = NULL; + __pyx_t_34.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_35, 1); + __pyx_t_35.memview = NULL; + __pyx_t_35.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_36, 1); + __pyx_t_36.memview = NULL; + __pyx_t_36.data = NULL; + __PYX_XDEC_MEMVIEW(&__pyx_t_37, 1); + __pyx_t_37.memview = NULL; + __pyx_t_37.data = NULL; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 7682, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp_ba, 1); + __pyx_v_sdp_ba = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL; - /* "cyext_acv.pyx":5715 - * children_right, max_depth, min_node_size, classifier, t) + /* "cyext_acv.pyx":7687 + * children_right, cond_arr[np.array(in_data, dtype=bool)], max_depth, min_node_size, classifier, t_arr[np.array(in_data, dtype=bool)]) * * for i in range(N): # <<<<<<<<<<<<<< - * if sdp[i] >= pi_level: - * subset = 0 + * sdp_b[R_buf[i]] = sdp_ba[i] + * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: */ - __pyx_t_25 = __pyx_v_N; - __pyx_t_26 = __pyx_t_25; - for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_26; __pyx_t_19+=1) { - __pyx_v_i = __pyx_t_19; + __pyx_t_8 = __pyx_v_N; + __pyx_t_9 = __pyx_t_8; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_9; __pyx_t_22+=1) { + __pyx_v_i = __pyx_t_22; - /* "cyext_acv.pyx":5716 + /* "cyext_acv.pyx":7688 * * for i in range(N): - * if sdp[i] >= pi_level: # <<<<<<<<<<<<<< - * subset = 0 - * for j in range(sufficient[i].size()): + * sdp_b[R_buf[i]] = sdp_ba[i] # <<<<<<<<<<<<<< + * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: + * sdp[R_buf[i]] = sdp_b[R_buf[i]] */ __pyx_t_32 = __pyx_v_i; - __pyx_t_8 = (((*((double *) ( /* dim=0 */ (__pyx_v_sdp.data + __pyx_t_32 * __pyx_v_sdp.strides[0]) ))) >= __pyx_v_pi_level) != 0); - if (__pyx_t_8) { + __pyx_t_33 = __pyx_v_i; + __pyx_t_38 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_33 * __pyx_v_R_buf.strides[0]) ))); + *((double *) ( /* dim=0 */ (__pyx_v_sdp_b.data + __pyx_t_38 * __pyx_v_sdp_b.strides[0]) )) = (*((double *) ( /* dim=0 */ (__pyx_v_sdp_ba.data + __pyx_t_32 * __pyx_v_sdp_ba.strides[0]) ))); - /* "cyext_acv.pyx":5717 + /* "cyext_acv.pyx":7689 * for i in range(N): - * if sdp[i] >= pi_level: - * subset = 0 # <<<<<<<<<<<<<< - * for j in range(sufficient[i].size()): - * a = 0 + * sdp_b[R_buf[i]] = sdp_ba[i] + * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: # <<<<<<<<<<<<<< + * sdp[R_buf[i]] = sdp_b[R_buf[i]] + * len_s_star[R_buf[i]] = S_size */ - __pyx_v_subset = 0; + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_32 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_38 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_12 = (((*((double *) ( /* dim=0 */ (__pyx_v_sdp_b.data + __pyx_t_33 * __pyx_v_sdp_b.strides[0]) ))) >= (*((double *) ( /* dim=0 */ (__pyx_v_sdp.data + __pyx_t_39 * __pyx_v_sdp.strides[0]) )))) != 0); + if (__pyx_t_12) { - /* "cyext_acv.pyx":5718 - * if sdp[i] >= pi_level: - * subset = 0 - * for j in range(sufficient[i].size()): # <<<<<<<<<<<<<< - * a = 0 - * for k in range(sufficient[i][j].size()): + /* "cyext_acv.pyx":7690 + * sdp_b[R_buf[i]] = sdp_ba[i] + * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: + * sdp[R_buf[i]] = sdp_b[R_buf[i]] # <<<<<<<<<<<<<< + * len_s_star[R_buf[i]] = S_size + * for s in range(S_size): */ - __pyx_t_33 = (__pyx_v_sufficient[__pyx_v_i]).size(); - __pyx_t_34 = __pyx_t_33; - for (__pyx_t_35 = 0; __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) { - __pyx_v_j = __pyx_t_35; + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_38 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_32 * __pyx_v_R_buf.strides[0]) ))); + *((double *) ( /* dim=0 */ (__pyx_v_sdp.data + __pyx_t_33 * __pyx_v_sdp.strides[0]) )) = (*((double *) ( /* dim=0 */ (__pyx_v_sdp_b.data + __pyx_t_39 * __pyx_v_sdp_b.strides[0]) ))); - /* "cyext_acv.pyx":5719 - * subset = 0 - * for j in range(sufficient[i].size()): - * a = 0 # <<<<<<<<<<<<<< - * for k in range(sufficient[i][j].size()): - * if std_find[vector[long].iterator, long](power_cpp[s_0][s_1].begin(), power_cpp[s_0][s_1].end(), sufficient[i][j][k]) != power_cpp[s_0][s_1].end(): + /* "cyext_acv.pyx":7691 + * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: + * sdp[R_buf[i]] = sdp_b[R_buf[i]] + * len_s_star[R_buf[i]] = S_size # <<<<<<<<<<<<<< + * for s in range(S_size): + * s_star[R_buf[i], s] = S[s] */ - __pyx_v_a = 0; + __pyx_t_38 = __pyx_v_i; + (__pyx_v_len_s_star[(*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_38 * __pyx_v_R_buf.strides[0]) )))]) = __pyx_v_S_size; - /* "cyext_acv.pyx":5720 - * for j in range(sufficient[i].size()): - * a = 0 - * for k in range(sufficient[i][j].size()): # <<<<<<<<<<<<<< - * if std_find[vector[long].iterator, long](power_cpp[s_0][s_1].begin(), power_cpp[s_0][s_1].end(), sufficient[i][j][k]) != power_cpp[s_0][s_1].end(): - * a += 1 + /* "cyext_acv.pyx":7692 + * sdp[R_buf[i]] = sdp_b[R_buf[i]] + * len_s_star[R_buf[i]] = S_size + * for s in range(S_size): # <<<<<<<<<<<<<< + * s_star[R_buf[i], s] = S[s] + * */ - __pyx_t_30 = ((__pyx_v_sufficient[__pyx_v_i])[__pyx_v_j]).size(); - __pyx_t_31 = __pyx_t_30; - for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_31; __pyx_t_36+=1) { - __pyx_v_k = __pyx_t_36; + __pyx_t_40 = __pyx_v_S_size; + __pyx_t_41 = __pyx_t_40; + for (__pyx_t_42 = 0; __pyx_t_42 < __pyx_t_41; __pyx_t_42+=1) { + __pyx_v_s = __pyx_t_42; - /* "cyext_acv.pyx":5721 - * a = 0 - * for k in range(sufficient[i][j].size()): - * if std_find[vector[long].iterator, long](power_cpp[s_0][s_1].begin(), power_cpp[s_0][s_1].end(), sufficient[i][j][k]) != power_cpp[s_0][s_1].end(): # <<<<<<<<<<<<<< - * a += 1 - * if a == sufficient[i][j].size(): + /* "cyext_acv.pyx":7693 + * len_s_star[R_buf[i]] = S_size + * for s in range(S_size): + * s_star[R_buf[i], s] = S[s] # <<<<<<<<<<<<<< + * + * if S_size == X.shape[1]: + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_38 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_32 = __pyx_v_s; + *((long *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_s_star.data + __pyx_t_39 * __pyx_v_s_star.strides[0]) ) + __pyx_t_32 * __pyx_v_s_star.strides[1]) )) = (__pyx_v_S[__pyx_v_s]); + } + + /* "cyext_acv.pyx":7689 + * for i in range(N): + * sdp_b[R_buf[i]] = sdp_ba[i] + * if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: # <<<<<<<<<<<<<< + * sdp[R_buf[i]] = sdp_b[R_buf[i]] + * len_s_star[R_buf[i]] = S_size + */ + } + + /* "cyext_acv.pyx":7695 + * s_star[R_buf[i], s] = S[s] + * + * if S_size == X.shape[1]: # <<<<<<<<<<<<<< + * sdp[R_buf[i]] = 1 + * len_s_star[R_buf[i]] = S_size + */ + __pyx_t_12 = ((__pyx_v_S_size == (__pyx_v_X.shape[1])) != 0); + if (__pyx_t_12) { + + /* "cyext_acv.pyx":7696 + * + * if S_size == X.shape[1]: + * sdp[R_buf[i]] = 1 # <<<<<<<<<<<<<< + * len_s_star[R_buf[i]] = S_size + * for s in range(S_size): + */ + __pyx_t_38 = __pyx_v_i; + __pyx_t_32 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_38 * __pyx_v_R_buf.strides[0]) ))); + *((double *) ( /* dim=0 */ (__pyx_v_sdp.data + __pyx_t_32 * __pyx_v_sdp.strides[0]) )) = 1.0; + + /* "cyext_acv.pyx":7697 + * if S_size == X.shape[1]: + * sdp[R_buf[i]] = 1 + * len_s_star[R_buf[i]] = S_size # <<<<<<<<<<<<<< + * for s in range(S_size): + * s_star[R_buf[i], s] = S[s] + */ + __pyx_t_38 = __pyx_v_i; + (__pyx_v_len_s_star[(*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_38 * __pyx_v_R_buf.strides[0]) )))]) = __pyx_v_S_size; + + /* "cyext_acv.pyx":7698 + * sdp[R_buf[i]] = 1 + * len_s_star[R_buf[i]] = S_size + * for s in range(S_size): # <<<<<<<<<<<<<< + * s_star[R_buf[i], s] = S[s] + * for s in range(len_s_star[R_buf[i]], X.shape[1]): # to filter (important for coalition) + */ + __pyx_t_40 = __pyx_v_S_size; + __pyx_t_41 = __pyx_t_40; + for (__pyx_t_42 = 0; __pyx_t_42 < __pyx_t_41; __pyx_t_42+=1) { + __pyx_v_s = __pyx_t_42; + + /* "cyext_acv.pyx":7699 + * len_s_star[R_buf[i]] = S_size + * for s in range(S_size): + * s_star[R_buf[i], s] = S[s] # <<<<<<<<<<<<<< + * for s in range(len_s_star[R_buf[i]], X.shape[1]): # to filter (important for coalition) + * s_star[R_buf[i], s] = -1 */ - __pyx_t_8 = ((std::find ::iterator,long>(((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1]).begin(), ((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1]).end(), (((__pyx_v_sufficient[__pyx_v_i])[__pyx_v_j])[__pyx_v_k])) != ((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1]).end()) != 0); - if (__pyx_t_8) { + __pyx_t_38 = __pyx_v_i; + __pyx_t_32 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_38 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_39 = __pyx_v_s; + *((long *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_s_star.data + __pyx_t_32 * __pyx_v_s_star.strides[0]) ) + __pyx_t_39 * __pyx_v_s_star.strides[1]) )) = (__pyx_v_S[__pyx_v_s]); + } - /* "cyext_acv.pyx":5722 - * for k in range(sufficient[i][j].size()): - * if std_find[vector[long].iterator, long](power_cpp[s_0][s_1].begin(), power_cpp[s_0][s_1].end(), sufficient[i][j][k]) != power_cpp[s_0][s_1].end(): - * a += 1 # <<<<<<<<<<<<<< - * if a == sufficient[i][j].size(): - * subset = 1 + /* "cyext_acv.pyx":7700 + * for s in range(S_size): + * s_star[R_buf[i], s] = S[s] + * for s in range(len_s_star[R_buf[i]], X.shape[1]): # to filter (important for coalition) # <<<<<<<<<<<<<< + * s_star[R_buf[i], s] = -1 + * */ - __pyx_v_a = (__pyx_v_a + 1); + __pyx_t_14 = (__pyx_v_X.shape[1]); + __pyx_t_38 = __pyx_v_i; + __pyx_t_15 = __pyx_t_14; + for (__pyx_t_40 = (__pyx_v_len_s_star[(*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_38 * __pyx_v_R_buf.strides[0]) )))]); __pyx_t_40 < __pyx_t_15; __pyx_t_40+=1) { + __pyx_v_s = __pyx_t_40; - /* "cyext_acv.pyx":5721 - * a = 0 - * for k in range(sufficient[i][j].size()): - * if std_find[vector[long].iterator, long](power_cpp[s_0][s_1].begin(), power_cpp[s_0][s_1].end(), sufficient[i][j][k]) != power_cpp[s_0][s_1].end(): # <<<<<<<<<<<<<< - * a += 1 - * if a == sufficient[i][j].size(): + /* "cyext_acv.pyx":7701 + * s_star[R_buf[i], s] = S[s] + * for s in range(len_s_star[R_buf[i]], X.shape[1]): # to filter (important for coalition) + * s_star[R_buf[i], s] = -1 # <<<<<<<<<<<<<< + * + * for i in range(N): */ - } - } + __pyx_t_39 = __pyx_v_i; + __pyx_t_32 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_39 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_33 = __pyx_v_s; + *((long *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_s_star.data + __pyx_t_32 * __pyx_v_s_star.strides[0]) ) + __pyx_t_33 * __pyx_v_s_star.strides[1]) )) = -1L; + } - /* "cyext_acv.pyx":5723 - * if std_find[vector[long].iterator, long](power_cpp[s_0][s_1].begin(), power_cpp[s_0][s_1].end(), sufficient[i][j][k]) != power_cpp[s_0][s_1].end(): - * a += 1 - * if a == sufficient[i][j].size(): # <<<<<<<<<<<<<< - * subset = 1 - * break + /* "cyext_acv.pyx":7695 + * s_star[R_buf[i], s] = S[s] + * + * if S_size == X.shape[1]: # <<<<<<<<<<<<<< + * sdp[R_buf[i]] = 1 + * len_s_star[R_buf[i]] = S_size */ - __pyx_t_8 = ((__pyx_v_a == ((__pyx_v_sufficient[__pyx_v_i])[__pyx_v_j]).size()) != 0); - if (__pyx_t_8) { + } + } + } - /* "cyext_acv.pyx":5724 - * a += 1 - * if a == sufficient[i][j].size(): - * subset = 1 # <<<<<<<<<<<<<< - * break + /* "cyext_acv.pyx":7703 + * s_star[R_buf[i], s] = -1 * + * for i in range(N): # <<<<<<<<<<<<<< + * if sdp[R_buf[i]] >= pi_level: + * r.push_back(R[i]) */ - __pyx_v_subset = 1; + __pyx_t_8 = __pyx_v_N; + __pyx_t_9 = __pyx_t_8; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; - /* "cyext_acv.pyx":5725 - * if a == sufficient[i][j].size(): - * subset = 1 - * break # <<<<<<<<<<<<<< + /* "cyext_acv.pyx":7704 * - * if subset == 0: + * for i in range(N): + * if sdp[R_buf[i]] >= pi_level: # <<<<<<<<<<<<<< + * r.push_back(R[i]) + * for s in range(len_s_star[R_buf[i]]): */ - goto __pyx_L38_break; + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_38 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_12 = (((*((double *) ( /* dim=0 */ (__pyx_v_sdp.data + __pyx_t_39 * __pyx_v_sdp.strides[0]) ))) >= __pyx_v_pi_level) != 0); + if (__pyx_t_12) { - /* "cyext_acv.pyx":5723 - * if std_find[vector[long].iterator, long](power_cpp[s_0][s_1].begin(), power_cpp[s_0][s_1].end(), sufficient[i][j][k]) != power_cpp[s_0][s_1].end(): - * a += 1 - * if a == sufficient[i][j].size(): # <<<<<<<<<<<<<< - * subset = 1 - * break + /* "cyext_acv.pyx":7705 + * for i in range(N): + * if sdp[R_buf[i]] >= pi_level: + * r.push_back(R[i]) # <<<<<<<<<<<<<< + * for s in range(len_s_star[R_buf[i]]): + * sdp_global[s_star[R_buf[i], s]] += 1 */ - } - } - __pyx_L38_break:; + try { + __pyx_v_r.push_back((__pyx_v_R[__pyx_v_i])); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 7705, __pyx_L1_error) + } - /* "cyext_acv.pyx":5727 - * break + /* "cyext_acv.pyx":7706 + * if sdp[R_buf[i]] >= pi_level: + * r.push_back(R[i]) + * for s in range(len_s_star[R_buf[i]]): # <<<<<<<<<<<<<< + * sdp_global[s_star[R_buf[i], s]] += 1 * - * if subset == 0: # <<<<<<<<<<<<<< - * sufficient[i].push_back(power_cpp[s_0][s_1]) - * sufficient_sdp[i].push_back(sdp[i]) */ - __pyx_t_8 = ((__pyx_v_subset == 0) != 0); - if (__pyx_t_8) { + __pyx_t_38 = __pyx_v_i; + __pyx_t_22 = (__pyx_v_len_s_star[(*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_38 * __pyx_v_R_buf.strides[0]) )))]); + __pyx_t_40 = __pyx_t_22; + for (__pyx_t_41 = 0; __pyx_t_41 < __pyx_t_40; __pyx_t_41+=1) { + __pyx_v_s = __pyx_t_41; - /* "cyext_acv.pyx":5728 + /* "cyext_acv.pyx":7707 + * r.push_back(R[i]) + * for s in range(len_s_star[R_buf[i]]): + * sdp_global[s_star[R_buf[i], s]] += 1 # <<<<<<<<<<<<<< * - * if subset == 0: - * sufficient[i].push_back(power_cpp[s_0][s_1]) # <<<<<<<<<<<<<< - * sufficient_sdp[i].push_back(sdp[i]) - * for s in range(S_size): + * for i in range(r.size()): */ - try { - (__pyx_v_sufficient[__pyx_v_i]).push_back(((__pyx_v_power_cpp[__pyx_v_s_0])[__pyx_v_s_1])); - } catch(...) { - __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 5728, __pyx_L1_error) - } + __pyx_t_38 = __pyx_v_i; + __pyx_t_39 = (*((long *) ( /* dim=0 */ (__pyx_v_R_buf.data + __pyx_t_38 * __pyx_v_R_buf.strides[0]) ))); + __pyx_t_33 = __pyx_v_s; + __pyx_t_32 = (*((long *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_s_star.data + __pyx_t_39 * __pyx_v_s_star.strides[0]) ) + __pyx_t_33 * __pyx_v_s_star.strides[1]) ))); + *((double *) ( /* dim=0 */ (__pyx_v_sdp_global.data + __pyx_t_32 * __pyx_v_sdp_global.strides[0]) )) += 1.0; + } - /* "cyext_acv.pyx":5729 - * if subset == 0: - * sufficient[i].push_back(power_cpp[s_0][s_1]) - * sufficient_sdp[i].push_back(sdp[i]) # <<<<<<<<<<<<<< - * for s in range(S_size): - * sdp_global[S[s]] += 1 + /* "cyext_acv.pyx":7704 + * + * for i in range(N): + * if sdp[R_buf[i]] >= pi_level: # <<<<<<<<<<<<<< + * r.push_back(R[i]) + * for s in range(len_s_star[R_buf[i]]): */ - __pyx_t_32 = __pyx_v_i; - try { - (__pyx_v_sufficient_sdp[__pyx_v_i]).push_back((*((double *) ( /* dim=0 */ (__pyx_v_sdp.data + __pyx_t_32 * __pyx_v_sdp.strides[0]) )))); - } catch(...) { - __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 5729, __pyx_L1_error) - } + } + } - /* "cyext_acv.pyx":5730 - * sufficient[i].push_back(power_cpp[s_0][s_1]) - * sufficient_sdp[i].push_back(sdp[i]) - * for s in range(S_size): # <<<<<<<<<<<<<< - * sdp_global[S[s]] += 1 - * K += 1 + /* "cyext_acv.pyx":7709 + * sdp_global[s_star[R_buf[i], s]] += 1 + * + * for i in range(r.size()): # <<<<<<<<<<<<<< + * std_remove[vector[long].iterator, long](R.begin(), R.end(), r[i]) + * R.pop_back() */ - __pyx_t_35 = __pyx_v_S_size; - __pyx_t_36 = __pyx_t_35; - for (__pyx_t_37 = 0; __pyx_t_37 < __pyx_t_36; __pyx_t_37+=1) { - __pyx_v_s = __pyx_t_37; + __pyx_t_30 = __pyx_v_r.size(); + __pyx_t_31 = __pyx_t_30; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_31; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; - /* "cyext_acv.pyx":5731 - * sufficient_sdp[i].push_back(sdp[i]) - * for s in range(S_size): - * sdp_global[S[s]] += 1 # <<<<<<<<<<<<<< - * K += 1 + /* "cyext_acv.pyx":7710 + * + * for i in range(r.size()): + * std_remove[vector[long].iterator, long](R.begin(), R.end(), r[i]) # <<<<<<<<<<<<<< + * R.pop_back() * */ - __pyx_t_32 = (__pyx_v_S[__pyx_v_s]); - *((double *) ( /* dim=0 */ (__pyx_v_sdp_global.data + __pyx_t_32 * __pyx_v_sdp_global.strides[0]) )) += 1.0; - } + (void)(std::remove ::iterator,long>(__pyx_v_R.begin(), __pyx_v_R.end(), (__pyx_v_r[__pyx_v_i]))); - /* "cyext_acv.pyx":5732 - * for s in range(S_size): - * sdp_global[S[s]] += 1 - * K += 1 # <<<<<<<<<<<<<< + /* "cyext_acv.pyx":7711 + * for i in range(r.size()): + * std_remove[vector[long].iterator, long](R.begin(), R.end(), r[i]) + * R.pop_back() # <<<<<<<<<<<<<< * - * return sufficient, sufficient_sdp, np.asarray(sdp_global)/K + * if (R.size() == 0 or S_size >= X.shape[1]/2) and stop: */ - __pyx_v_K = (__pyx_v_K + 1.0); + __pyx_v_R.pop_back(); + } - /* "cyext_acv.pyx":5727 - * break + /* "cyext_acv.pyx":7713 + * R.pop_back() + * + * if (R.size() == 0 or S_size >= X.shape[1]/2) and stop: # <<<<<<<<<<<<<< + * break * - * if subset == 0: # <<<<<<<<<<<<<< - * sufficient[i].push_back(power_cpp[s_0][s_1]) - * sufficient_sdp[i].push_back(sdp[i]) */ - } + __pyx_t_19 = ((__pyx_v_R.size() == 0) != 0); + if (!__pyx_t_19) { + } else { + goto __pyx_L53_next_and; + } + __pyx_t_19 = ((__pyx_v_S_size >= ((__pyx_v_X.shape[1]) / 2)) != 0); + if (__pyx_t_19) { + } else { + __pyx_t_12 = __pyx_t_19; + goto __pyx_L52_bool_binop_done; + } + __pyx_L53_next_and:; + __pyx_t_19 = (__pyx_v_stop != 0); + __pyx_t_12 = __pyx_t_19; + __pyx_L52_bool_binop_done:; + if (__pyx_t_12) { - /* "cyext_acv.pyx":5716 + /* "cyext_acv.pyx":7714 + * + * if (R.size() == 0 or S_size >= X.shape[1]/2) and stop: + * break # <<<<<<<<<<<<<< + * + * return np.asarray(sdp_global)/X.shape[0], np.array(s_star, dtype=np.long), np.array(len_s_star, dtype=np.long), np.array(sdp) + */ + goto __pyx_L27_break; + + /* "cyext_acv.pyx":7713 + * R.pop_back() + * + * if (R.size() == 0 or S_size >= X.shape[1]/2) and stop: # <<<<<<<<<<<<<< + * break * - * for i in range(N): - * if sdp[i] >= pi_level: # <<<<<<<<<<<<<< - * subset = 0 - * for j in range(sufficient[i].size()): */ - } - } } - /* "cyext_acv.pyx":5706 - * cdef vector[vector[double]] sufficient_sdp = [[-1] for i in range(N)] + /* "cyext_acv.pyx":7663 + * S = np.zeros((data.shape[1]), dtype=np.int) * * for s_0 in tqdm(range(minimal, m + 1)): # <<<<<<<<<<<<<< * for s_1 in range(0, power_cpp[s_0].size()): * for i in range(power_cpp[s_0][s_1].size()): */ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_L27_break:; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "cyext_acv.pyx":5734 - * K += 1 + /* "cyext_acv.pyx":7716 + * break * - * return sufficient, sufficient_sdp, np.asarray(sdp_global)/K # <<<<<<<<<<<<<< + * return np.asarray(sdp_global)/X.shape[0], np.array(s_star, dtype=np.long), np.array(len_s_star, dtype=np.long), np.array(sdp) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_convert_vector_to_py_std_3a__3a_vector_3c_std_3a__3a_vector_3c_long_3e____3e___(__pyx_v_sufficient); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5734, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_21 = __pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___(__pyx_v_sufficient_sdp); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 5734, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_21); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5734, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5734, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_sdp_global, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5734, __pyx_L1_error) + __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_sdp_global, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = NULL; + __pyx_t_24 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { + __pyx_t_24 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_24)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_24); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } - __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = (__pyx_t_24) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_24, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); + __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5734, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_K); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5734, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_X.shape[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5734, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 7716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5734, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_21); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_21); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7716, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_s_star, 2, (PyObject *(*)(char *)) __pyx_memview_get_long, (int (*)(char *, PyObject *)) __pyx_memview_set_long, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7716, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_24 = PyTuple_New(1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7716, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7716, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7716, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_long); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7716, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 7716, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_24, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7716, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7716, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7716, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_convert_vector_to_py_int(__pyx_v_len_s_star); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7716, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7716, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7716, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7716, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_43 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_long); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 7716, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_43); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_43) < 0) __PYX_ERR(0, 7716, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0; + __pyx_t_43 = __Pyx_PyObject_Call(__pyx_t_24, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 7716, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_43); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7716, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7716, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_sdp, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7716, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_24))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_24); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_24); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_24, function); + } + } + __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_24, __pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_24, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7716, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = PyTuple_New(4); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 7716, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_6); - __pyx_t_1 = 0; - __pyx_t_21 = 0; + PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_43); + PyTuple_SET_ITEM(__pyx_t_24, 2, __pyx_t_43); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_24, 3, __pyx_t_2); __pyx_t_6 = 0; - __pyx_r = __pyx_t_2; + __pyx_t_4 = 0; + __pyx_t_43 = 0; __pyx_t_2 = 0; + __pyx_r = __pyx_t_24; + __pyx_t_24 = 0; goto __pyx_L0; - /* "cyext_acv.pyx":5646 + /* "cyext_acv.pyx":7584 * @cython.nonecheck(False) * @cython.cdivision(True) - * cpdef sufficient_expl_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, # <<<<<<<<<<<<<< + * cpdef global_cdp_intv(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, # <<<<<<<<<<<<<< * int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, - * int max_depth, int min_node_size, int & classifier, double & t, list C, double pi_level, + * const double [:, :, :] & cond, */ /* function exit code */ @@ -88342,15 +119585,29 @@ static PyObject *__pyx_f_9cyext_acv_sufficient_expl_rf(__Pyx_memviewslice __pyx_ __Pyx_XDECREF(__pyx_t_4); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_21); - __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1); - __Pyx_AddTraceback("cyext_acv.sufficient_expl_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1); + __Pyx_XDECREF(__pyx_t_24); + __PYX_XDEC_MEMVIEW(&__pyx_t_27, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_34, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_35, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_36, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_37, 1); + __Pyx_XDECREF(__pyx_t_43); + __Pyx_AddTraceback("cyext_acv.global_cdp_intv", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __PYX_XDEC_MEMVIEW(&__pyx_v_sdp, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp_b, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_sdp_ba, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_sdp_global, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_in_data, 1); __Pyx_XDECREF(__pyx_v_power); __Pyx_XDECREF(__pyx_v_va_id); + __PYX_XDEC_MEMVIEW(&__pyx_v_R_buf, 1); + __Pyx_XDECREF(__pyx_v_X_arr); + __Pyx_XDECREF(__pyx_v_y_X_arr); + __Pyx_XDECREF(__pyx_v_cond_arr); + __Pyx_XDECREF(__pyx_v_t_arr); __Pyx_XDECREF(__pyx_v_remove_va); __Pyx_XDECREF(__pyx_v_power_b); __Pyx_XDECREF(__pyx_v_co); @@ -88361,8 +119618,8 @@ static PyObject *__pyx_f_9cyext_acv_sufficient_expl_rf(__Pyx_memviewslice __pyx_ } /* Python wrapper */ -static PyObject *__pyx_pw_9cyext_acv_89sufficient_expl_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_9cyext_acv_89sufficient_expl_rf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_9cyext_acv_131global_cdp_intv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_9cyext_acv_131global_cdp_intv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { __Pyx_memviewslice __pyx_v_X = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_y_X = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } }; @@ -88371,10 +119628,11 @@ static PyObject *__pyx_pw_9cyext_acv_89sufficient_expl_rf(PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_thresholds = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_children_left = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_children_right = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_cond = { 0, 0, { 0 }, { 0 }, { 0 } }; int __pyx_v_max_depth; int __pyx_v_min_node_size; int __pyx_v_classifier; - double __pyx_v_t; + __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } }; PyObject *__pyx_v_C = 0; double __pyx_v_pi_level; int __pyx_v_minimal; @@ -88385,14 +119643,16 @@ static PyObject *__pyx_pw_9cyext_acv_89sufficient_expl_rf(PyObject *__pyx_self, int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("sufficient_expl_rf (wrapper)", 0); + __Pyx_RefNannySetupContext("global_cdp_intv (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_y_X,&__pyx_n_s_data,&__pyx_n_s_y_data,&__pyx_n_s_features,&__pyx_n_s_thresholds,&__pyx_n_s_children_left,&__pyx_n_s_children_right,&__pyx_n_s_max_depth,&__pyx_n_s_min_node_size,&__pyx_n_s_classifier,&__pyx_n_s_t,&__pyx_n_s_C,&__pyx_n_s_pi_level,&__pyx_n_s_minimal,&__pyx_n_s_stop,&__pyx_n_s_search_space,0}; - PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_y_X,&__pyx_n_s_data,&__pyx_n_s_y_data,&__pyx_n_s_features,&__pyx_n_s_thresholds,&__pyx_n_s_children_left,&__pyx_n_s_children_right,&__pyx_n_s_cond,&__pyx_n_s_max_depth,&__pyx_n_s_min_node_size,&__pyx_n_s_classifier,&__pyx_n_s_t,&__pyx_n_s_C,&__pyx_n_s_pi_level,&__pyx_n_s_minimal,&__pyx_n_s_stop,&__pyx_n_s_search_space,0}; + PyObject* values[18] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { + case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17); + CYTHON_FALLTHROUGH; case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16); CYTHON_FALLTHROUGH; case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15); @@ -88439,103 +119699,109 @@ static PyObject *__pyx_pw_9cyext_acv_89sufficient_expl_rf(PyObject *__pyx_self, case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_X)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, 1); __PYX_ERR(0, 5646, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("global_cdp_intv", 1, 18, 18, 1); __PYX_ERR(0, 7584, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, 2); __PYX_ERR(0, 5646, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("global_cdp_intv", 1, 18, 18, 2); __PYX_ERR(0, 7584, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_data)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, 3); __PYX_ERR(0, 5646, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("global_cdp_intv", 1, 18, 18, 3); __PYX_ERR(0, 7584, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_features)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, 4); __PYX_ERR(0, 5646, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("global_cdp_intv", 1, 18, 18, 4); __PYX_ERR(0, 7584, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thresholds)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, 5); __PYX_ERR(0, 5646, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("global_cdp_intv", 1, 18, 18, 5); __PYX_ERR(0, 7584, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_left)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, 6); __PYX_ERR(0, 5646, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("global_cdp_intv", 1, 18, 18, 6); __PYX_ERR(0, 7584, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_right)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, 7); __PYX_ERR(0, 5646, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("global_cdp_intv", 1, 18, 18, 7); __PYX_ERR(0, 7584, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 8: - if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; + if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cond)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, 8); __PYX_ERR(0, 5646, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("global_cdp_intv", 1, 18, 18, 8); __PYX_ERR(0, 7584, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 9: - if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_node_size)) != 0)) kw_args--; + if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, 9); __PYX_ERR(0, 5646, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("global_cdp_intv", 1, 18, 18, 9); __PYX_ERR(0, 7584, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 10: - if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classifier)) != 0)) kw_args--; + if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_node_size)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, 10); __PYX_ERR(0, 5646, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("global_cdp_intv", 1, 18, 18, 10); __PYX_ERR(0, 7584, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 11: - if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; + if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classifier)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, 11); __PYX_ERR(0, 5646, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("global_cdp_intv", 1, 18, 18, 11); __PYX_ERR(0, 7584, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 12: - if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C)) != 0)) kw_args--; + if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, 12); __PYX_ERR(0, 5646, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("global_cdp_intv", 1, 18, 18, 12); __PYX_ERR(0, 7584, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 13: - if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pi_level)) != 0)) kw_args--; + if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, 13); __PYX_ERR(0, 5646, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("global_cdp_intv", 1, 18, 18, 13); __PYX_ERR(0, 7584, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 14: - if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minimal)) != 0)) kw_args--; + if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pi_level)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, 14); __PYX_ERR(0, 5646, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("global_cdp_intv", 1, 18, 18, 14); __PYX_ERR(0, 7584, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 15: - if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--; + if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minimal)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, 15); __PYX_ERR(0, 5646, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("global_cdp_intv", 1, 18, 18, 15); __PYX_ERR(0, 7584, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 16: - if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_search_space)) != 0)) kw_args--; + if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("global_cdp_intv", 1, 18, 18, 16); __PYX_ERR(0, 7584, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 17: + if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_search_space)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, 16); __PYX_ERR(0, 5646, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("global_cdp_intv", 1, 18, 18, 17); __PYX_ERR(0, 7584, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sufficient_expl_rf") < 0)) __PYX_ERR(0, 5646, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "global_cdp_intv") < 0)) __PYX_ERR(0, 7584, __pyx_L3_error) } - } else if (PyTuple_GET_SIZE(__pyx_args) != 17) { + } else if (PyTuple_GET_SIZE(__pyx_args) != 18) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); @@ -88555,36 +119821,38 @@ static PyObject *__pyx_pw_9cyext_acv_89sufficient_expl_rf(PyObject *__pyx_self, values[14] = PyTuple_GET_ITEM(__pyx_args, 14); values[15] = PyTuple_GET_ITEM(__pyx_args, 15); values[16] = PyTuple_GET_ITEM(__pyx_args, 16); - } - __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 5646, __pyx_L3_error) - __pyx_v_y_X = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_X.memview)) __PYX_ERR(0, 5646, __pyx_L3_error) - __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 5646, __pyx_L3_error) - __pyx_v_y_data = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_data.memview)) __PYX_ERR(0, 5646, __pyx_L3_error) - __pyx_v_features = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_features.memview)) __PYX_ERR(0, 5647, __pyx_L3_error) - __pyx_v_thresholds = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_thresholds.memview)) __PYX_ERR(0, 5647, __pyx_L3_error) - __pyx_v_children_left = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_left.memview)) __PYX_ERR(0, 5647, __pyx_L3_error) - __pyx_v_children_right = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_right.memview)) __PYX_ERR(0, 5647, __pyx_L3_error) - __pyx_v_max_depth = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5648, __pyx_L3_error) - __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5648, __pyx_L3_error) - __pyx_v_classifier = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5648, __pyx_L3_error) - __pyx_v_t = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5648, __pyx_L3_error) - __pyx_v_C = ((PyObject*)values[12]); - __pyx_v_pi_level = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_pi_level == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5648, __pyx_L3_error) - __pyx_v_minimal = __Pyx_PyInt_As_int(values[14]); if (unlikely((__pyx_v_minimal == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5649, __pyx_L3_error) - __pyx_v_stop = __Pyx_PyObject_IsTrue(values[15]); if (unlikely((__pyx_v_stop == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5649, __pyx_L3_error) - __pyx_v_search_space = ((PyObject*)values[16]); + values[17] = PyTuple_GET_ITEM(__pyx_args, 17); + } + __pyx_v_X = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_X.memview)) __PYX_ERR(0, 7584, __pyx_L3_error) + __pyx_v_y_X = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_X.memview)) __PYX_ERR(0, 7584, __pyx_L3_error) + __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 7584, __pyx_L3_error) + __pyx_v_y_data = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y_data.memview)) __PYX_ERR(0, 7584, __pyx_L3_error) + __pyx_v_features = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_features.memview)) __PYX_ERR(0, 7585, __pyx_L3_error) + __pyx_v_thresholds = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_thresholds.memview)) __PYX_ERR(0, 7585, __pyx_L3_error) + __pyx_v_children_left = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_left.memview)) __PYX_ERR(0, 7585, __pyx_L3_error) + __pyx_v_children_right = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[7], PyBUF_WRITABLE); if (unlikely(!__pyx_v_children_right.memview)) __PYX_ERR(0, 7585, __pyx_L3_error) + __pyx_v_cond = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double__const__(values[8], 0); if (unlikely(!__pyx_v_cond.memview)) __PYX_ERR(0, 7586, __pyx_L3_error) + __pyx_v_max_depth = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7587, __pyx_L3_error) + __pyx_v_min_node_size = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_min_node_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7587, __pyx_L3_error) + __pyx_v_classifier = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_classifier == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7587, __pyx_L3_error) + __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[12], PyBUF_WRITABLE); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 7587, __pyx_L3_error) + __pyx_v_C = ((PyObject*)values[13]); + __pyx_v_pi_level = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_pi_level == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 7587, __pyx_L3_error) + __pyx_v_minimal = __Pyx_PyInt_As_int(values[15]); if (unlikely((__pyx_v_minimal == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7588, __pyx_L3_error) + __pyx_v_stop = __Pyx_PyObject_IsTrue(values[16]); if (unlikely((__pyx_v_stop == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 7588, __pyx_L3_error) + __pyx_v_search_space = ((PyObject*)values[17]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("sufficient_expl_rf", 1, 17, 17, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5646, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("global_cdp_intv", 1, 18, 18, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7584, __pyx_L3_error) __pyx_L3_error:; - __Pyx_AddTraceback("cyext_acv.sufficient_expl_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("cyext_acv.global_cdp_intv", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_C), (&PyList_Type), 1, "C", 1))) __PYX_ERR(0, 5648, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_search_space), (&PyList_Type), 1, "search_space", 1))) __PYX_ERR(0, 5649, __pyx_L1_error) - __pyx_r = __pyx_pf_9cyext_acv_88sufficient_expl_rf(__pyx_self, __pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_v_C, __pyx_v_pi_level, __pyx_v_minimal, __pyx_v_stop, __pyx_v_search_space); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_C), (&PyList_Type), 1, "C", 1))) __PYX_ERR(0, 7587, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_search_space), (&PyList_Type), 1, "search_space", 1))) __PYX_ERR(0, 7588, __pyx_L1_error) + __pyx_r = __pyx_pf_9cyext_acv_130global_cdp_intv(__pyx_self, __pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_cond, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_v_C, __pyx_v_pi_level, __pyx_v_minimal, __pyx_v_stop, __pyx_v_search_space); /* function exit code */ goto __pyx_L0; @@ -88595,24 +119863,26 @@ static PyObject *__pyx_pw_9cyext_acv_89sufficient_expl_rf(PyObject *__pyx_self, return __pyx_r; } -static PyObject *__pyx_pf_9cyext_acv_88sufficient_expl_rf(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, double __pyx_v_t, PyObject *__pyx_v_C, double __pyx_v_pi_level, int __pyx_v_minimal, int __pyx_v_stop, PyObject *__pyx_v_search_space) { +static PyObject *__pyx_pf_9cyext_acv_130global_cdp_intv(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_X, __Pyx_memviewslice __pyx_v_y_X, __Pyx_memviewslice __pyx_v_data, __Pyx_memviewslice __pyx_v_y_data, __Pyx_memviewslice __pyx_v_features, __Pyx_memviewslice __pyx_v_thresholds, __Pyx_memviewslice __pyx_v_children_left, __Pyx_memviewslice __pyx_v_children_right, __Pyx_memviewslice __pyx_v_cond, int __pyx_v_max_depth, int __pyx_v_min_node_size, int __pyx_v_classifier, __Pyx_memviewslice __pyx_v_t, PyObject *__pyx_v_C, double __pyx_v_pi_level, int __pyx_v_minimal, int __pyx_v_stop, PyObject *__pyx_v_search_space) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("sufficient_expl_rf", 0); + __Pyx_RefNannySetupContext("global_cdp_intv", 0); __Pyx_XDECREF(__pyx_r); - if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundLocalError("X"); __PYX_ERR(0, 5646, __pyx_L1_error) } - if (unlikely(!__pyx_v_y_X.memview)) { __Pyx_RaiseUnboundLocalError("y_X"); __PYX_ERR(0, 5646, __pyx_L1_error) } - if (unlikely(!__pyx_v_data.memview)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 5646, __pyx_L1_error) } - if (unlikely(!__pyx_v_y_data.memview)) { __Pyx_RaiseUnboundLocalError("y_data"); __PYX_ERR(0, 5646, __pyx_L1_error) } - if (unlikely(!__pyx_v_features.memview)) { __Pyx_RaiseUnboundLocalError("features"); __PYX_ERR(0, 5646, __pyx_L1_error) } - if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 5646, __pyx_L1_error) } - if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 5646, __pyx_L1_error) } - if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 5646, __pyx_L1_error) } - __pyx_t_1 = __pyx_f_9cyext_acv_sufficient_expl_rf(__pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_v_C, __pyx_v_pi_level, __pyx_v_minimal, __pyx_v_stop, __pyx_v_search_space, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5646, __pyx_L1_error) + if (unlikely(!__pyx_v_X.memview)) { __Pyx_RaiseUnboundLocalError("X"); __PYX_ERR(0, 7584, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_X.memview)) { __Pyx_RaiseUnboundLocalError("y_X"); __PYX_ERR(0, 7584, __pyx_L1_error) } + if (unlikely(!__pyx_v_data.memview)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 7584, __pyx_L1_error) } + if (unlikely(!__pyx_v_y_data.memview)) { __Pyx_RaiseUnboundLocalError("y_data"); __PYX_ERR(0, 7584, __pyx_L1_error) } + if (unlikely(!__pyx_v_features.memview)) { __Pyx_RaiseUnboundLocalError("features"); __PYX_ERR(0, 7584, __pyx_L1_error) } + if (unlikely(!__pyx_v_thresholds.memview)) { __Pyx_RaiseUnboundLocalError("thresholds"); __PYX_ERR(0, 7584, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_left.memview)) { __Pyx_RaiseUnboundLocalError("children_left"); __PYX_ERR(0, 7584, __pyx_L1_error) } + if (unlikely(!__pyx_v_children_right.memview)) { __Pyx_RaiseUnboundLocalError("children_right"); __PYX_ERR(0, 7584, __pyx_L1_error) } + if (unlikely(!__pyx_v_cond.memview)) { __Pyx_RaiseUnboundLocalError("cond"); __PYX_ERR(0, 7584, __pyx_L1_error) } + if (unlikely(!__pyx_v_t.memview)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 7584, __pyx_L1_error) } + __pyx_t_1 = __pyx_f_9cyext_acv_global_cdp_intv(__pyx_v_X, __pyx_v_y_X, __pyx_v_data, __pyx_v_y_data, __pyx_v_features, __pyx_v_thresholds, __pyx_v_children_left, __pyx_v_children_right, __pyx_v_cond, __pyx_v_max_depth, __pyx_v_min_node_size, __pyx_v_classifier, __pyx_v_t, __pyx_v_C, __pyx_v_pi_level, __pyx_v_minimal, __pyx_v_stop, __pyx_v_search_space, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -88621,7 +119891,7 @@ static PyObject *__pyx_pf_9cyext_acv_88sufficient_expl_rf(CYTHON_UNUSED PyObject /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cyext_acv.sufficient_expl_rf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("cyext_acv.global_cdp_intv", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __PYX_XDEC_MEMVIEW(&__pyx_v_X, 1); @@ -88632,12 +119902,14 @@ static PyObject *__pyx_pf_9cyext_acv_88sufficient_expl_rf(CYTHON_UNUSED PyObject __PYX_XDEC_MEMVIEW(&__pyx_v_thresholds, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_children_left, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_children_right, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_cond, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_t, 1); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":735 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":735 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -88654,7 +119926,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":736 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":736 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -88668,7 +119940,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":735 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":735 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -88687,7 +119959,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":738 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":738 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -88704,7 +119976,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":739 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":739 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -88718,7 +119990,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":738 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":738 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -88737,7 +120009,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":741 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":741 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -88754,7 +120026,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":742 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":742 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -88768,7 +120040,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":741 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":741 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -88787,7 +120059,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":744 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":744 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -88804,7 +120076,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":745 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":745 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -88818,7 +120090,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":744 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":744 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -88837,7 +120109,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":747 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":747 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -88854,7 +120126,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":748 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":748 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -88868,7 +120140,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":747 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":747 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -88887,7 +120159,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":750 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":750 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -88901,7 +120173,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ int __pyx_t_1; __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":751 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":751 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -88911,7 +120183,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0); if (__pyx_t_1) { - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":752 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":752 * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape # <<<<<<<<<<<<<< @@ -88923,7 +120195,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":751 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":751 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -88932,7 +120204,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ */ } - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":754 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":754 * return d.subarray.shape * else: * return () # <<<<<<<<<<<<<< @@ -88946,7 +120218,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; } - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":750 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":750 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -88961,7 +120233,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":929 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":929 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -88973,7 +120245,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":930 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":930 * * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< @@ -88982,7 +120254,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":931 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":931 * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< @@ -88991,7 +120263,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base)); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":929 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":929 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -89003,7 +120275,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":933 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":933 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -89018,7 +120290,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":934 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":934 * * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< @@ -89027,7 +120299,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ __pyx_v_base = PyArray_BASE(__pyx_v_arr); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":935 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":935 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -89037,7 +120309,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = ((__pyx_v_base == NULL) != 0); if (__pyx_t_1) { - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":936 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":936 * base = PyArray_BASE(arr) * if base is NULL: * return None # <<<<<<<<<<<<<< @@ -89048,7 +120320,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":935 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":935 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -89057,7 +120329,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":937 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":937 * if base is NULL: * return None * return base # <<<<<<<<<<<<<< @@ -89069,7 +120341,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = ((PyObject *)__pyx_v_base); goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":933 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":933 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -89084,7 +120356,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":941 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":941 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -89108,7 +120380,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_array", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":942 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":942 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -89124,7 +120396,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":943 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":943 * cdef inline int import_array() except -1: * try: * __pyx_import_array() # <<<<<<<<<<<<<< @@ -89133,7 +120405,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { */ __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 943, __pyx_L3_error) - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":942 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":942 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -89147,7 +120419,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":944 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":944 * try: * __pyx_import_array() * except Exception: # <<<<<<<<<<<<<< @@ -89162,7 +120434,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":945 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":945 * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -89178,7 +120450,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":942 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":942 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -89193,7 +120465,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":941 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":941 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -89216,7 +120488,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":947 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":947 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -89240,7 +120512,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_umath", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":948 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":948 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -89256,7 +120528,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":949 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":949 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -89265,7 +120537,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { */ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 949, __pyx_L3_error) - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":948 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":948 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -89279,7 +120551,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":950 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":950 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -89294,7 +120566,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":951 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":951 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -89310,7 +120582,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":948 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":948 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -89325,7 +120597,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":947 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":947 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -89348,7 +120620,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":953 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":953 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -89372,7 +120644,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":954 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":954 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -89388,7 +120660,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":955 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":955 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -89397,7 +120669,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { */ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 955, __pyx_L3_error) - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":954 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":954 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -89411,7 +120683,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":956 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":956 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -89426,7 +120698,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":957 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":957 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -89442,7 +120714,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":954 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":954 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -89457,7 +120729,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":953 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":953 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -89480,7 +120752,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":967 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":967 * * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< @@ -89493,7 +120765,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_timedelta64_object", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":979 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":979 * bool * """ * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< @@ -89503,7 +120775,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":967 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":967 * * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< @@ -89517,7 +120789,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":982 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":982 * * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< @@ -89530,7 +120802,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_datetime64_object", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":994 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":994 * bool * """ * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< @@ -89540,7 +120812,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":982 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":982 * * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< @@ -89554,7 +120826,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":997 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":997 * * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -89565,7 +120837,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) { npy_datetime __pyx_r; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1004 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":1004 * also needed. That can be found using `get_datetime64_unit`. * """ * return (obj).obval # <<<<<<<<<<<<<< @@ -89575,7 +120847,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":997 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":997 * * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -89588,7 +120860,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1007 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":1007 * * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -89599,7 +120871,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) { npy_timedelta __pyx_r; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1011 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":1011 * returns the int64 value underlying scalar numpy timedelta64 object * """ * return (obj).obval # <<<<<<<<<<<<<< @@ -89609,7 +120881,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1007 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":1007 * * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -89622,7 +120894,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1014 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":1014 * * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< @@ -89633,7 +120905,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) { NPY_DATETIMEUNIT __pyx_r; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1018 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":1018 * returns the unit part of the dtype for a numpy datetime64 object. * """ * return (obj).obmeta.base # <<<<<<<<<<<<<< @@ -89641,7 +120913,7 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base); goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1014 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":1014 * * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< @@ -90826,7 +122098,7 @@ static PyObject *__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___(co return __pyx_r; } -/* "View.MemoryView":122 +/* "View.MemoryView":123 * cdef bint dtype_is_object * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< @@ -90878,13 +122150,13 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 122, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 123, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 122, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 123, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: @@ -90900,7 +122172,7 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 122, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 123, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -90916,14 +122188,14 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P } } __pyx_v_shape = ((PyObject*)values[0]); - __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 122, __pyx_L3_error) + __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 123, __pyx_L3_error) __pyx_v_format = values[2]; __pyx_v_mode = values[3]; if (values[4]) { - __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 123, __pyx_L3_error) + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 124, __pyx_L3_error) } else { - /* "View.MemoryView":123 + /* "View.MemoryView":124 * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<< @@ -90935,19 +122207,19 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 122, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 123, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 122, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 123, __pyx_L1_error) if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 122, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 123, __pyx_L1_error) } __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer); - /* "View.MemoryView":122 + /* "View.MemoryView":123 * cdef bint dtype_is_object * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< @@ -90989,7 +122261,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __Pyx_RefNannySetupContext("__cinit__", 0); __Pyx_INCREF(__pyx_v_format); - /* "View.MemoryView":129 + /* "View.MemoryView":130 * cdef PyObject **p * * self.ndim = len(shape) # <<<<<<<<<<<<<< @@ -90998,12 +122270,12 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ if (unlikely(__pyx_v_shape == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(2, 129, __pyx_L1_error) + __PYX_ERR(2, 130, __pyx_L1_error) } - __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(2, 129, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(2, 130, __pyx_L1_error) __pyx_v_self->ndim = ((int)__pyx_t_1); - /* "View.MemoryView":130 + /* "View.MemoryView":131 * * self.ndim = len(shape) * self.itemsize = itemsize # <<<<<<<<<<<<<< @@ -91012,7 +122284,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ __pyx_v_self->itemsize = __pyx_v_itemsize; - /* "View.MemoryView":132 + /* "View.MemoryView":133 * self.itemsize = itemsize * * if not self.ndim: # <<<<<<<<<<<<<< @@ -91022,20 +122294,20 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0); if (unlikely(__pyx_t_2)) { - /* "View.MemoryView":133 + /* "View.MemoryView":134 * * if not self.ndim: * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< * * if itemsize <= 0: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 133, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 133, __pyx_L1_error) + __PYX_ERR(2, 134, __pyx_L1_error) - /* "View.MemoryView":132 + /* "View.MemoryView":133 * self.itemsize = itemsize * * if not self.ndim: # <<<<<<<<<<<<<< @@ -91044,7 +122316,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ } - /* "View.MemoryView":135 + /* "View.MemoryView":136 * raise ValueError("Empty shape tuple for cython.array") * * if itemsize <= 0: # <<<<<<<<<<<<<< @@ -91054,20 +122326,20 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0); if (unlikely(__pyx_t_2)) { - /* "View.MemoryView":136 + /* "View.MemoryView":137 * * if itemsize <= 0: * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< * * if not isinstance(format, bytes): */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 136, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 136, __pyx_L1_error) + __PYX_ERR(2, 137, __pyx_L1_error) - /* "View.MemoryView":135 + /* "View.MemoryView":136 * raise ValueError("Empty shape tuple for cython.array") * * if itemsize <= 0: # <<<<<<<<<<<<<< @@ -91076,7 +122348,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ } - /* "View.MemoryView":138 + /* "View.MemoryView":139 * raise ValueError("itemsize <= 0 for cython.array") * * if not isinstance(format, bytes): # <<<<<<<<<<<<<< @@ -91087,14 +122359,14 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_4) { - /* "View.MemoryView":139 + /* "View.MemoryView":140 * * if not isinstance(format, bytes): * format = format.encode('ASCII') # <<<<<<<<<<<<<< * self._format = format # keep a reference to the byte string * self.format = self._format */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 139, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { @@ -91108,13 +122380,13 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ } __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 139, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":138 + /* "View.MemoryView":139 * raise ValueError("itemsize <= 0 for cython.array") * * if not isinstance(format, bytes): # <<<<<<<<<<<<<< @@ -91123,14 +122395,14 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ } - /* "View.MemoryView":140 + /* "View.MemoryView":141 * if not isinstance(format, bytes): * format = format.encode('ASCII') * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<< * self.format = self._format * */ - if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(2, 140, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(2, 141, __pyx_L1_error) __pyx_t_3 = __pyx_v_format; __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); @@ -91139,7 +122411,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_v_self->_format = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":141 + /* "View.MemoryView":142 * format = format.encode('ASCII') * self._format = format # keep a reference to the byte string * self.format = self._format # <<<<<<<<<<<<<< @@ -91148,12 +122420,12 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ if (unlikely(__pyx_v_self->_format == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(2, 141, __pyx_L1_error) + __PYX_ERR(2, 142, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(2, 141, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(2, 142, __pyx_L1_error) __pyx_v_self->format = __pyx_t_7; - /* "View.MemoryView":144 + /* "View.MemoryView":145 * * * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<< @@ -91162,7 +122434,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2))); - /* "View.MemoryView":145 + /* "View.MemoryView":146 * * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<< @@ -91171,7 +122443,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim); - /* "View.MemoryView":147 + /* "View.MemoryView":148 * self._strides = self._shape + self.ndim * * if not self._shape: # <<<<<<<<<<<<<< @@ -91181,20 +122453,20 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0); if (unlikely(__pyx_t_4)) { - /* "View.MemoryView":148 + /* "View.MemoryView":149 * * if not self._shape: * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< * * */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 148, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 148, __pyx_L1_error) + __PYX_ERR(2, 149, __pyx_L1_error) - /* "View.MemoryView":147 + /* "View.MemoryView":148 * self._strides = self._shape + self.ndim * * if not self._shape: # <<<<<<<<<<<<<< @@ -91203,7 +122475,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ } - /* "View.MemoryView":151 + /* "View.MemoryView":152 * * * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< @@ -91215,18 +122487,18 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ for (;;) { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(2, 151, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(2, 152, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 151, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 151, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_dim = __pyx_t_9; __pyx_v_idx = __pyx_t_8; __pyx_t_8 = (__pyx_t_8 + 1); - /* "View.MemoryView":152 + /* "View.MemoryView":153 * * for idx, dim in enumerate(shape): * if dim <= 0: # <<<<<<<<<<<<<< @@ -91236,18 +122508,18 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_t_4 = ((__pyx_v_dim <= 0) != 0); if (unlikely(__pyx_t_4)) { - /* "View.MemoryView":153 + /* "View.MemoryView":154 * for idx, dim in enumerate(shape): * if dim <= 0: * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<< * self._shape[idx] = dim * */ - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 153, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 153, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 153, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); @@ -91255,17 +122527,17 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6); __pyx_t_5 = 0; __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 153, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 153, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __PYX_ERR(2, 153, __pyx_L1_error) + __PYX_ERR(2, 154, __pyx_L1_error) - /* "View.MemoryView":152 + /* "View.MemoryView":153 * * for idx, dim in enumerate(shape): * if dim <= 0: # <<<<<<<<<<<<<< @@ -91274,7 +122546,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ } - /* "View.MemoryView":154 + /* "View.MemoryView":155 * if dim <= 0: * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) * self._shape[idx] = dim # <<<<<<<<<<<<<< @@ -91283,7 +122555,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim; - /* "View.MemoryView":151 + /* "View.MemoryView":152 * * * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< @@ -91293,17 +122565,17 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":157 + /* "View.MemoryView":158 * * cdef char order * if mode == 'fortran': # <<<<<<<<<<<<<< * order = b'F' * self.mode = u'fortran' */ - __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 157, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 158, __pyx_L1_error) if (__pyx_t_4) { - /* "View.MemoryView":158 + /* "View.MemoryView":159 * cdef char order * if mode == 'fortran': * order = b'F' # <<<<<<<<<<<<<< @@ -91312,7 +122584,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ __pyx_v_order = 'F'; - /* "View.MemoryView":159 + /* "View.MemoryView":160 * if mode == 'fortran': * order = b'F' * self.mode = u'fortran' # <<<<<<<<<<<<<< @@ -91325,7 +122597,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __Pyx_DECREF(__pyx_v_self->mode); __pyx_v_self->mode = __pyx_n_u_fortran; - /* "View.MemoryView":157 + /* "View.MemoryView":158 * * cdef char order * if mode == 'fortran': # <<<<<<<<<<<<<< @@ -91335,17 +122607,17 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ goto __pyx_L10; } - /* "View.MemoryView":160 + /* "View.MemoryView":161 * order = b'F' * self.mode = u'fortran' * elif mode == 'c': # <<<<<<<<<<<<<< * order = b'C' * self.mode = u'c' */ - __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 160, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 161, __pyx_L1_error) if (likely(__pyx_t_4)) { - /* "View.MemoryView":161 + /* "View.MemoryView":162 * self.mode = u'fortran' * elif mode == 'c': * order = b'C' # <<<<<<<<<<<<<< @@ -91354,7 +122626,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ __pyx_v_order = 'C'; - /* "View.MemoryView":162 + /* "View.MemoryView":163 * elif mode == 'c': * order = b'C' * self.mode = u'c' # <<<<<<<<<<<<<< @@ -91367,7 +122639,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __Pyx_DECREF(__pyx_v_self->mode); __pyx_v_self->mode = __pyx_n_u_c; - /* "View.MemoryView":160 + /* "View.MemoryView":161 * order = b'F' * self.mode = u'fortran' * elif mode == 'c': # <<<<<<<<<<<<<< @@ -91377,7 +122649,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ goto __pyx_L10; } - /* "View.MemoryView":164 + /* "View.MemoryView":165 * self.mode = u'c' * else: * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<< @@ -91385,18 +122657,18 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * self.len = fill_contig_strides_array(self._shape, self._strides, */ /*else*/ { - __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 164, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 164, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __PYX_ERR(2, 164, __pyx_L1_error) + __PYX_ERR(2, 165, __pyx_L1_error) } __pyx_L10:; - /* "View.MemoryView":166 + /* "View.MemoryView":167 * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) * * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<< @@ -91405,7 +122677,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order); - /* "View.MemoryView":169 + /* "View.MemoryView":170 * itemsize, self.ndim, order) * * self.free_data = allocate_buffer # <<<<<<<<<<<<<< @@ -91414,19 +122686,19 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ __pyx_v_self->free_data = __pyx_v_allocate_buffer; - /* "View.MemoryView":170 + /* "View.MemoryView":171 * * self.free_data = allocate_buffer * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<< * if allocate_buffer: * */ - __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 170, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 170, __pyx_L1_error) + __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 171, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 171, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_self->dtype_is_object = __pyx_t_4; - /* "View.MemoryView":171 + /* "View.MemoryView":172 * self.free_data = allocate_buffer * self.dtype_is_object = format == b'O' * if allocate_buffer: # <<<<<<<<<<<<<< @@ -91436,7 +122708,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_t_4 = (__pyx_v_allocate_buffer != 0); if (__pyx_t_4) { - /* "View.MemoryView":174 + /* "View.MemoryView":175 * * * self.data = malloc(self.len) # <<<<<<<<<<<<<< @@ -91445,7 +122717,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len)); - /* "View.MemoryView":175 + /* "View.MemoryView":176 * * self.data = malloc(self.len) * if not self.data: # <<<<<<<<<<<<<< @@ -91455,20 +122727,20 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0); if (unlikely(__pyx_t_4)) { - /* "View.MemoryView":176 + /* "View.MemoryView":177 * self.data = malloc(self.len) * if not self.data: * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< * * if self.dtype_is_object: */ - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 176, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __PYX_ERR(2, 176, __pyx_L1_error) + __PYX_ERR(2, 177, __pyx_L1_error) - /* "View.MemoryView":175 + /* "View.MemoryView":176 * * self.data = malloc(self.len) * if not self.data: # <<<<<<<<<<<<<< @@ -91477,7 +122749,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ } - /* "View.MemoryView":178 + /* "View.MemoryView":179 * raise MemoryError("unable to allocate array data.") * * if self.dtype_is_object: # <<<<<<<<<<<<<< @@ -91487,7 +122759,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0); if (__pyx_t_4) { - /* "View.MemoryView":179 + /* "View.MemoryView":180 * * if self.dtype_is_object: * p = self.data # <<<<<<<<<<<<<< @@ -91496,7 +122768,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ __pyx_v_p = ((PyObject **)__pyx_v_self->data); - /* "View.MemoryView":180 + /* "View.MemoryView":181 * if self.dtype_is_object: * p = self.data * for i in range(self.len / itemsize): # <<<<<<<<<<<<<< @@ -91505,18 +122777,18 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(2, 180, __pyx_L1_error) + __PYX_ERR(2, 181, __pyx_L1_error) } else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) { PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); - __PYX_ERR(2, 180, __pyx_L1_error) + __PYX_ERR(2, 181, __pyx_L1_error) } __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); __pyx_t_9 = __pyx_t_1; for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; - /* "View.MemoryView":181 + /* "View.MemoryView":182 * p = self.data * for i in range(self.len / itemsize): * p[i] = Py_None # <<<<<<<<<<<<<< @@ -91525,7 +122797,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ (__pyx_v_p[__pyx_v_i]) = Py_None; - /* "View.MemoryView":182 + /* "View.MemoryView":183 * for i in range(self.len / itemsize): * p[i] = Py_None * Py_INCREF(Py_None) # <<<<<<<<<<<<<< @@ -91535,7 +122807,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ Py_INCREF(Py_None); } - /* "View.MemoryView":178 + /* "View.MemoryView":179 * raise MemoryError("unable to allocate array data.") * * if self.dtype_is_object: # <<<<<<<<<<<<<< @@ -91544,7 +122816,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ } - /* "View.MemoryView":171 + /* "View.MemoryView":172 * self.free_data = allocate_buffer * self.dtype_is_object = format == b'O' * if allocate_buffer: # <<<<<<<<<<<<<< @@ -91553,7 +122825,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ } - /* "View.MemoryView":122 + /* "View.MemoryView":123 * cdef bint dtype_is_object * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< @@ -91577,7 +122849,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ return __pyx_r; } -/* "View.MemoryView":185 +/* "View.MemoryView":186 * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< @@ -91620,7 +122892,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); - /* "View.MemoryView":186 + /* "View.MemoryView":187 * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): * cdef int bufmode = -1 # <<<<<<<<<<<<<< @@ -91629,18 +122901,18 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru */ __pyx_v_bufmode = -1; - /* "View.MemoryView":187 + /* "View.MemoryView":188 * def __getbuffer__(self, Py_buffer *info, int flags): * cdef int bufmode = -1 * if self.mode == u"c": # <<<<<<<<<<<<<< * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * elif self.mode == u"fortran": */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 187, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 188, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":188 + /* "View.MemoryView":189 * cdef int bufmode = -1 * if self.mode == u"c": * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<< @@ -91649,7 +122921,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru */ __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); - /* "View.MemoryView":187 + /* "View.MemoryView":188 * def __getbuffer__(self, Py_buffer *info, int flags): * cdef int bufmode = -1 * if self.mode == u"c": # <<<<<<<<<<<<<< @@ -91659,18 +122931,18 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru goto __pyx_L3; } - /* "View.MemoryView":189 + /* "View.MemoryView":190 * if self.mode == u"c": * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * elif self.mode == u"fortran": # <<<<<<<<<<<<<< * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * if not (flags & bufmode): */ - __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 189, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 190, __pyx_L1_error) __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "View.MemoryView":190 + /* "View.MemoryView":191 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * elif self.mode == u"fortran": * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<< @@ -91679,7 +122951,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru */ __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); - /* "View.MemoryView":189 + /* "View.MemoryView":190 * if self.mode == u"c": * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * elif self.mode == u"fortran": # <<<<<<<<<<<<<< @@ -91689,7 +122961,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru } __pyx_L3:; - /* "View.MemoryView":191 + /* "View.MemoryView":192 * elif self.mode == u"fortran": * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * if not (flags & bufmode): # <<<<<<<<<<<<<< @@ -91699,20 +122971,20 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0); if (unlikely(__pyx_t_1)) { - /* "View.MemoryView":192 + /* "View.MemoryView":193 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * if not (flags & bufmode): * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< * info.buf = self.data * info.len = self.len */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 192, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 192, __pyx_L1_error) + __PYX_ERR(2, 193, __pyx_L1_error) - /* "View.MemoryView":191 + /* "View.MemoryView":192 * elif self.mode == u"fortran": * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * if not (flags & bufmode): # <<<<<<<<<<<<<< @@ -91721,7 +122993,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru */ } - /* "View.MemoryView":193 + /* "View.MemoryView":194 * if not (flags & bufmode): * raise ValueError("Can only create a buffer that is contiguous in memory.") * info.buf = self.data # <<<<<<<<<<<<<< @@ -91731,7 +123003,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_t_4 = __pyx_v_self->data; __pyx_v_info->buf = __pyx_t_4; - /* "View.MemoryView":194 + /* "View.MemoryView":195 * raise ValueError("Can only create a buffer that is contiguous in memory.") * info.buf = self.data * info.len = self.len # <<<<<<<<<<<<<< @@ -91741,7 +123013,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_t_5 = __pyx_v_self->len; __pyx_v_info->len = __pyx_t_5; - /* "View.MemoryView":195 + /* "View.MemoryView":196 * info.buf = self.data * info.len = self.len * info.ndim = self.ndim # <<<<<<<<<<<<<< @@ -91751,7 +123023,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_t_6 = __pyx_v_self->ndim; __pyx_v_info->ndim = __pyx_t_6; - /* "View.MemoryView":196 + /* "View.MemoryView":197 * info.len = self.len * info.ndim = self.ndim * info.shape = self._shape # <<<<<<<<<<<<<< @@ -91761,7 +123033,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_t_7 = __pyx_v_self->_shape; __pyx_v_info->shape = __pyx_t_7; - /* "View.MemoryView":197 + /* "View.MemoryView":198 * info.ndim = self.ndim * info.shape = self._shape * info.strides = self._strides # <<<<<<<<<<<<<< @@ -91771,7 +123043,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_t_7 = __pyx_v_self->_strides; __pyx_v_info->strides = __pyx_t_7; - /* "View.MemoryView":198 + /* "View.MemoryView":199 * info.shape = self._shape * info.strides = self._strides * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -91780,7 +123052,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru */ __pyx_v_info->suboffsets = NULL; - /* "View.MemoryView":199 + /* "View.MemoryView":200 * info.strides = self._strides * info.suboffsets = NULL * info.itemsize = self.itemsize # <<<<<<<<<<<<<< @@ -91790,7 +123062,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_t_5 = __pyx_v_self->itemsize; __pyx_v_info->itemsize = __pyx_t_5; - /* "View.MemoryView":200 + /* "View.MemoryView":201 * info.suboffsets = NULL * info.itemsize = self.itemsize * info.readonly = 0 # <<<<<<<<<<<<<< @@ -91799,7 +123071,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru */ __pyx_v_info->readonly = 0; - /* "View.MemoryView":202 + /* "View.MemoryView":203 * info.readonly = 0 * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< @@ -91809,7 +123081,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); if (__pyx_t_1) { - /* "View.MemoryView":203 + /* "View.MemoryView":204 * * if flags & PyBUF_FORMAT: * info.format = self.format # <<<<<<<<<<<<<< @@ -91819,7 +123091,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_t_4 = __pyx_v_self->format; __pyx_v_info->format = __pyx_t_4; - /* "View.MemoryView":202 + /* "View.MemoryView":203 * info.readonly = 0 * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< @@ -91829,7 +123101,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru goto __pyx_L5; } - /* "View.MemoryView":205 + /* "View.MemoryView":206 * info.format = self.format * else: * info.format = NULL # <<<<<<<<<<<<<< @@ -91841,7 +123113,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru } __pyx_L5:; - /* "View.MemoryView":207 + /* "View.MemoryView":208 * info.format = NULL * * info.obj = self # <<<<<<<<<<<<<< @@ -91854,7 +123126,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - /* "View.MemoryView":185 + /* "View.MemoryView":186 * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< @@ -91884,7 +123156,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru return __pyx_r; } -/* "View.MemoryView":211 +/* "View.MemoryView":212 * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") * * def __dealloc__(array self): # <<<<<<<<<<<<<< @@ -91908,7 +123180,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc int __pyx_t_1; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "View.MemoryView":212 + /* "View.MemoryView":213 * * def __dealloc__(array self): * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< @@ -91918,7 +123190,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0); if (__pyx_t_1) { - /* "View.MemoryView":213 + /* "View.MemoryView":214 * def __dealloc__(array self): * if self.callback_free_data != NULL: * self.callback_free_data(self.data) # <<<<<<<<<<<<<< @@ -91927,7 +123199,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc */ __pyx_v_self->callback_free_data(__pyx_v_self->data); - /* "View.MemoryView":212 + /* "View.MemoryView":213 * * def __dealloc__(array self): * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< @@ -91937,7 +123209,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc goto __pyx_L3; } - /* "View.MemoryView":214 + /* "View.MemoryView":215 * if self.callback_free_data != NULL: * self.callback_free_data(self.data) * elif self.free_data: # <<<<<<<<<<<<<< @@ -91947,7 +123219,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc __pyx_t_1 = (__pyx_v_self->free_data != 0); if (__pyx_t_1) { - /* "View.MemoryView":215 + /* "View.MemoryView":216 * self.callback_free_data(self.data) * elif self.free_data: * if self.dtype_is_object: # <<<<<<<<<<<<<< @@ -91957,7 +123229,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); if (__pyx_t_1) { - /* "View.MemoryView":216 + /* "View.MemoryView":217 * elif self.free_data: * if self.dtype_is_object: * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<< @@ -91966,7 +123238,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc */ __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0); - /* "View.MemoryView":215 + /* "View.MemoryView":216 * self.callback_free_data(self.data) * elif self.free_data: * if self.dtype_is_object: # <<<<<<<<<<<<<< @@ -91975,7 +123247,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc */ } - /* "View.MemoryView":218 + /* "View.MemoryView":219 * refcount_objects_in_slice(self.data, self._shape, * self._strides, self.ndim, False) * free(self.data) # <<<<<<<<<<<<<< @@ -91984,7 +123256,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc */ free(__pyx_v_self->data); - /* "View.MemoryView":214 + /* "View.MemoryView":215 * if self.callback_free_data != NULL: * self.callback_free_data(self.data) * elif self.free_data: # <<<<<<<<<<<<<< @@ -91994,7 +123266,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc } __pyx_L3:; - /* "View.MemoryView":219 + /* "View.MemoryView":220 * self._strides, self.ndim, False) * free(self.data) * PyObject_Free(self._shape) # <<<<<<<<<<<<<< @@ -92003,7 +123275,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc */ PyObject_Free(__pyx_v_self->_shape); - /* "View.MemoryView":211 + /* "View.MemoryView":212 * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") * * def __dealloc__(array self): # <<<<<<<<<<<<<< @@ -92015,7 +123287,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc __Pyx_RefNannyFinishContext(); } -/* "View.MemoryView":222 +/* "View.MemoryView":223 * * @property * def memview(self): # <<<<<<<<<<<<<< @@ -92045,7 +123317,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct _ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":223 + /* "View.MemoryView":224 * @property * def memview(self): * return self.get_memview() # <<<<<<<<<<<<<< @@ -92053,13 +123325,13 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct _ * @cname('get_memview') */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 223, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "View.MemoryView":222 + /* "View.MemoryView":223 * * @property * def memview(self): # <<<<<<<<<<<<<< @@ -92078,7 +123350,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct _ return __pyx_r; } -/* "View.MemoryView":226 +/* "View.MemoryView":227 * * @cname('get_memview') * cdef get_memview(self): # <<<<<<<<<<<<<< @@ -92098,7 +123370,7 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_memview", 0); - /* "View.MemoryView":227 + /* "View.MemoryView":228 * @cname('get_memview') * cdef get_memview(self): * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<< @@ -92107,7 +123379,7 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { */ __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE); - /* "View.MemoryView":228 + /* "View.MemoryView":229 * cdef get_memview(self): * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<< @@ -92115,11 +123387,11 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { * def __len__(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 228, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 228, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 228, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); @@ -92130,14 +123402,14 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 228, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":226 + /* "View.MemoryView":227 * * @cname('get_memview') * cdef get_memview(self): # <<<<<<<<<<<<<< @@ -92158,7 +123430,7 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { return __pyx_r; } -/* "View.MemoryView":230 +/* "View.MemoryView":231 * return memoryview(self, flags, self.dtype_is_object) * * def __len__(self): # <<<<<<<<<<<<<< @@ -92184,7 +123456,7 @@ static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(str __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); - /* "View.MemoryView":231 + /* "View.MemoryView":232 * * def __len__(self): * return self._shape[0] # <<<<<<<<<<<<<< @@ -92194,7 +123466,7 @@ static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(str __pyx_r = (__pyx_v_self->_shape[0]); goto __pyx_L0; - /* "View.MemoryView":230 + /* "View.MemoryView":231 * return memoryview(self, flags, self.dtype_is_object) * * def __len__(self): # <<<<<<<<<<<<<< @@ -92208,7 +123480,7 @@ static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(str return __pyx_r; } -/* "View.MemoryView":233 +/* "View.MemoryView":234 * return self._shape[0] * * def __getattr__(self, attr): # <<<<<<<<<<<<<< @@ -92239,7 +123511,7 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getattr__", 0); - /* "View.MemoryView":234 + /* "View.MemoryView":235 * * def __getattr__(self, attr): * return getattr(self.memview, attr) # <<<<<<<<<<<<<< @@ -92247,16 +123519,16 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__( * def __getitem__(self, item): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 234, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 234, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":233 + /* "View.MemoryView":234 * return self._shape[0] * * def __getattr__(self, attr): # <<<<<<<<<<<<<< @@ -92276,7 +123548,7 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__( return __pyx_r; } -/* "View.MemoryView":236 +/* "View.MemoryView":237 * return getattr(self.memview, attr) * * def __getitem__(self, item): # <<<<<<<<<<<<<< @@ -92307,7 +123579,7 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); - /* "View.MemoryView":237 + /* "View.MemoryView":238 * * def __getitem__(self, item): * return self.memview[item] # <<<<<<<<<<<<<< @@ -92315,16 +123587,16 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__ * def __setitem__(self, item, value): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 237, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 237, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":236 + /* "View.MemoryView":237 * return getattr(self.memview, attr) * * def __getitem__(self, item): # <<<<<<<<<<<<<< @@ -92344,7 +123616,7 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__ return __pyx_r; } -/* "View.MemoryView":239 +/* "View.MemoryView":240 * return self.memview[item] * * def __setitem__(self, item, value): # <<<<<<<<<<<<<< @@ -92374,19 +123646,19 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 0); - /* "View.MemoryView":240 + /* "View.MemoryView":241 * * def __setitem__(self, item, value): * self.memview[item] = value # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 240, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 240, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 241, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":239 + /* "View.MemoryView":240 * return self.memview[item] * * def __setitem__(self, item, value): # <<<<<<<<<<<<<< @@ -92519,7 +123791,7 @@ static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct return __pyx_r; } -/* "View.MemoryView":244 +/* "View.MemoryView":245 * * @cname("__pyx_array_new") * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< @@ -92541,7 +123813,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize int __pyx_clineno = 0; __Pyx_RefNannySetupContext("array_cwrapper", 0); - /* "View.MemoryView":248 + /* "View.MemoryView":249 * cdef array result * * if buf == NULL: # <<<<<<<<<<<<<< @@ -92551,20 +123823,20 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize __pyx_t_1 = ((__pyx_v_buf == NULL) != 0); if (__pyx_t_1) { - /* "View.MemoryView":249 + /* "View.MemoryView":250 * * if buf == NULL: * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<< * else: * result = array(shape, itemsize, format, mode.decode('ASCII'), */ - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 249, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 249, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 249, __pyx_L1_error) + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 249, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); @@ -92578,13 +123850,13 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 249, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); __pyx_t_4 = 0; - /* "View.MemoryView":248 + /* "View.MemoryView":249 * cdef array result * * if buf == NULL: # <<<<<<<<<<<<<< @@ -92594,7 +123866,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize goto __pyx_L3; } - /* "View.MemoryView":251 + /* "View.MemoryView":252 * result = array(shape, itemsize, format, mode.decode('ASCII')) * else: * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< @@ -92602,13 +123874,13 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize * result.data = buf */ /*else*/ { - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 251, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 251, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 251, __pyx_L1_error) + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 251, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); @@ -92623,32 +123895,32 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize __pyx_t_5 = 0; __pyx_t_3 = 0; - /* "View.MemoryView":252 + /* "View.MemoryView":253 * else: * result = array(shape, itemsize, format, mode.decode('ASCII'), * allocate_buffer=False) # <<<<<<<<<<<<<< * result.data = buf * */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 252, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 252, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 253, __pyx_L1_error) - /* "View.MemoryView":251 + /* "View.MemoryView":252 * result = array(shape, itemsize, format, mode.decode('ASCII')) * else: * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< * allocate_buffer=False) * result.data = buf */ - __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 251, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5); __pyx_t_5 = 0; - /* "View.MemoryView":253 + /* "View.MemoryView":254 * result = array(shape, itemsize, format, mode.decode('ASCII'), * allocate_buffer=False) * result.data = buf # <<<<<<<<<<<<<< @@ -92659,7 +123931,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize } __pyx_L3:; - /* "View.MemoryView":255 + /* "View.MemoryView":256 * result.data = buf * * return result # <<<<<<<<<<<<<< @@ -92671,7 +123943,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize __pyx_r = __pyx_v_result; goto __pyx_L0; - /* "View.MemoryView":244 + /* "View.MemoryView":245 * * @cname("__pyx_array_new") * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< @@ -92694,7 +123966,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize return __pyx_r; } -/* "View.MemoryView":281 +/* "View.MemoryView":282 * cdef class Enum(object): * cdef object name * def __init__(self, name): # <<<<<<<<<<<<<< @@ -92731,7 +124003,7 @@ static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_ar else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 281, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 282, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -92742,7 +124014,7 @@ static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_ar } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 281, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 282, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -92760,7 +124032,7 @@ static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struc __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); - /* "View.MemoryView":282 + /* "View.MemoryView":283 * cdef object name * def __init__(self, name): * self.name = name # <<<<<<<<<<<<<< @@ -92773,7 +124045,7 @@ static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struc __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = __pyx_v_name; - /* "View.MemoryView":281 + /* "View.MemoryView":282 * cdef class Enum(object): * cdef object name * def __init__(self, name): # <<<<<<<<<<<<<< @@ -92787,7 +124059,7 @@ static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struc return __pyx_r; } -/* "View.MemoryView":283 +/* "View.MemoryView":284 * def __init__(self, name): * self.name = name * def __repr__(self): # <<<<<<<<<<<<<< @@ -92813,7 +124085,7 @@ static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__", 0); - /* "View.MemoryView":284 + /* "View.MemoryView":285 * self.name = name * def __repr__(self): * return self.name # <<<<<<<<<<<<<< @@ -92825,7 +124097,7 @@ static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr_ __pyx_r = __pyx_v_self->name; goto __pyx_L0; - /* "View.MemoryView":283 + /* "View.MemoryView":284 * def __init__(self, name): * self.name = name * def __repr__(self): # <<<<<<<<<<<<<< @@ -93133,7 +124405,7 @@ static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_Me return __pyx_r; } -/* "View.MemoryView":298 +/* "View.MemoryView":299 * * @cname('__pyx_align_pointer') * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< @@ -93147,7 +124419,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) void *__pyx_r; int __pyx_t_1; - /* "View.MemoryView":300 + /* "View.MemoryView":301 * cdef void *align_pointer(void *memory, size_t alignment) nogil: * "Align pointer memory on a given boundary" * cdef Py_intptr_t aligned_p = memory # <<<<<<<<<<<<<< @@ -93156,7 +124428,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) */ __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory); - /* "View.MemoryView":304 + /* "View.MemoryView":305 * * with cython.cdivision(True): * offset = aligned_p % alignment # <<<<<<<<<<<<<< @@ -93165,7 +124437,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) */ __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); - /* "View.MemoryView":306 + /* "View.MemoryView":307 * offset = aligned_p % alignment * * if offset > 0: # <<<<<<<<<<<<<< @@ -93175,7 +124447,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) __pyx_t_1 = ((__pyx_v_offset > 0) != 0); if (__pyx_t_1) { - /* "View.MemoryView":307 + /* "View.MemoryView":308 * * if offset > 0: * aligned_p += alignment - offset # <<<<<<<<<<<<<< @@ -93184,7 +124456,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) */ __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset)); - /* "View.MemoryView":306 + /* "View.MemoryView":307 * offset = aligned_p % alignment * * if offset > 0: # <<<<<<<<<<<<<< @@ -93193,7 +124465,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) */ } - /* "View.MemoryView":309 + /* "View.MemoryView":310 * aligned_p += alignment - offset * * return aligned_p # <<<<<<<<<<<<<< @@ -93203,7 +124475,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) __pyx_r = ((void *)__pyx_v_aligned_p); goto __pyx_L0; - /* "View.MemoryView":298 + /* "View.MemoryView":299 * * @cname('__pyx_align_pointer') * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< @@ -93216,7 +124488,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) return __pyx_r; } -/* "View.MemoryView":345 +/* "View.MemoryView":346 * cdef __Pyx_TypeInfo *typeinfo * * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< @@ -93261,7 +124533,7 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 345, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 346, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -93271,7 +124543,7 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 345, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 346, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -93284,16 +124556,16 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar } } __pyx_v_obj = values[0]; - __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 345, __pyx_L3_error) + __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 346, __pyx_L3_error) if (values[2]) { - __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 345, __pyx_L3_error) + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 346, __pyx_L3_error) } else { __pyx_v_dtype_is_object = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 345, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 346, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -93318,7 +124590,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "View.MemoryView":346 + /* "View.MemoryView":347 * * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): * self.obj = obj # <<<<<<<<<<<<<< @@ -93331,7 +124603,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ __Pyx_DECREF(__pyx_v_self->obj); __pyx_v_self->obj = __pyx_v_obj; - /* "View.MemoryView":347 + /* "View.MemoryView":348 * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): * self.obj = obj * self.flags = flags # <<<<<<<<<<<<<< @@ -93340,7 +124612,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ */ __pyx_v_self->flags = __pyx_v_flags; - /* "View.MemoryView":348 + /* "View.MemoryView":349 * self.obj = obj * self.flags = flags * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< @@ -93360,16 +124632,16 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ __pyx_L4_bool_binop_done:; if (__pyx_t_1) { - /* "View.MemoryView":349 + /* "View.MemoryView":350 * self.flags = flags * if type(self) is memoryview or obj is not None: * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<< * if self.view.obj == NULL: * (<__pyx_buffer *> &self.view).obj = Py_None */ - __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 349, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 350, __pyx_L1_error) - /* "View.MemoryView":350 + /* "View.MemoryView":351 * if type(self) is memoryview or obj is not None: * __Pyx_GetBuffer(obj, &self.view, flags) * if self.view.obj == NULL: # <<<<<<<<<<<<<< @@ -93379,7 +124651,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0); if (__pyx_t_1) { - /* "View.MemoryView":351 + /* "View.MemoryView":352 * __Pyx_GetBuffer(obj, &self.view, flags) * if self.view.obj == NULL: * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<< @@ -93388,16 +124660,16 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ */ ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None; - /* "View.MemoryView":352 + /* "View.MemoryView":353 * if self.view.obj == NULL: * (<__pyx_buffer *> &self.view).obj = Py_None * Py_INCREF(Py_None) # <<<<<<<<<<<<<< * - * global __pyx_memoryview_thread_locks_used + * if not __PYX_CYTHON_ATOMICS_ENABLED(): */ Py_INCREF(Py_None); - /* "View.MemoryView":350 + /* "View.MemoryView":351 * if type(self) is memoryview or obj is not None: * __Pyx_GetBuffer(obj, &self.view, flags) * if self.view.obj == NULL: # <<<<<<<<<<<<<< @@ -93406,7 +124678,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ */ } - /* "View.MemoryView":348 + /* "View.MemoryView":349 * self.obj = obj * self.flags = flags * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< @@ -93416,100 +124688,119 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ } /* "View.MemoryView":355 + * Py_INCREF(Py_None) * - * global __pyx_memoryview_thread_locks_used - * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] - * __pyx_memoryview_thread_locks_used += 1 + * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<< + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: */ - __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0); + __pyx_t_1 = ((!(__PYX_CYTHON_ATOMICS_ENABLED() != 0)) != 0); if (__pyx_t_1) { - /* "View.MemoryView":356 - * global __pyx_memoryview_thread_locks_used - * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<< - * __pyx_memoryview_thread_locks_used += 1 - * if self.lock is NULL: - */ - __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); - /* "View.MemoryView":357 - * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] - * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<< - * if self.lock is NULL: - * self.lock = PyThread_allocate_lock() + * if not __PYX_CYTHON_ATOMICS_ENABLED(): + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 */ - __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1); + __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":355 - * - * global __pyx_memoryview_thread_locks_used - * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] - * __pyx_memoryview_thread_locks_used += 1 + /* "View.MemoryView":358 + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: */ - } + __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); - /* "View.MemoryView":358 - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] - * __pyx_memoryview_thread_locks_used += 1 - * if self.lock is NULL: # <<<<<<<<<<<<<< - * self.lock = PyThread_allocate_lock() + /* "View.MemoryView":359 + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<< * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() */ - __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); - if (__pyx_t_1) { + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1); - /* "View.MemoryView":359 - * __pyx_memoryview_thread_locks_used += 1 - * if self.lock is NULL: - * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<< - * if self.lock is NULL: - * raise MemoryError + /* "View.MemoryView":357 + * if not __PYX_CYTHON_ATOMICS_ENABLED(): + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 */ - __pyx_v_self->lock = PyThread_allocate_lock(); + } /* "View.MemoryView":360 - * if self.lock is NULL: - * self.lock = PyThread_allocate_lock() + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 * if self.lock is NULL: # <<<<<<<<<<<<<< - * raise MemoryError - * + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: */ __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); - if (unlikely(__pyx_t_1)) { + if (__pyx_t_1) { /* "View.MemoryView":361 - * self.lock = PyThread_allocate_lock() + * __pyx_memoryview_thread_locks_used += 1 * if self.lock is NULL: - * raise MemoryError # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<< + * if self.lock is NULL: + * raise MemoryError + */ + __pyx_v_self->lock = PyThread_allocate_lock(); + + /* "View.MemoryView":362 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":363 + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + * raise MemoryError # <<<<<<<<<<<<<< * * if flags & PyBUF_FORMAT: */ - PyErr_NoMemory(); __PYX_ERR(2, 361, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(2, 363, __pyx_L1_error) + + /* "View.MemoryView":362 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + } /* "View.MemoryView":360 - * if self.lock is NULL: - * self.lock = PyThread_allocate_lock() + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 * if self.lock is NULL: # <<<<<<<<<<<<<< - * raise MemoryError - * + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: */ } - /* "View.MemoryView":358 - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] - * __pyx_memoryview_thread_locks_used += 1 - * if self.lock is NULL: # <<<<<<<<<<<<<< - * self.lock = PyThread_allocate_lock() - * if self.lock is NULL: + /* "View.MemoryView":355 + * Py_INCREF(Py_None) + * + * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<< + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: */ } - /* "View.MemoryView":363 - * raise MemoryError + /* "View.MemoryView":365 + * raise MemoryError * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') @@ -93518,7 +124809,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); if (__pyx_t_1) { - /* "View.MemoryView":364 + /* "View.MemoryView":366 * * if flags & PyBUF_FORMAT: * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<< @@ -93529,24 +124820,24 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; - goto __pyx_L11_bool_binop_done; + goto __pyx_L12_bool_binop_done; } __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0); __pyx_t_1 = __pyx_t_2; - __pyx_L11_bool_binop_done:; + __pyx_L12_bool_binop_done:; __pyx_v_self->dtype_is_object = __pyx_t_1; - /* "View.MemoryView":363 - * raise MemoryError + /* "View.MemoryView":365 + * raise MemoryError * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') * else: */ - goto __pyx_L10; + goto __pyx_L11; } - /* "View.MemoryView":366 + /* "View.MemoryView":368 * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') * else: * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<< @@ -93556,9 +124847,9 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ /*else*/ { __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object; } - __pyx_L10:; + __pyx_L11:; - /* "View.MemoryView":368 + /* "View.MemoryView":370 * self.dtype_is_object = dtype_is_object * * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<< @@ -93567,7 +124858,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ */ __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int)))); - /* "View.MemoryView":370 + /* "View.MemoryView":372 * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) * self.typeinfo = NULL # <<<<<<<<<<<<<< @@ -93576,7 +124867,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ */ __pyx_v_self->typeinfo = NULL; - /* "View.MemoryView":345 + /* "View.MemoryView":346 * cdef __Pyx_TypeInfo *typeinfo * * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< @@ -93595,7 +124886,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ return __pyx_r; } -/* "View.MemoryView":372 +/* "View.MemoryView":374 * self.typeinfo = NULL * * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< @@ -93626,7 +124917,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal PyThread_type_lock __pyx_t_7; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "View.MemoryView":373 + /* "View.MemoryView":375 * * def __dealloc__(memoryview self): * if self.obj is not None: # <<<<<<<<<<<<<< @@ -93637,7 +124928,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":374 + /* "View.MemoryView":376 * def __dealloc__(memoryview self): * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<< @@ -93646,7 +124937,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal */ __Pyx_ReleaseBuffer((&__pyx_v_self->view)); - /* "View.MemoryView":373 + /* "View.MemoryView":375 * * def __dealloc__(memoryview self): * if self.obj is not None: # <<<<<<<<<<<<<< @@ -93656,7 +124947,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal goto __pyx_L3; } - /* "View.MemoryView":375 + /* "View.MemoryView":377 * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<< @@ -93666,7 +124957,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0); if (__pyx_t_2) { - /* "View.MemoryView":377 + /* "View.MemoryView":379 * elif (<__pyx_buffer *> &self.view).obj == Py_None: * * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<< @@ -93675,7 +124966,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal */ ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL; - /* "View.MemoryView":378 + /* "View.MemoryView":380 * * (<__pyx_buffer *> &self.view).obj = NULL * Py_DECREF(Py_None) # <<<<<<<<<<<<<< @@ -93684,7 +124975,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal */ Py_DECREF(Py_None); - /* "View.MemoryView":375 + /* "View.MemoryView":377 * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<< @@ -93694,7 +124985,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal } __pyx_L3:; - /* "View.MemoryView":382 + /* "View.MemoryView":384 * cdef int i * global __pyx_memoryview_thread_locks_used * if self.lock != NULL: # <<<<<<<<<<<<<< @@ -93704,7 +124995,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0); if (__pyx_t_2) { - /* "View.MemoryView":383 + /* "View.MemoryView":385 * global __pyx_memoryview_thread_locks_used * if self.lock != NULL: * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<< @@ -93716,7 +125007,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; - /* "View.MemoryView":384 + /* "View.MemoryView":386 * if self.lock != NULL: * for i in range(__pyx_memoryview_thread_locks_used): * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< @@ -93726,7 +125017,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0); if (__pyx_t_2) { - /* "View.MemoryView":385 + /* "View.MemoryView":387 * for i in range(__pyx_memoryview_thread_locks_used): * if __pyx_memoryview_thread_locks[i] is self.lock: * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<< @@ -93735,7 +125026,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal */ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1); - /* "View.MemoryView":386 + /* "View.MemoryView":388 * if __pyx_memoryview_thread_locks[i] is self.lock: * __pyx_memoryview_thread_locks_used -= 1 * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< @@ -93745,7 +125036,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0); if (__pyx_t_2) { - /* "View.MemoryView":388 + /* "View.MemoryView":390 * if i != __pyx_memoryview_thread_locks_used: * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<< @@ -93755,7 +125046,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]); - /* "View.MemoryView":387 + /* "View.MemoryView":389 * __pyx_memoryview_thread_locks_used -= 1 * if i != __pyx_memoryview_thread_locks_used: * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<< @@ -93765,7 +125056,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6; (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7; - /* "View.MemoryView":386 + /* "View.MemoryView":388 * if __pyx_memoryview_thread_locks[i] is self.lock: * __pyx_memoryview_thread_locks_used -= 1 * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< @@ -93774,7 +125065,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal */ } - /* "View.MemoryView":389 + /* "View.MemoryView":391 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) * break # <<<<<<<<<<<<<< @@ -93783,7 +125074,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal */ goto __pyx_L6_break; - /* "View.MemoryView":384 + /* "View.MemoryView":386 * if self.lock != NULL: * for i in range(__pyx_memoryview_thread_locks_used): * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< @@ -93794,7 +125085,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal } /*else*/ { - /* "View.MemoryView":391 + /* "View.MemoryView":393 * break * else: * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<< @@ -93805,7 +125096,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal } __pyx_L6_break:; - /* "View.MemoryView":382 + /* "View.MemoryView":384 * cdef int i * global __pyx_memoryview_thread_locks_used * if self.lock != NULL: # <<<<<<<<<<<<<< @@ -93814,7 +125105,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal */ } - /* "View.MemoryView":372 + /* "View.MemoryView":374 * self.typeinfo = NULL * * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< @@ -93826,7 +125117,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal __Pyx_RefNannyFinishContext(); } -/* "View.MemoryView":393 +/* "View.MemoryView":395 * PyThread_free_lock(self.lock) * * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< @@ -93852,7 +125143,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_item_pointer", 0); - /* "View.MemoryView":395 + /* "View.MemoryView":397 * cdef char *get_item_pointer(memoryview self, object index) except NULL: * cdef Py_ssize_t dim * cdef char *itemp = self.view.buf # <<<<<<<<<<<<<< @@ -93861,7 +125152,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py */ __pyx_v_itemp = ((char *)__pyx_v_self->view.buf); - /* "View.MemoryView":397 + /* "View.MemoryView":399 * cdef char *itemp = self.view.buf * * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< @@ -93873,26 +125164,26 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 397, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 397, __pyx_L1_error) + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 399, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 397, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 399, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 397, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 397, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 399, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 397, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -93902,7 +125193,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(2, 397, __pyx_L1_error) + else __PYX_ERR(2, 399, __pyx_L1_error) } break; } @@ -93913,18 +125204,18 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py __pyx_v_dim = __pyx_t_1; __pyx_t_1 = (__pyx_t_1 + 1); - /* "View.MemoryView":398 + /* "View.MemoryView":400 * * for dim, idx in enumerate(index): * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<< * * return itemp */ - __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 398, __pyx_L1_error) - __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(2, 398, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 400, __pyx_L1_error) + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(2, 400, __pyx_L1_error) __pyx_v_itemp = __pyx_t_7; - /* "View.MemoryView":397 + /* "View.MemoryView":399 * cdef char *itemp = self.view.buf * * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< @@ -93934,7 +125225,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":400 + /* "View.MemoryView":402 * itemp = pybuffer_index(&self.view, itemp, idx, dim) * * return itemp # <<<<<<<<<<<<<< @@ -93944,7 +125235,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py __pyx_r = __pyx_v_itemp; goto __pyx_L0; - /* "View.MemoryView":393 + /* "View.MemoryView":395 * PyThread_free_lock(self.lock) * * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< @@ -93964,7 +125255,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py return __pyx_r; } -/* "View.MemoryView":403 +/* "View.MemoryView":405 * * * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< @@ -94002,7 +125293,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); - /* "View.MemoryView":404 + /* "View.MemoryView":406 * * def __getitem__(memoryview self, object index): * if index is Ellipsis: # <<<<<<<<<<<<<< @@ -94013,7 +125304,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":405 + /* "View.MemoryView":407 * def __getitem__(memoryview self, object index): * if index is Ellipsis: * return self # <<<<<<<<<<<<<< @@ -94025,7 +125316,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "View.MemoryView":404 + /* "View.MemoryView":406 * * def __getitem__(memoryview self, object index): * if index is Ellipsis: # <<<<<<<<<<<<<< @@ -94034,14 +125325,14 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ */ } - /* "View.MemoryView":407 + /* "View.MemoryView":409 * return self * * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< * * cdef char *itemp */ - __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 407, __pyx_L1_error) + __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(__pyx_t_3 != Py_None)) { PyObject* sequence = __pyx_t_3; @@ -94049,7 +125340,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(2, 407, __pyx_L1_error) + __PYX_ERR(2, 409, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); @@ -94057,31 +125348,31 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else - __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 407, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 407, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 407, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 409, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_indices = __pyx_t_5; __pyx_t_5 = 0; - /* "View.MemoryView":410 + /* "View.MemoryView":412 * * cdef char *itemp * if have_slices: # <<<<<<<<<<<<<< * return memview_slice(self, indices) * else: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 410, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 412, __pyx_L1_error) if (__pyx_t_2) { - /* "View.MemoryView":411 + /* "View.MemoryView":413 * cdef char *itemp * if have_slices: * return memview_slice(self, indices) # <<<<<<<<<<<<<< @@ -94089,13 +125380,13 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ * itemp = self.get_item_pointer(indices) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 411, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "View.MemoryView":410 + /* "View.MemoryView":412 * * cdef char *itemp * if have_slices: # <<<<<<<<<<<<<< @@ -94104,7 +125395,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ */ } - /* "View.MemoryView":413 + /* "View.MemoryView":415 * return memview_slice(self, indices) * else: * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<< @@ -94112,10 +125403,10 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ * */ /*else*/ { - __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(2, 413, __pyx_L1_error) + __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(2, 415, __pyx_L1_error) __pyx_v_itemp = __pyx_t_6; - /* "View.MemoryView":414 + /* "View.MemoryView":416 * else: * itemp = self.get_item_pointer(indices) * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<< @@ -94123,14 +125414,14 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ * def __setitem__(memoryview self, object index, object value): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 414, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } - /* "View.MemoryView":403 + /* "View.MemoryView":405 * * * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< @@ -94153,7 +125444,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ return __pyx_r; } -/* "View.MemoryView":416 +/* "View.MemoryView":418 * return self.convert_item_to_object(itemp) * * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< @@ -94189,7 +125480,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit __Pyx_RefNannySetupContext("__setitem__", 0); __Pyx_INCREF(__pyx_v_index); - /* "View.MemoryView":417 + /* "View.MemoryView":419 * * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: # <<<<<<<<<<<<<< @@ -94199,20 +125490,20 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit __pyx_t_1 = (__pyx_v_self->view.readonly != 0); if (unlikely(__pyx_t_1)) { - /* "View.MemoryView":418 + /* "View.MemoryView":420 * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<< * * have_slices, index = _unellipsify(index, self.view.ndim) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 418, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(2, 418, __pyx_L1_error) + __PYX_ERR(2, 420, __pyx_L1_error) - /* "View.MemoryView":417 + /* "View.MemoryView":419 * * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: # <<<<<<<<<<<<<< @@ -94221,14 +125512,14 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit */ } - /* "View.MemoryView":420 + /* "View.MemoryView":422 * raise TypeError("Cannot assign to read-only memoryview") * * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< * * if have_slices: */ - __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 420, __pyx_L1_error) + __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(__pyx_t_2 != Py_None)) { PyObject* sequence = __pyx_t_2; @@ -94236,7 +125527,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(2, 420, __pyx_L1_error) + __PYX_ERR(2, 422, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); @@ -94244,67 +125535,67 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 420, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 420, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 420, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 422, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_3; __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4); __pyx_t_4 = 0; - /* "View.MemoryView":422 + /* "View.MemoryView":424 * have_slices, index = _unellipsify(index, self.view.ndim) * * if have_slices: # <<<<<<<<<<<<<< * obj = self.is_slice(value) * if obj: */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 422, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 424, __pyx_L1_error) if (__pyx_t_1) { - /* "View.MemoryView":423 + /* "View.MemoryView":425 * * if have_slices: * obj = self.is_slice(value) # <<<<<<<<<<<<<< * if obj: * self.setitem_slice_assignment(self[index], obj) */ - __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 423, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_obj = __pyx_t_2; __pyx_t_2 = 0; - /* "View.MemoryView":424 + /* "View.MemoryView":426 * if have_slices: * obj = self.is_slice(value) * if obj: # <<<<<<<<<<<<<< * self.setitem_slice_assignment(self[index], obj) * else: */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 424, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 426, __pyx_L1_error) if (__pyx_t_1) { - /* "View.MemoryView":425 + /* "View.MemoryView":427 * obj = self.is_slice(value) * if obj: * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<< * else: * self.setitem_slice_assign_scalar(self[index], value) */ - __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 425, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 425, __pyx_L1_error) + __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "View.MemoryView":424 + /* "View.MemoryView":426 * if have_slices: * obj = self.is_slice(value) * if obj: # <<<<<<<<<<<<<< @@ -94314,7 +125605,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit goto __pyx_L5; } - /* "View.MemoryView":427 + /* "View.MemoryView":429 * self.setitem_slice_assignment(self[index], obj) * else: * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<< @@ -94322,17 +125613,17 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit * self.setitem_indexed(index, value) */ /*else*/ { - __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 427, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(2, 427, __pyx_L1_error) - __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 427, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(2, 429, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L5:; - /* "View.MemoryView":422 + /* "View.MemoryView":424 * have_slices, index = _unellipsify(index, self.view.ndim) * * if have_slices: # <<<<<<<<<<<<<< @@ -94342,7 +125633,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit goto __pyx_L4; } - /* "View.MemoryView":429 + /* "View.MemoryView":431 * self.setitem_slice_assign_scalar(self[index], value) * else: * self.setitem_indexed(index, value) # <<<<<<<<<<<<<< @@ -94350,13 +125641,13 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit * cdef is_slice(self, obj): */ /*else*/ { - __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 429, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L4:; - /* "View.MemoryView":416 + /* "View.MemoryView":418 * return self.convert_item_to_object(itemp) * * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< @@ -94381,7 +125672,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit return __pyx_r; } -/* "View.MemoryView":431 +/* "View.MemoryView":433 * self.setitem_indexed(index, value) * * cdef is_slice(self, obj): # <<<<<<<<<<<<<< @@ -94407,7 +125698,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ __Pyx_RefNannySetupContext("is_slice", 0); __Pyx_INCREF(__pyx_v_obj); - /* "View.MemoryView":432 + /* "View.MemoryView":434 * * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< @@ -94418,7 +125709,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":433 + /* "View.MemoryView":435 * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): * try: # <<<<<<<<<<<<<< @@ -94434,34 +125725,34 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ __Pyx_XGOTREF(__pyx_t_5); /*try:*/ { - /* "View.MemoryView":434 + /* "View.MemoryView":436 * if not isinstance(obj, memoryview): * try: * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< * self.dtype_is_object) * except TypeError: */ - __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 434, __pyx_L4_error) + __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 436, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); - /* "View.MemoryView":435 + /* "View.MemoryView":437 * try: * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, * self.dtype_is_object) # <<<<<<<<<<<<<< * except TypeError: * return None */ - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 435, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 437, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); - /* "View.MemoryView":434 + /* "View.MemoryView":436 * if not isinstance(obj, memoryview): * try: * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< * self.dtype_is_object) * except TypeError: */ - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 434, __pyx_L4_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 436, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); @@ -94472,13 +125763,13 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7); __pyx_t_6 = 0; __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 434, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 436, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); __pyx_t_7 = 0; - /* "View.MemoryView":433 + /* "View.MemoryView":435 * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): * try: # <<<<<<<<<<<<<< @@ -94495,7 +125786,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "View.MemoryView":436 + /* "View.MemoryView":438 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, * self.dtype_is_object) * except TypeError: # <<<<<<<<<<<<<< @@ -94505,12 +125796,12 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_9) { __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(2, 436, __pyx_L6_except_error) + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(2, 438, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_6); - /* "View.MemoryView":437 + /* "View.MemoryView":439 * self.dtype_is_object) * except TypeError: * return None # <<<<<<<<<<<<<< @@ -94527,7 +125818,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ goto __pyx_L6_except_error; __pyx_L6_except_error:; - /* "View.MemoryView":433 + /* "View.MemoryView":435 * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): * try: # <<<<<<<<<<<<<< @@ -94548,7 +125839,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ __pyx_L9_try_end:; } - /* "View.MemoryView":432 + /* "View.MemoryView":434 * * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< @@ -94557,7 +125848,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ */ } - /* "View.MemoryView":439 + /* "View.MemoryView":441 * return None * * return obj # <<<<<<<<<<<<<< @@ -94569,7 +125860,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ __pyx_r = __pyx_v_obj; goto __pyx_L0; - /* "View.MemoryView":431 + /* "View.MemoryView":433 * self.setitem_indexed(index, value) * * cdef is_slice(self, obj): # <<<<<<<<<<<<<< @@ -94591,7 +125882,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ return __pyx_r; } -/* "View.MemoryView":441 +/* "View.MemoryView":443 * return obj * * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< @@ -94615,52 +125906,52 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setitem_slice_assignment", 0); - /* "View.MemoryView":445 + /* "View.MemoryView":447 * cdef __Pyx_memviewslice src_slice * * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< * get_slice_from_memview(dst, &dst_slice)[0], * src.ndim, dst.ndim, self.dtype_is_object) */ - if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 445, __pyx_L1_error) - __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 445, __pyx_L1_error) + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 447, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 447, __pyx_L1_error) - /* "View.MemoryView":446 + /* "View.MemoryView":448 * * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<< * src.ndim, dst.ndim, self.dtype_is_object) * */ - if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 446, __pyx_L1_error) - __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 446, __pyx_L1_error) + if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 448, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 448, __pyx_L1_error) - /* "View.MemoryView":447 + /* "View.MemoryView":449 * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], * get_slice_from_memview(dst, &dst_slice)[0], * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<< * * cdef setitem_slice_assign_scalar(self, memoryview dst, value): */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 447, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 447, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 449, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 447, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 447, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 449, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":445 + /* "View.MemoryView":447 * cdef __Pyx_memviewslice src_slice * * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< * get_slice_from_memview(dst, &dst_slice)[0], * src.ndim, dst.ndim, self.dtype_is_object) */ - __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 445, __pyx_L1_error) + __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 447, __pyx_L1_error) - /* "View.MemoryView":441 + /* "View.MemoryView":443 * return obj * * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< @@ -94681,7 +125972,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi return __pyx_r; } -/* "View.MemoryView":449 +/* "View.MemoryView":451 * src.ndim, dst.ndim, self.dtype_is_object) * * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< @@ -94714,7 +126005,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0); - /* "View.MemoryView":451 + /* "View.MemoryView":453 * cdef setitem_slice_assign_scalar(self, memoryview dst, value): * cdef int array[128] * cdef void *tmp = NULL # <<<<<<<<<<<<<< @@ -94723,17 +126014,17 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor */ __pyx_v_tmp = NULL; - /* "View.MemoryView":456 + /* "View.MemoryView":458 * cdef __Pyx_memviewslice *dst_slice * cdef __Pyx_memviewslice tmp_slice * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<< * * if self.view.itemsize > sizeof(array): */ - __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 456, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 458, __pyx_L1_error) __pyx_v_dst_slice = __pyx_t_1; - /* "View.MemoryView":458 + /* "View.MemoryView":460 * dst_slice = get_slice_from_memview(dst, &tmp_slice) * * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< @@ -94743,7 +126034,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0); if (__pyx_t_2) { - /* "View.MemoryView":459 + /* "View.MemoryView":461 * * if self.view.itemsize > sizeof(array): * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<< @@ -94752,7 +126043,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor */ __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize); - /* "View.MemoryView":460 + /* "View.MemoryView":462 * if self.view.itemsize > sizeof(array): * tmp = PyMem_Malloc(self.view.itemsize) * if tmp == NULL: # <<<<<<<<<<<<<< @@ -94762,16 +126053,16 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0); if (unlikely(__pyx_t_2)) { - /* "View.MemoryView":461 + /* "View.MemoryView":463 * tmp = PyMem_Malloc(self.view.itemsize) * if tmp == NULL: * raise MemoryError # <<<<<<<<<<<<<< * item = tmp * else: */ - PyErr_NoMemory(); __PYX_ERR(2, 461, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(2, 463, __pyx_L1_error) - /* "View.MemoryView":460 + /* "View.MemoryView":462 * if self.view.itemsize > sizeof(array): * tmp = PyMem_Malloc(self.view.itemsize) * if tmp == NULL: # <<<<<<<<<<<<<< @@ -94780,7 +126071,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor */ } - /* "View.MemoryView":462 + /* "View.MemoryView":464 * if tmp == NULL: * raise MemoryError * item = tmp # <<<<<<<<<<<<<< @@ -94789,7 +126080,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor */ __pyx_v_item = __pyx_v_tmp; - /* "View.MemoryView":458 + /* "View.MemoryView":460 * dst_slice = get_slice_from_memview(dst, &tmp_slice) * * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< @@ -94799,7 +126090,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor goto __pyx_L3; } - /* "View.MemoryView":464 + /* "View.MemoryView":466 * item = tmp * else: * item = array # <<<<<<<<<<<<<< @@ -94811,7 +126102,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor } __pyx_L3:; - /* "View.MemoryView":466 + /* "View.MemoryView":468 * item = array * * try: # <<<<<<<<<<<<<< @@ -94820,7 +126111,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor */ /*try:*/ { - /* "View.MemoryView":467 + /* "View.MemoryView":469 * * try: * if self.dtype_is_object: # <<<<<<<<<<<<<< @@ -94830,7 +126121,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0); if (__pyx_t_2) { - /* "View.MemoryView":468 + /* "View.MemoryView":470 * try: * if self.dtype_is_object: * ( item)[0] = value # <<<<<<<<<<<<<< @@ -94839,7 +126130,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor */ (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value); - /* "View.MemoryView":467 + /* "View.MemoryView":469 * * try: * if self.dtype_is_object: # <<<<<<<<<<<<<< @@ -94849,7 +126140,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor goto __pyx_L8; } - /* "View.MemoryView":470 + /* "View.MemoryView":472 * ( item)[0] = value * else: * self.assign_item_from_object( item, value) # <<<<<<<<<<<<<< @@ -94857,13 +126148,13 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor * */ /*else*/ { - __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 470, __pyx_L6_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 472, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L8:; - /* "View.MemoryView":474 + /* "View.MemoryView":476 * * * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< @@ -94873,18 +126164,18 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0); if (__pyx_t_2) { - /* "View.MemoryView":475 + /* "View.MemoryView":477 * * if self.view.suboffsets != NULL: * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<< * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, * item, self.dtype_is_object) */ - __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 475, __pyx_L6_error) + __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 477, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":474 + /* "View.MemoryView":476 * * * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< @@ -94893,7 +126184,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor */ } - /* "View.MemoryView":476 + /* "View.MemoryView":478 * if self.view.suboffsets != NULL: * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<< @@ -94903,7 +126194,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object); } - /* "View.MemoryView":479 + /* "View.MemoryView":481 * item, self.dtype_is_object) * finally: * PyMem_Free(tmp) # <<<<<<<<<<<<<< @@ -94950,7 +126241,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor __pyx_L7:; } - /* "View.MemoryView":449 + /* "View.MemoryView":451 * src.ndim, dst.ndim, self.dtype_is_object) * * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< @@ -94971,7 +126262,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor return __pyx_r; } -/* "View.MemoryView":481 +/* "View.MemoryView":483 * PyMem_Free(tmp) * * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< @@ -94990,28 +126281,28 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setitem_indexed", 0); - /* "View.MemoryView":482 + /* "View.MemoryView":484 * * cdef setitem_indexed(self, index, value): * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<< * self.assign_item_from_object(itemp, value) * */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(2, 482, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(2, 484, __pyx_L1_error) __pyx_v_itemp = __pyx_t_1; - /* "View.MemoryView":483 + /* "View.MemoryView":485 * cdef setitem_indexed(self, index, value): * cdef char *itemp = self.get_item_pointer(index) * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<< * * cdef convert_item_to_object(self, char *itemp): */ - __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 483, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":481 + /* "View.MemoryView":483 * PyMem_Free(tmp) * * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< @@ -95032,7 +126323,7 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_ return __pyx_r; } -/* "View.MemoryView":485 +/* "View.MemoryView":487 * self.assign_item_from_object(itemp, value) * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< @@ -95062,31 +126353,31 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview int __pyx_clineno = 0; __Pyx_RefNannySetupContext("convert_item_to_object", 0); - /* "View.MemoryView":488 + /* "View.MemoryView":490 * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" * import struct # <<<<<<<<<<<<<< * cdef bytes bytesitem * */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 488, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; - /* "View.MemoryView":491 + /* "View.MemoryView":493 * cdef bytes bytesitem * * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<< * try: * result = struct.unpack(self.view.format, bytesitem) */ - __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 491, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":492 + /* "View.MemoryView":494 * * bytesitem = itemp[:self.view.itemsize] * try: # <<<<<<<<<<<<<< @@ -95102,16 +126393,16 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { - /* "View.MemoryView":493 + /* "View.MemoryView":495 * bytesitem = itemp[:self.view.itemsize] * try: * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<< * except struct.error: * raise ValueError("Unable to convert item to object") */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 493, __pyx_L3_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 495, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 493, __pyx_L3_error) + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 495, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -95128,7 +126419,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 495, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -95137,14 +126428,14 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 495, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 493, __pyx_L3_error) + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 495, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -95155,7 +126446,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __Pyx_GIVEREF(__pyx_v_bytesitem); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem); __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 495, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -95163,7 +126454,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __pyx_v_result = __pyx_t_1; __pyx_t_1 = 0; - /* "View.MemoryView":492 + /* "View.MemoryView":494 * * bytesitem = itemp[:self.view.itemsize] * try: # <<<<<<<<<<<<<< @@ -95172,7 +126463,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview */ } - /* "View.MemoryView":497 + /* "View.MemoryView":499 * raise ValueError("Unable to convert item to object") * else: * if len(self.view.format) == 1: # <<<<<<<<<<<<<< @@ -95184,7 +126475,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __pyx_t_11 = ((__pyx_t_10 == 1) != 0); if (__pyx_t_11) { - /* "View.MemoryView":498 + /* "View.MemoryView":500 * else: * if len(self.view.format) == 1: * return result[0] # <<<<<<<<<<<<<< @@ -95192,13 +126483,13 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 498, __pyx_L5_except_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 500, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L6_except_return; - /* "View.MemoryView":497 + /* "View.MemoryView":499 * raise ValueError("Unable to convert item to object") * else: * if len(self.view.format) == 1: # <<<<<<<<<<<<<< @@ -95207,7 +126498,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview */ } - /* "View.MemoryView":499 + /* "View.MemoryView":501 * if len(self.view.format) == 1: * return result[0] * return result # <<<<<<<<<<<<<< @@ -95226,7 +126517,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "View.MemoryView":494 + /* "View.MemoryView":496 * try: * result = struct.unpack(self.view.format, bytesitem) * except struct.error: # <<<<<<<<<<<<<< @@ -95234,7 +126525,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview * else: */ __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 494, __pyx_L5_except_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 496, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -95242,28 +126533,28 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0; if (__pyx_t_8) { __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(2, 494, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(2, 496, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_1); - /* "View.MemoryView":495 + /* "View.MemoryView":497 * result = struct.unpack(self.view.format, bytesitem) * except struct.error: * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< * else: * if len(self.view.format) == 1: */ - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 495, __pyx_L5_except_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 497, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(2, 495, __pyx_L5_except_error) + __PYX_ERR(2, 497, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "View.MemoryView":492 + /* "View.MemoryView":494 * * bytesitem = itemp[:self.view.itemsize] * try: # <<<<<<<<<<<<<< @@ -95283,7 +126574,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview goto __pyx_L0; } - /* "View.MemoryView":485 + /* "View.MemoryView":487 * self.assign_item_from_object(itemp, value) * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< @@ -95309,7 +126600,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview return __pyx_r; } -/* "View.MemoryView":501 +/* "View.MemoryView":503 * return result * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< @@ -95343,19 +126634,19 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie int __pyx_clineno = 0; __Pyx_RefNannySetupContext("assign_item_from_object", 0); - /* "View.MemoryView":504 + /* "View.MemoryView":506 * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" * import struct # <<<<<<<<<<<<<< * cdef char c * cdef bytes bytesvalue */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 504, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; - /* "View.MemoryView":509 + /* "View.MemoryView":511 * cdef Py_ssize_t i * * if isinstance(value, tuple): # <<<<<<<<<<<<<< @@ -95366,37 +126657,37 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "View.MemoryView":510 + /* "View.MemoryView":512 * * if isinstance(value, tuple): * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<< * else: * bytesvalue = struct.pack(self.view.format, value) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 510, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 510, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 510, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 510, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 512, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "View.MemoryView":509 + /* "View.MemoryView":511 * cdef Py_ssize_t i * * if isinstance(value, tuple): # <<<<<<<<<<<<<< @@ -95406,7 +126697,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie goto __pyx_L3; } - /* "View.MemoryView":512 + /* "View.MemoryView":514 * bytesvalue = struct.pack(self.view.format, *value) * else: * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<< @@ -95414,9 +126705,9 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie * for i, c in enumerate(bytesvalue): */ /*else*/ { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 512, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 512, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_7 = 0; @@ -95433,7 +126724,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 514, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -95442,14 +126733,14 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 514, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 512, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -95460,18 +126751,18 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 512, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 514, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; } __pyx_L3:; - /* "View.MemoryView":514 + /* "View.MemoryView":516 * bytesvalue = struct.pack(self.view.format, value) * * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< @@ -95481,7 +126772,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie __pyx_t_9 = 0; if (unlikely(__pyx_v_bytesvalue == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); - __PYX_ERR(2, 514, __pyx_L1_error) + __PYX_ERR(2, 516, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_bytesvalue); __pyx_t_10 = __pyx_v_bytesvalue; @@ -95491,7 +126782,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie __pyx_t_11 = __pyx_t_14; __pyx_v_c = (__pyx_t_11[0]); - /* "View.MemoryView":515 + /* "View.MemoryView":517 * * for i, c in enumerate(bytesvalue): * itemp[i] = c # <<<<<<<<<<<<<< @@ -95500,7 +126791,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie */ __pyx_v_i = __pyx_t_9; - /* "View.MemoryView":514 + /* "View.MemoryView":516 * bytesvalue = struct.pack(self.view.format, value) * * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< @@ -95509,7 +126800,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie */ __pyx_t_9 = (__pyx_t_9 + 1); - /* "View.MemoryView":515 + /* "View.MemoryView":517 * * for i, c in enumerate(bytesvalue): * itemp[i] = c # <<<<<<<<<<<<<< @@ -95520,7 +126811,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "View.MemoryView":501 + /* "View.MemoryView":503 * return result * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< @@ -95548,7 +126839,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie return __pyx_r; } -/* "View.MemoryView":518 +/* "View.MemoryView":520 * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< @@ -95591,7 +126882,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); - /* "View.MemoryView":519 + /* "View.MemoryView":521 * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<< @@ -95609,20 +126900,20 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_L4_bool_binop_done:; if (unlikely(__pyx_t_1)) { - /* "View.MemoryView":520 + /* "View.MemoryView":522 * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<< * * if flags & PyBUF_ND: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 520, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 520, __pyx_L1_error) + __PYX_ERR(2, 522, __pyx_L1_error) - /* "View.MemoryView":519 + /* "View.MemoryView":521 * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<< @@ -95631,7 +126922,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu */ } - /* "View.MemoryView":522 + /* "View.MemoryView":524 * raise ValueError("Cannot create writable memory view from read-only memoryview") * * if flags & PyBUF_ND: # <<<<<<<<<<<<<< @@ -95641,7 +126932,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0); if (__pyx_t_1) { - /* "View.MemoryView":523 + /* "View.MemoryView":525 * * if flags & PyBUF_ND: * info.shape = self.view.shape # <<<<<<<<<<<<<< @@ -95651,7 +126942,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_4 = __pyx_v_self->view.shape; __pyx_v_info->shape = __pyx_t_4; - /* "View.MemoryView":522 + /* "View.MemoryView":524 * raise ValueError("Cannot create writable memory view from read-only memoryview") * * if flags & PyBUF_ND: # <<<<<<<<<<<<<< @@ -95661,7 +126952,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu goto __pyx_L6; } - /* "View.MemoryView":525 + /* "View.MemoryView":527 * info.shape = self.view.shape * else: * info.shape = NULL # <<<<<<<<<<<<<< @@ -95673,7 +126964,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu } __pyx_L6:; - /* "View.MemoryView":527 + /* "View.MemoryView":529 * info.shape = NULL * * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< @@ -95683,7 +126974,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); if (__pyx_t_1) { - /* "View.MemoryView":528 + /* "View.MemoryView":530 * * if flags & PyBUF_STRIDES: * info.strides = self.view.strides # <<<<<<<<<<<<<< @@ -95693,7 +126984,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_4 = __pyx_v_self->view.strides; __pyx_v_info->strides = __pyx_t_4; - /* "View.MemoryView":527 + /* "View.MemoryView":529 * info.shape = NULL * * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< @@ -95703,7 +126994,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu goto __pyx_L7; } - /* "View.MemoryView":530 + /* "View.MemoryView":532 * info.strides = self.view.strides * else: * info.strides = NULL # <<<<<<<<<<<<<< @@ -95715,7 +127006,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu } __pyx_L7:; - /* "View.MemoryView":532 + /* "View.MemoryView":534 * info.strides = NULL * * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< @@ -95725,7 +127016,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0); if (__pyx_t_1) { - /* "View.MemoryView":533 + /* "View.MemoryView":535 * * if flags & PyBUF_INDIRECT: * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<< @@ -95735,7 +127026,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_4 = __pyx_v_self->view.suboffsets; __pyx_v_info->suboffsets = __pyx_t_4; - /* "View.MemoryView":532 + /* "View.MemoryView":534 * info.strides = NULL * * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< @@ -95745,7 +127036,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu goto __pyx_L8; } - /* "View.MemoryView":535 + /* "View.MemoryView":537 * info.suboffsets = self.view.suboffsets * else: * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -95757,7 +127048,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu } __pyx_L8:; - /* "View.MemoryView":537 + /* "View.MemoryView":539 * info.suboffsets = NULL * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< @@ -95767,7 +127058,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); if (__pyx_t_1) { - /* "View.MemoryView":538 + /* "View.MemoryView":540 * * if flags & PyBUF_FORMAT: * info.format = self.view.format # <<<<<<<<<<<<<< @@ -95777,7 +127068,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_5 = __pyx_v_self->view.format; __pyx_v_info->format = __pyx_t_5; - /* "View.MemoryView":537 + /* "View.MemoryView":539 * info.suboffsets = NULL * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< @@ -95787,7 +127078,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu goto __pyx_L9; } - /* "View.MemoryView":540 + /* "View.MemoryView":542 * info.format = self.view.format * else: * info.format = NULL # <<<<<<<<<<<<<< @@ -95799,7 +127090,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu } __pyx_L9:; - /* "View.MemoryView":542 + /* "View.MemoryView":544 * info.format = NULL * * info.buf = self.view.buf # <<<<<<<<<<<<<< @@ -95809,7 +127100,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_6 = __pyx_v_self->view.buf; __pyx_v_info->buf = __pyx_t_6; - /* "View.MemoryView":543 + /* "View.MemoryView":545 * * info.buf = self.view.buf * info.ndim = self.view.ndim # <<<<<<<<<<<<<< @@ -95819,7 +127110,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_7 = __pyx_v_self->view.ndim; __pyx_v_info->ndim = __pyx_t_7; - /* "View.MemoryView":544 + /* "View.MemoryView":546 * info.buf = self.view.buf * info.ndim = self.view.ndim * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<< @@ -95829,7 +127120,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_8 = __pyx_v_self->view.itemsize; __pyx_v_info->itemsize = __pyx_t_8; - /* "View.MemoryView":545 + /* "View.MemoryView":547 * info.ndim = self.view.ndim * info.itemsize = self.view.itemsize * info.len = self.view.len # <<<<<<<<<<<<<< @@ -95839,7 +127130,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_8 = __pyx_v_self->view.len; __pyx_v_info->len = __pyx_t_8; - /* "View.MemoryView":546 + /* "View.MemoryView":548 * info.itemsize = self.view.itemsize * info.len = self.view.len * info.readonly = self.view.readonly # <<<<<<<<<<<<<< @@ -95849,7 +127140,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_1 = __pyx_v_self->view.readonly; __pyx_v_info->readonly = __pyx_t_1; - /* "View.MemoryView":547 + /* "View.MemoryView":549 * info.len = self.view.len * info.readonly = self.view.readonly * info.obj = self # <<<<<<<<<<<<<< @@ -95862,7 +127153,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - /* "View.MemoryView":518 + /* "View.MemoryView":520 * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< @@ -95892,7 +127183,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu return __pyx_r; } -/* "View.MemoryView":553 +/* "View.MemoryView":555 * * @property * def T(self): # <<<<<<<<<<<<<< @@ -95924,29 +127215,29 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct _ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":554 + /* "View.MemoryView":556 * @property * def T(self): * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<< * transpose_memslice(&result.from_slice) * return result */ - __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 554, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 554, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 556, __pyx_L1_error) __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":555 + /* "View.MemoryView":557 * def T(self): * cdef _memoryviewslice result = memoryview_copy(self) * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<< * return result * */ - __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 555, __pyx_L1_error) + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 557, __pyx_L1_error) - /* "View.MemoryView":556 + /* "View.MemoryView":558 * cdef _memoryviewslice result = memoryview_copy(self) * transpose_memslice(&result.from_slice) * return result # <<<<<<<<<<<<<< @@ -95958,7 +127249,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct _ __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; - /* "View.MemoryView":553 + /* "View.MemoryView":555 * * @property * def T(self): # <<<<<<<<<<<<<< @@ -95978,7 +127269,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct _ return __pyx_r; } -/* "View.MemoryView":559 +/* "View.MemoryView":561 * * @property * def base(self): # <<<<<<<<<<<<<< @@ -96004,7 +127295,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struc __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":560 + /* "View.MemoryView":562 * @property * def base(self): * return self.obj # <<<<<<<<<<<<<< @@ -96016,7 +127307,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struc __pyx_r = __pyx_v_self->obj; goto __pyx_L0; - /* "View.MemoryView":559 + /* "View.MemoryView":561 * * @property * def base(self): # <<<<<<<<<<<<<< @@ -96031,7 +127322,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struc return __pyx_r; } -/* "View.MemoryView":563 +/* "View.MemoryView":565 * * @property * def shape(self): # <<<<<<<<<<<<<< @@ -96066,7 +127357,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(stru int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":564 + /* "View.MemoryView":566 * @property * def shape(self): * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<< @@ -96074,25 +127365,25 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(stru * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 564, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { __pyx_t_2 = __pyx_t_4; __pyx_v_length = (__pyx_t_2[0]); - __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 564, __pyx_L1_error) + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 564, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 566, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 564, __pyx_L1_error) + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - /* "View.MemoryView":563 + /* "View.MemoryView":565 * * @property * def shape(self): # <<<<<<<<<<<<<< @@ -96112,7 +127403,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(stru return __pyx_r; } -/* "View.MemoryView":567 +/* "View.MemoryView":569 * * @property * def strides(self): # <<<<<<<<<<<<<< @@ -96148,7 +127439,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":568 + /* "View.MemoryView":570 * @property * def strides(self): * if self.view.strides == NULL: # <<<<<<<<<<<<<< @@ -96158,20 +127449,20 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0); if (unlikely(__pyx_t_1)) { - /* "View.MemoryView":570 + /* "View.MemoryView":572 * if self.view.strides == NULL: * * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 570, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(2, 570, __pyx_L1_error) + __PYX_ERR(2, 572, __pyx_L1_error) - /* "View.MemoryView":568 + /* "View.MemoryView":570 * @property * def strides(self): * if self.view.strides == NULL: # <<<<<<<<<<<<<< @@ -96180,7 +127471,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st */ } - /* "View.MemoryView":572 + /* "View.MemoryView":574 * raise ValueError("Buffer view does not expose strides") * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<< @@ -96188,25 +127479,25 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 572, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim); for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { __pyx_t_3 = __pyx_t_5; __pyx_v_stride = (__pyx_t_3[0]); - __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 572, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 572, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 574, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 572, __pyx_L1_error) + __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "View.MemoryView":567 + /* "View.MemoryView":569 * * @property * def strides(self): # <<<<<<<<<<<<<< @@ -96226,7 +127517,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st return __pyx_r; } -/* "View.MemoryView":575 +/* "View.MemoryView":577 * * @property * def suboffsets(self): # <<<<<<<<<<<<<< @@ -96262,7 +127553,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":576 + /* "View.MemoryView":578 * @property * def suboffsets(self): * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< @@ -96272,7 +127563,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0); if (__pyx_t_1) { - /* "View.MemoryView":577 + /* "View.MemoryView":579 * def suboffsets(self): * if self.view.suboffsets == NULL: * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< @@ -96280,16 +127571,16 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 577, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__20, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 577, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__20, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "View.MemoryView":576 + /* "View.MemoryView":578 * @property * def suboffsets(self): * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< @@ -96298,7 +127589,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ */ } - /* "View.MemoryView":579 + /* "View.MemoryView":581 * return (-1,) * self.view.ndim * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<< @@ -96306,25 +127597,25 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 579, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { __pyx_t_4 = __pyx_t_6; __pyx_v_suboffset = (__pyx_t_4[0]); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 579, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 581, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error) + __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":575 + /* "View.MemoryView":577 * * @property * def suboffsets(self): # <<<<<<<<<<<<<< @@ -96344,7 +127635,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ return __pyx_r; } -/* "View.MemoryView":582 +/* "View.MemoryView":584 * * @property * def ndim(self): # <<<<<<<<<<<<<< @@ -96374,7 +127665,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":583 + /* "View.MemoryView":585 * @property * def ndim(self): * return self.view.ndim # <<<<<<<<<<<<<< @@ -96382,13 +127673,13 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struc * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 583, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "View.MemoryView":582 + /* "View.MemoryView":584 * * @property * def ndim(self): # <<<<<<<<<<<<<< @@ -96407,7 +127698,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struc return __pyx_r; } -/* "View.MemoryView":586 +/* "View.MemoryView":588 * * @property * def itemsize(self): # <<<<<<<<<<<<<< @@ -96437,7 +127728,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":587 + /* "View.MemoryView":589 * @property * def itemsize(self): * return self.view.itemsize # <<<<<<<<<<<<<< @@ -96445,13 +127736,13 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(s * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 587, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "View.MemoryView":586 + /* "View.MemoryView":588 * * @property * def itemsize(self): # <<<<<<<<<<<<<< @@ -96470,7 +127761,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(s return __pyx_r; } -/* "View.MemoryView":590 +/* "View.MemoryView":592 * * @property * def nbytes(self): # <<<<<<<<<<<<<< @@ -96502,7 +127793,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(str int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":591 + /* "View.MemoryView":593 * @property * def nbytes(self): * return self.size * self.view.itemsize # <<<<<<<<<<<<<< @@ -96510,11 +127801,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(str * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 591, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 591, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 591, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -96522,7 +127813,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(str __pyx_t_3 = 0; goto __pyx_L0; - /* "View.MemoryView":590 + /* "View.MemoryView":592 * * @property * def nbytes(self): # <<<<<<<<<<<<<< @@ -96543,7 +127834,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(str return __pyx_r; } -/* "View.MemoryView":594 +/* "View.MemoryView":596 * * @property * def size(self): # <<<<<<<<<<<<<< @@ -96580,7 +127871,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":595 + /* "View.MemoryView":597 * @property * def size(self): * if self._size is None: # <<<<<<<<<<<<<< @@ -96591,7 +127882,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":596 + /* "View.MemoryView":598 * def size(self): * if self._size is None: * result = 1 # <<<<<<<<<<<<<< @@ -96601,7 +127892,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc __Pyx_INCREF(__pyx_int_1); __pyx_v_result = __pyx_int_1; - /* "View.MemoryView":598 + /* "View.MemoryView":600 * result = 1 * * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<< @@ -96611,25 +127902,25 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { __pyx_t_3 = __pyx_t_5; - __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 598, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); __pyx_t_6 = 0; - /* "View.MemoryView":599 + /* "View.MemoryView":601 * * for length in self.view.shape[:self.view.ndim]: * result *= length # <<<<<<<<<<<<<< * * self._size = result */ - __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 599, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); __pyx_t_6 = 0; } - /* "View.MemoryView":601 + /* "View.MemoryView":603 * result *= length * * self._size = result # <<<<<<<<<<<<<< @@ -96642,7 +127933,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc __Pyx_DECREF(__pyx_v_self->_size); __pyx_v_self->_size = __pyx_v_result; - /* "View.MemoryView":595 + /* "View.MemoryView":597 * @property * def size(self): * if self._size is None: # <<<<<<<<<<<<<< @@ -96651,7 +127942,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc */ } - /* "View.MemoryView":603 + /* "View.MemoryView":605 * self._size = result * * return self._size # <<<<<<<<<<<<<< @@ -96663,7 +127954,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc __pyx_r = __pyx_v_self->_size; goto __pyx_L0; - /* "View.MemoryView":594 + /* "View.MemoryView":596 * * @property * def size(self): # <<<<<<<<<<<<<< @@ -96684,7 +127975,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc return __pyx_r; } -/* "View.MemoryView":605 +/* "View.MemoryView":607 * return self._size * * def __len__(self): # <<<<<<<<<<<<<< @@ -96711,7 +128002,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 int __pyx_t_1; __Pyx_RefNannySetupContext("__len__", 0); - /* "View.MemoryView":606 + /* "View.MemoryView":608 * * def __len__(self): * if self.view.ndim >= 1: # <<<<<<<<<<<<<< @@ -96721,7 +128012,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0); if (__pyx_t_1) { - /* "View.MemoryView":607 + /* "View.MemoryView":609 * def __len__(self): * if self.view.ndim >= 1: * return self.view.shape[0] # <<<<<<<<<<<<<< @@ -96731,7 +128022,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 __pyx_r = (__pyx_v_self->view.shape[0]); goto __pyx_L0; - /* "View.MemoryView":606 + /* "View.MemoryView":608 * * def __len__(self): * if self.view.ndim >= 1: # <<<<<<<<<<<<<< @@ -96740,7 +128031,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 */ } - /* "View.MemoryView":609 + /* "View.MemoryView":611 * return self.view.shape[0] * * return 0 # <<<<<<<<<<<<<< @@ -96750,7 +128041,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 __pyx_r = 0; goto __pyx_L0; - /* "View.MemoryView":605 + /* "View.MemoryView":607 * return self._size * * def __len__(self): # <<<<<<<<<<<<<< @@ -96764,7 +128055,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 return __pyx_r; } -/* "View.MemoryView":611 +/* "View.MemoryView":613 * return 0 * * def __repr__(self): # <<<<<<<<<<<<<< @@ -96796,7 +128087,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); - /* "View.MemoryView":612 + /* "View.MemoryView":614 * * def __repr__(self): * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< @@ -96804,33 +128095,33 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12 * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 612, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":613 + /* "View.MemoryView":615 * def __repr__(self): * return "" % (self.base.__class__.__name__, * id(self)) # <<<<<<<<<<<<<< * * def __str__(self): */ - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 613, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "View.MemoryView":612 + /* "View.MemoryView":614 * * def __repr__(self): * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< * id(self)) * */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 612, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); @@ -96838,14 +128129,14 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 612, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":611 + /* "View.MemoryView":613 * return 0 * * def __repr__(self): # <<<<<<<<<<<<<< @@ -96866,7 +128157,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12 return __pyx_r; } -/* "View.MemoryView":615 +/* "View.MemoryView":617 * id(self)) * * def __str__(self): # <<<<<<<<<<<<<< @@ -96897,7 +128188,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 0); - /* "View.MemoryView":616 + /* "View.MemoryView":618 * * def __str__(self): * return "" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<< @@ -96905,27 +128196,27 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14 * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 616, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 616, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "View.MemoryView":615 + /* "View.MemoryView":617 * id(self)) * * def __str__(self): # <<<<<<<<<<<<<< @@ -96945,7 +128236,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14 return __pyx_r; } -/* "View.MemoryView":619 +/* "View.MemoryView":621 * * * def is_c_contig(self): # <<<<<<<<<<<<<< @@ -96978,17 +128269,17 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_c_contig", 0); - /* "View.MemoryView":622 + /* "View.MemoryView":624 * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< * return slice_is_contig(mslice[0], 'C', self.view.ndim) * */ - __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 622, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 624, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; - /* "View.MemoryView":623 + /* "View.MemoryView":625 * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<< @@ -96996,13 +128287,13 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16 * def is_f_contig(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 623, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":619 + /* "View.MemoryView":621 * * * def is_c_contig(self): # <<<<<<<<<<<<<< @@ -97021,7 +128312,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16 return __pyx_r; } -/* "View.MemoryView":625 +/* "View.MemoryView":627 * return slice_is_contig(mslice[0], 'C', self.view.ndim) * * def is_f_contig(self): # <<<<<<<<<<<<<< @@ -97054,17 +128345,17 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_f_contig", 0); - /* "View.MemoryView":628 + /* "View.MemoryView":630 * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< * return slice_is_contig(mslice[0], 'F', self.view.ndim) * */ - __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 628, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 630, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; - /* "View.MemoryView":629 + /* "View.MemoryView":631 * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<< @@ -97072,13 +128363,13 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18 * def copy(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 629, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":625 + /* "View.MemoryView":627 * return slice_is_contig(mslice[0], 'C', self.view.ndim) * * def is_f_contig(self): # <<<<<<<<<<<<<< @@ -97097,7 +128388,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18 return __pyx_r; } -/* "View.MemoryView":631 +/* "View.MemoryView":633 * return slice_is_contig(mslice[0], 'F', self.view.ndim) * * def copy(self): # <<<<<<<<<<<<<< @@ -97130,7 +128421,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 0); - /* "View.MemoryView":633 + /* "View.MemoryView":635 * def copy(self): * cdef __Pyx_memviewslice mslice * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<< @@ -97139,7 +128430,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 */ __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS)); - /* "View.MemoryView":635 + /* "View.MemoryView":637 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS * * slice_copy(self, &mslice) # <<<<<<<<<<<<<< @@ -97148,17 +128439,17 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 */ __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice)); - /* "View.MemoryView":636 + /* "View.MemoryView":638 * * slice_copy(self, &mslice) * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<< * self.view.itemsize, * flags|PyBUF_C_CONTIGUOUS, */ - __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 636, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 638, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; - /* "View.MemoryView":641 + /* "View.MemoryView":643 * self.dtype_is_object) * * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<< @@ -97166,13 +128457,13 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 * def copy_fortran(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 641, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":631 + /* "View.MemoryView":633 * return slice_is_contig(mslice[0], 'F', self.view.ndim) * * def copy(self): # <<<<<<<<<<<<<< @@ -97191,7 +128482,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 return __pyx_r; } -/* "View.MemoryView":643 +/* "View.MemoryView":645 * return memoryview_copy_from_slice(self, &mslice) * * def copy_fortran(self): # <<<<<<<<<<<<<< @@ -97225,7 +128516,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy_fortran", 0); - /* "View.MemoryView":645 + /* "View.MemoryView":647 * def copy_fortran(self): * cdef __Pyx_memviewslice src, dst * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<< @@ -97234,7 +128525,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22 */ __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS)); - /* "View.MemoryView":647 + /* "View.MemoryView":649 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS * * slice_copy(self, &src) # <<<<<<<<<<<<<< @@ -97243,17 +128534,17 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22 */ __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src)); - /* "View.MemoryView":648 + /* "View.MemoryView":650 * * slice_copy(self, &src) * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<< * self.view.itemsize, * flags|PyBUF_F_CONTIGUOUS, */ - __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 648, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 650, __pyx_L1_error) __pyx_v_dst = __pyx_t_1; - /* "View.MemoryView":653 + /* "View.MemoryView":655 * self.dtype_is_object) * * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<< @@ -97261,13 +128552,13 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22 * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 653, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":643 + /* "View.MemoryView":645 * return memoryview_copy_from_slice(self, &mslice) * * def copy_fortran(self): # <<<<<<<<<<<<<< @@ -97399,7 +128690,7 @@ static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED st return __pyx_r; } -/* "View.MemoryView":657 +/* "View.MemoryView":659 * * @cname('__pyx_memoryview_new') * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< @@ -97419,18 +128710,18 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in int __pyx_clineno = 0; __Pyx_RefNannySetupContext("memoryview_cwrapper", 0); - /* "View.MemoryView":658 + /* "View.MemoryView":660 * @cname('__pyx_memoryview_new') * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< * result.typeinfo = typeinfo * return result */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 658, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 658, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 658, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_o); __Pyx_GIVEREF(__pyx_v_o); @@ -97441,13 +128732,13 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 658, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":659 + /* "View.MemoryView":661 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): * cdef memoryview result = memoryview(o, flags, dtype_is_object) * result.typeinfo = typeinfo # <<<<<<<<<<<<<< @@ -97456,7 +128747,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in */ __pyx_v_result->typeinfo = __pyx_v_typeinfo; - /* "View.MemoryView":660 + /* "View.MemoryView":662 * cdef memoryview result = memoryview(o, flags, dtype_is_object) * result.typeinfo = typeinfo * return result # <<<<<<<<<<<<<< @@ -97468,7 +128759,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; - /* "View.MemoryView":657 + /* "View.MemoryView":659 * * @cname('__pyx_memoryview_new') * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< @@ -97490,7 +128781,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in return __pyx_r; } -/* "View.MemoryView":663 +/* "View.MemoryView":665 * * @cname('__pyx_memoryview_check') * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< @@ -97504,7 +128795,7 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { int __pyx_t_1; __Pyx_RefNannySetupContext("memoryview_check", 0); - /* "View.MemoryView":664 + /* "View.MemoryView":666 * @cname('__pyx_memoryview_check') * cdef inline bint memoryview_check(object o): * return isinstance(o, memoryview) # <<<<<<<<<<<<<< @@ -97515,7 +128806,7 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { __pyx_r = __pyx_t_1; goto __pyx_L0; - /* "View.MemoryView":663 + /* "View.MemoryView":665 * * @cname('__pyx_memoryview_check') * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< @@ -97529,7 +128820,7 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { return __pyx_r; } -/* "View.MemoryView":666 +/* "View.MemoryView":668 * return isinstance(o, memoryview) * * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< @@ -97563,7 +128854,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_unellipsify", 0); - /* "View.MemoryView":671 + /* "View.MemoryView":673 * full slices. * """ * if not isinstance(index, tuple): # <<<<<<<<<<<<<< @@ -97574,14 +128865,14 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":672 + /* "View.MemoryView":674 * """ * if not isinstance(index, tuple): * tup = (index,) # <<<<<<<<<<<<<< * else: * tup = index */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 672, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_index); __Pyx_GIVEREF(__pyx_v_index); @@ -97589,7 +128880,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_v_tup = __pyx_t_3; __pyx_t_3 = 0; - /* "View.MemoryView":671 + /* "View.MemoryView":673 * full slices. * """ * if not isinstance(index, tuple): # <<<<<<<<<<<<<< @@ -97599,7 +128890,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { goto __pyx_L3; } - /* "View.MemoryView":674 + /* "View.MemoryView":676 * tup = (index,) * else: * tup = index # <<<<<<<<<<<<<< @@ -97612,19 +128903,19 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { } __pyx_L3:; - /* "View.MemoryView":676 + /* "View.MemoryView":678 * tup = index * * result = [] # <<<<<<<<<<<<<< * have_slices = False * seen_ellipsis = False */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 676, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 678, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_result = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":677 + /* "View.MemoryView":679 * * result = [] * have_slices = False # <<<<<<<<<<<<<< @@ -97633,7 +128924,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { */ __pyx_v_have_slices = 0; - /* "View.MemoryView":678 + /* "View.MemoryView":680 * result = [] * have_slices = False * seen_ellipsis = False # <<<<<<<<<<<<<< @@ -97642,7 +128933,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { */ __pyx_v_seen_ellipsis = 0; - /* "View.MemoryView":679 + /* "View.MemoryView":681 * have_slices = False * seen_ellipsis = False * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< @@ -97655,26 +128946,26 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 679, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 679, __pyx_L1_error) + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 681, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 679, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 681, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 679, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 681, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -97684,7 +128975,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(2, 679, __pyx_L1_error) + else __PYX_ERR(2, 681, __pyx_L1_error) } break; } @@ -97694,13 +128985,13 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_7 = 0; __Pyx_INCREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3); - __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_7; __pyx_t_7 = 0; - /* "View.MemoryView":680 + /* "View.MemoryView":682 * seen_ellipsis = False * for idx, item in enumerate(tup): * if item is Ellipsis: # <<<<<<<<<<<<<< @@ -97711,7 +129002,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "View.MemoryView":681 + /* "View.MemoryView":683 * for idx, item in enumerate(tup): * if item is Ellipsis: * if not seen_ellipsis: # <<<<<<<<<<<<<< @@ -97721,15 +129012,15 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0); if (__pyx_t_1) { - /* "View.MemoryView":682 + /* "View.MemoryView":684 * if item is Ellipsis: * if not seen_ellipsis: * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< * seen_ellipsis = True * else: */ - __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 682, __pyx_L1_error) - __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 682, __pyx_L1_error) + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 684, __pyx_L1_error) + __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { @@ -97738,10 +129029,10 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__2); } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 682, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 684, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "View.MemoryView":683 + /* "View.MemoryView":685 * if not seen_ellipsis: * result.extend([slice(None)] * (ndim - len(tup) + 1)) * seen_ellipsis = True # <<<<<<<<<<<<<< @@ -97750,7 +129041,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { */ __pyx_v_seen_ellipsis = 1; - /* "View.MemoryView":681 + /* "View.MemoryView":683 * for idx, item in enumerate(tup): * if item is Ellipsis: * if not seen_ellipsis: # <<<<<<<<<<<<<< @@ -97760,7 +129051,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { goto __pyx_L7; } - /* "View.MemoryView":685 + /* "View.MemoryView":687 * seen_ellipsis = True * else: * result.append(slice(None)) # <<<<<<<<<<<<<< @@ -97768,11 +129059,11 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * else: */ /*else*/ { - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__2); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 685, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__2); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 687, __pyx_L1_error) } __pyx_L7:; - /* "View.MemoryView":686 + /* "View.MemoryView":688 * else: * result.append(slice(None)) * have_slices = True # <<<<<<<<<<<<<< @@ -97781,7 +129072,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { */ __pyx_v_have_slices = 1; - /* "View.MemoryView":680 + /* "View.MemoryView":682 * seen_ellipsis = False * for idx, item in enumerate(tup): * if item is Ellipsis: # <<<<<<<<<<<<<< @@ -97791,7 +129082,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { goto __pyx_L6; } - /* "View.MemoryView":688 + /* "View.MemoryView":690 * have_slices = True * else: * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< @@ -97811,23 +129102,23 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_L9_bool_binop_done:; if (unlikely(__pyx_t_1)) { - /* "View.MemoryView":689 + /* "View.MemoryView":691 * else: * if not isinstance(item, slice) and not PyIndex_Check(item): * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<< * * have_slices = have_slices or isinstance(item, slice) */ - __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 689, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 689, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_11, 0, 0, 0); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __PYX_ERR(2, 689, __pyx_L1_error) + __PYX_ERR(2, 691, __pyx_L1_error) - /* "View.MemoryView":688 + /* "View.MemoryView":690 * have_slices = True * else: * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< @@ -97836,7 +129127,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { */ } - /* "View.MemoryView":691 + /* "View.MemoryView":693 * raise TypeError("Cannot index with type '%s'" % type(item)) * * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<< @@ -97855,18 +129146,18 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_L11_bool_binop_done:; __pyx_v_have_slices = __pyx_t_1; - /* "View.MemoryView":692 + /* "View.MemoryView":694 * * have_slices = have_slices or isinstance(item, slice) * result.append(item) # <<<<<<<<<<<<<< * * nslices = ndim - len(result) */ - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 692, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 694, __pyx_L1_error) } __pyx_L6:; - /* "View.MemoryView":679 + /* "View.MemoryView":681 * have_slices = False * seen_ellipsis = False * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< @@ -97877,17 +129168,17 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":694 + /* "View.MemoryView":696 * result.append(item) * * nslices = ndim - len(result) # <<<<<<<<<<<<<< * if nslices: * result.extend([slice(None)] * nslices) */ - __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 694, __pyx_L1_error) + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 696, __pyx_L1_error) __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); - /* "View.MemoryView":695 + /* "View.MemoryView":697 * * nslices = ndim - len(result) * if nslices: # <<<<<<<<<<<<<< @@ -97897,14 +129188,14 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_1 = (__pyx_v_nslices != 0); if (__pyx_t_1) { - /* "View.MemoryView":696 + /* "View.MemoryView":698 * nslices = ndim - len(result) * if nslices: * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< * * return have_slices or nslices, tuple(result) */ - __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 696, __pyx_L1_error) + __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { @@ -97913,10 +129204,10 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__2); } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 696, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 698, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":695 + /* "View.MemoryView":697 * * nslices = ndim - len(result) * if nslices: # <<<<<<<<<<<<<< @@ -97925,7 +129216,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { */ } - /* "View.MemoryView":698 + /* "View.MemoryView":700 * result.extend([slice(None)] * nslices) * * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<< @@ -97935,20 +129226,20 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __Pyx_XDECREF(__pyx_r); if (!__pyx_v_have_slices) { } else { - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L14_bool_binop_done; } - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; __pyx_L14_bool_binop_done:; - __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error) + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 698, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); @@ -97960,7 +129251,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_11 = 0; goto __pyx_L0; - /* "View.MemoryView":666 + /* "View.MemoryView":668 * return isinstance(o, memoryview) * * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< @@ -97986,7 +129277,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { return __pyx_r; } -/* "View.MemoryView":700 +/* "View.MemoryView":702 * return have_slices or nslices, tuple(result) * * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< @@ -98008,7 +129299,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("assert_direct_dimensions", 0); - /* "View.MemoryView":701 + /* "View.MemoryView":703 * * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<< @@ -98020,7 +129311,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ __pyx_t_1 = __pyx_t_3; __pyx_v_suboffset = (__pyx_t_1[0]); - /* "View.MemoryView":702 + /* "View.MemoryView":704 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: # <<<<<<<<<<<<<< @@ -98030,20 +129321,20 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0); if (unlikely(__pyx_t_4)) { - /* "View.MemoryView":703 + /* "View.MemoryView":705 * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 703, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(2, 703, __pyx_L1_error) + __PYX_ERR(2, 705, __pyx_L1_error) - /* "View.MemoryView":702 + /* "View.MemoryView":704 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: # <<<<<<<<<<<<<< @@ -98053,7 +129344,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ } } - /* "View.MemoryView":700 + /* "View.MemoryView":702 * return have_slices or nslices, tuple(result) * * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< @@ -98074,7 +129365,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ return __pyx_r; } -/* "View.MemoryView":710 +/* "View.MemoryView":712 * * @cname('__pyx_memview_slice') * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< @@ -98118,7 +129409,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("memview_slice", 0); - /* "View.MemoryView":711 + /* "View.MemoryView":713 * @cname('__pyx_memview_slice') * cdef memoryview memview_slice(memoryview memview, object indices): * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<< @@ -98128,7 +129419,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_v_new_ndim = 0; __pyx_v_suboffset_dim = -1; - /* "View.MemoryView":718 + /* "View.MemoryView":720 * * * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<< @@ -98137,7 +129428,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)))); - /* "View.MemoryView":722 + /* "View.MemoryView":724 * cdef _memoryviewslice memviewsliceobj * * assert memview.view.ndim > 0 # <<<<<<<<<<<<<< @@ -98148,12 +129439,12 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(2, 722, __pyx_L1_error) + __PYX_ERR(2, 724, __pyx_L1_error) } } #endif - /* "View.MemoryView":724 + /* "View.MemoryView":726 * assert memview.view.ndim > 0 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< @@ -98164,20 +129455,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":725 + /* "View.MemoryView":727 * * if isinstance(memview, _memoryviewslice): * memviewsliceobj = memview # <<<<<<<<<<<<<< * p_src = &memviewsliceobj.from_slice * else: */ - if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 725, __pyx_L1_error) + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 727, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":726 + /* "View.MemoryView":728 * if isinstance(memview, _memoryviewslice): * memviewsliceobj = memview * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<< @@ -98186,7 +129477,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice); - /* "View.MemoryView":724 + /* "View.MemoryView":726 * assert memview.view.ndim > 0 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< @@ -98196,7 +129487,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ goto __pyx_L3; } - /* "View.MemoryView":728 + /* "View.MemoryView":730 * p_src = &memviewsliceobj.from_slice * else: * slice_copy(memview, &src) # <<<<<<<<<<<<<< @@ -98206,7 +129497,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ /*else*/ { __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src)); - /* "View.MemoryView":729 + /* "View.MemoryView":731 * else: * slice_copy(memview, &src) * p_src = &src # <<<<<<<<<<<<<< @@ -98217,7 +129508,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ } __pyx_L3:; - /* "View.MemoryView":735 + /* "View.MemoryView":737 * * * dst.memview = p_src.memview # <<<<<<<<<<<<<< @@ -98227,7 +129518,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_t_4 = __pyx_v_p_src->memview; __pyx_v_dst.memview = __pyx_t_4; - /* "View.MemoryView":736 + /* "View.MemoryView":738 * * dst.memview = p_src.memview * dst.data = p_src.data # <<<<<<<<<<<<<< @@ -98237,7 +129528,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_t_5 = __pyx_v_p_src->data; __pyx_v_dst.data = __pyx_t_5; - /* "View.MemoryView":741 + /* "View.MemoryView":743 * * * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<< @@ -98246,7 +129537,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ __pyx_v_p_dst = (&__pyx_v_dst); - /* "View.MemoryView":742 + /* "View.MemoryView":744 * * cdef __Pyx_memviewslice *p_dst = &dst * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<< @@ -98255,7 +129546,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim); - /* "View.MemoryView":746 + /* "View.MemoryView":748 * cdef bint have_start, have_stop, have_step * * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< @@ -98267,26 +129558,26 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 748, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 748, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 748, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } @@ -98296,7 +129587,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(2, 746, __pyx_L1_error) + else __PYX_ERR(2, 748, __pyx_L1_error) } break; } @@ -98307,7 +129598,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_v_dim = __pyx_t_6; __pyx_t_6 = (__pyx_t_6 + 1); - /* "View.MemoryView":747 + /* "View.MemoryView":749 * * for dim, index in enumerate(indices): * if PyIndex_Check(index): # <<<<<<<<<<<<<< @@ -98317,25 +129608,25 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0); if (__pyx_t_2) { - /* "View.MemoryView":751 + /* "View.MemoryView":753 * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<< * 0, 0, 0, # have_{start,stop,step} * False) */ - __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 751, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 753, __pyx_L1_error) - /* "View.MemoryView":748 + /* "View.MemoryView":750 * for dim, index in enumerate(indices): * if PyIndex_Check(index): * slice_memviewslice( # <<<<<<<<<<<<<< * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 748, __pyx_L1_error) + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 750, __pyx_L1_error) - /* "View.MemoryView":747 + /* "View.MemoryView":749 * * for dim, index in enumerate(indices): * if PyIndex_Check(index): # <<<<<<<<<<<<<< @@ -98345,7 +129636,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ goto __pyx_L6; } - /* "View.MemoryView":754 + /* "View.MemoryView":756 * 0, 0, 0, # have_{start,stop,step} * False) * elif index is None: # <<<<<<<<<<<<<< @@ -98356,7 +129647,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "View.MemoryView":755 + /* "View.MemoryView":757 * False) * elif index is None: * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<< @@ -98365,7 +129656,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1; - /* "View.MemoryView":756 + /* "View.MemoryView":758 * elif index is None: * p_dst.shape[new_ndim] = 1 * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<< @@ -98374,7 +129665,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0; - /* "View.MemoryView":757 + /* "View.MemoryView":759 * p_dst.shape[new_ndim] = 1 * p_dst.strides[new_ndim] = 0 * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<< @@ -98383,7 +129674,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L; - /* "View.MemoryView":758 + /* "View.MemoryView":760 * p_dst.strides[new_ndim] = 0 * p_dst.suboffsets[new_ndim] = -1 * new_ndim += 1 # <<<<<<<<<<<<<< @@ -98392,7 +129683,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); - /* "View.MemoryView":754 + /* "View.MemoryView":756 * 0, 0, 0, # have_{start,stop,step} * False) * elif index is None: # <<<<<<<<<<<<<< @@ -98402,7 +129693,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ goto __pyx_L6; } - /* "View.MemoryView":760 + /* "View.MemoryView":762 * new_ndim += 1 * else: * start = index.start or 0 # <<<<<<<<<<<<<< @@ -98410,13 +129701,13 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * step = index.step or 0 */ /*else*/ { - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 760, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 762, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 760, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 762, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 760, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 762, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_bool_binop_done; @@ -98425,20 +129716,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_L7_bool_binop_done:; __pyx_v_start = __pyx_t_10; - /* "View.MemoryView":761 + /* "View.MemoryView":763 * else: * start = index.start or 0 * stop = index.stop or 0 # <<<<<<<<<<<<<< * step = index.step or 0 * */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 761, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 761, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 763, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 761, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 763, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_bool_binop_done; @@ -98447,20 +129738,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_L9_bool_binop_done:; __pyx_v_stop = __pyx_t_10; - /* "View.MemoryView":762 + /* "View.MemoryView":764 * start = index.start or 0 * stop = index.stop or 0 * step = index.step or 0 # <<<<<<<<<<<<<< * * have_start = index.start is not None */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 762, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 762, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 764, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 762, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 764, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L11_bool_binop_done; @@ -98469,55 +129760,55 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_L11_bool_binop_done:; __pyx_v_step = __pyx_t_10; - /* "View.MemoryView":764 + /* "View.MemoryView":766 * step = index.step or 0 * * have_start = index.start is not None # <<<<<<<<<<<<<< * have_stop = index.stop is not None * have_step = index.step is not None */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 764, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_have_start = __pyx_t_1; - /* "View.MemoryView":765 + /* "View.MemoryView":767 * * have_start = index.start is not None * have_stop = index.stop is not None # <<<<<<<<<<<<<< * have_step = index.step is not None * */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 765, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_have_stop = __pyx_t_1; - /* "View.MemoryView":766 + /* "View.MemoryView":768 * have_start = index.start is not None * have_stop = index.stop is not None * have_step = index.step is not None # <<<<<<<<<<<<<< * * slice_memviewslice( */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 766, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_have_step = __pyx_t_1; - /* "View.MemoryView":768 + /* "View.MemoryView":770 * have_step = index.step is not None * * slice_memviewslice( # <<<<<<<<<<<<<< * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 768, __pyx_L1_error) + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 770, __pyx_L1_error) - /* "View.MemoryView":774 + /* "View.MemoryView":776 * have_start, have_stop, have_step, * True) * new_ndim += 1 # <<<<<<<<<<<<<< @@ -98528,7 +129819,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ } __pyx_L6:; - /* "View.MemoryView":746 + /* "View.MemoryView":748 * cdef bint have_start, have_stop, have_step * * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< @@ -98538,7 +129829,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":776 + /* "View.MemoryView":778 * new_ndim += 1 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< @@ -98549,7 +129840,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":777 + /* "View.MemoryView":779 * * if isinstance(memview, _memoryviewslice): * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< @@ -98558,39 +129849,39 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ __Pyx_XDECREF(((PyObject *)__pyx_r)); - /* "View.MemoryView":778 + /* "View.MemoryView":780 * if isinstance(memview, _memoryviewslice): * return memoryview_fromslice(dst, new_ndim, * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<< * memviewsliceobj.to_dtype_func, * memview.dtype_is_object) */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 778, __pyx_L1_error) } + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 780, __pyx_L1_error) } - /* "View.MemoryView":779 + /* "View.MemoryView":781 * return memoryview_fromslice(dst, new_ndim, * memviewsliceobj.to_object_func, * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<< * memview.dtype_is_object) * else: */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 779, __pyx_L1_error) } + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 781, __pyx_L1_error) } - /* "View.MemoryView":777 + /* "View.MemoryView":779 * * if isinstance(memview, _memoryviewslice): * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< * memviewsliceobj.to_object_func, * memviewsliceobj.to_dtype_func, */ - __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 777, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 777, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 779, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "View.MemoryView":776 + /* "View.MemoryView":778 * new_ndim += 1 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< @@ -98599,7 +129890,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ } - /* "View.MemoryView":782 + /* "View.MemoryView":784 * memview.dtype_is_object) * else: * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< @@ -98609,30 +129900,30 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ /*else*/ { __Pyx_XDECREF(((PyObject *)__pyx_r)); - /* "View.MemoryView":783 + /* "View.MemoryView":785 * else: * return memoryview_fromslice(dst, new_ndim, NULL, NULL, * memview.dtype_is_object) # <<<<<<<<<<<<<< * * */ - __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 782, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "View.MemoryView":782 + /* "View.MemoryView":784 * memview.dtype_is_object) * else: * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< * memview.dtype_is_object) * */ - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 782, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 784, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; } - /* "View.MemoryView":710 + /* "View.MemoryView":712 * * @cname('__pyx_memview_slice') * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< @@ -98654,7 +129945,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ return __pyx_r; } -/* "View.MemoryView":807 +/* "View.MemoryView":809 * * @cname('__pyx_memoryview_slice_memviewslice') * cdef int slice_memviewslice( # <<<<<<<<<<<<<< @@ -98673,7 +129964,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, const char *__pyx_filename = NULL; int __pyx_clineno = 0; - /* "View.MemoryView":827 + /* "View.MemoryView":829 * cdef bint negative_step * * if not is_slice: # <<<<<<<<<<<<<< @@ -98683,7 +129974,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0); if (__pyx_t_1) { - /* "View.MemoryView":829 + /* "View.MemoryView":831 * if not is_slice: * * if start < 0: # <<<<<<<<<<<<<< @@ -98693,7 +129984,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_1 = ((__pyx_v_start < 0) != 0); if (__pyx_t_1) { - /* "View.MemoryView":830 + /* "View.MemoryView":832 * * if start < 0: * start += shape # <<<<<<<<<<<<<< @@ -98702,7 +129993,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_start = (__pyx_v_start + __pyx_v_shape); - /* "View.MemoryView":829 + /* "View.MemoryView":831 * if not is_slice: * * if start < 0: # <<<<<<<<<<<<<< @@ -98711,7 +130002,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":831 + /* "View.MemoryView":833 * if start < 0: * start += shape * if not 0 <= start < shape: # <<<<<<<<<<<<<< @@ -98725,16 +130016,16 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":832 + /* "View.MemoryView":834 * start += shape * if not 0 <= start < shape: * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<< * else: * */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 832, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 834, __pyx_L1_error) - /* "View.MemoryView":831 + /* "View.MemoryView":833 * if start < 0: * start += shape * if not 0 <= start < shape: # <<<<<<<<<<<<<< @@ -98743,7 +130034,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":827 + /* "View.MemoryView":829 * cdef bint negative_step * * if not is_slice: # <<<<<<<<<<<<<< @@ -98753,7 +130044,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L3; } - /* "View.MemoryView":835 + /* "View.MemoryView":837 * else: * * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<< @@ -98772,7 +130063,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_L6_bool_binop_done:; __pyx_v_negative_step = __pyx_t_2; - /* "View.MemoryView":837 + /* "View.MemoryView":839 * negative_step = have_step != 0 and step < 0 * * if have_step and step == 0: # <<<<<<<<<<<<<< @@ -98790,16 +130081,16 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_L9_bool_binop_done:; if (__pyx_t_2) { - /* "View.MemoryView":838 + /* "View.MemoryView":840 * * if have_step and step == 0: * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<< * * */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 838, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 840, __pyx_L1_error) - /* "View.MemoryView":837 + /* "View.MemoryView":839 * negative_step = have_step != 0 and step < 0 * * if have_step and step == 0: # <<<<<<<<<<<<<< @@ -98808,7 +130099,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":841 + /* "View.MemoryView":843 * * * if have_start: # <<<<<<<<<<<<<< @@ -98818,7 +130109,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = (__pyx_v_have_start != 0); if (__pyx_t_2) { - /* "View.MemoryView":842 + /* "View.MemoryView":844 * * if have_start: * if start < 0: # <<<<<<<<<<<<<< @@ -98828,7 +130119,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_start < 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":843 + /* "View.MemoryView":845 * if have_start: * if start < 0: * start += shape # <<<<<<<<<<<<<< @@ -98837,7 +130128,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_start = (__pyx_v_start + __pyx_v_shape); - /* "View.MemoryView":844 + /* "View.MemoryView":846 * if start < 0: * start += shape * if start < 0: # <<<<<<<<<<<<<< @@ -98847,7 +130138,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_start < 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":845 + /* "View.MemoryView":847 * start += shape * if start < 0: * start = 0 # <<<<<<<<<<<<<< @@ -98856,7 +130147,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_start = 0; - /* "View.MemoryView":844 + /* "View.MemoryView":846 * if start < 0: * start += shape * if start < 0: # <<<<<<<<<<<<<< @@ -98865,7 +130156,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":842 + /* "View.MemoryView":844 * * if have_start: * if start < 0: # <<<<<<<<<<<<<< @@ -98875,7 +130166,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L12; } - /* "View.MemoryView":846 + /* "View.MemoryView":848 * if start < 0: * start = 0 * elif start >= shape: # <<<<<<<<<<<<<< @@ -98885,7 +130176,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0); if (__pyx_t_2) { - /* "View.MemoryView":847 + /* "View.MemoryView":849 * start = 0 * elif start >= shape: * if negative_step: # <<<<<<<<<<<<<< @@ -98895,7 +130186,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = (__pyx_v_negative_step != 0); if (__pyx_t_2) { - /* "View.MemoryView":848 + /* "View.MemoryView":850 * elif start >= shape: * if negative_step: * start = shape - 1 # <<<<<<<<<<<<<< @@ -98904,7 +130195,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_start = (__pyx_v_shape - 1); - /* "View.MemoryView":847 + /* "View.MemoryView":849 * start = 0 * elif start >= shape: * if negative_step: # <<<<<<<<<<<<<< @@ -98914,7 +130205,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L14; } - /* "View.MemoryView":850 + /* "View.MemoryView":852 * start = shape - 1 * else: * start = shape # <<<<<<<<<<<<<< @@ -98926,7 +130217,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } __pyx_L14:; - /* "View.MemoryView":846 + /* "View.MemoryView":848 * if start < 0: * start = 0 * elif start >= shape: # <<<<<<<<<<<<<< @@ -98936,7 +130227,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } __pyx_L12:; - /* "View.MemoryView":841 + /* "View.MemoryView":843 * * * if have_start: # <<<<<<<<<<<<<< @@ -98946,7 +130237,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L11; } - /* "View.MemoryView":852 + /* "View.MemoryView":854 * start = shape * else: * if negative_step: # <<<<<<<<<<<<<< @@ -98957,7 +130248,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = (__pyx_v_negative_step != 0); if (__pyx_t_2) { - /* "View.MemoryView":853 + /* "View.MemoryView":855 * else: * if negative_step: * start = shape - 1 # <<<<<<<<<<<<<< @@ -98966,7 +130257,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_start = (__pyx_v_shape - 1); - /* "View.MemoryView":852 + /* "View.MemoryView":854 * start = shape * else: * if negative_step: # <<<<<<<<<<<<<< @@ -98976,7 +130267,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L15; } - /* "View.MemoryView":855 + /* "View.MemoryView":857 * start = shape - 1 * else: * start = 0 # <<<<<<<<<<<<<< @@ -98990,7 +130281,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } __pyx_L11:; - /* "View.MemoryView":857 + /* "View.MemoryView":859 * start = 0 * * if have_stop: # <<<<<<<<<<<<<< @@ -99000,7 +130291,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = (__pyx_v_have_stop != 0); if (__pyx_t_2) { - /* "View.MemoryView":858 + /* "View.MemoryView":860 * * if have_stop: * if stop < 0: # <<<<<<<<<<<<<< @@ -99010,7 +130301,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_stop < 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":859 + /* "View.MemoryView":861 * if have_stop: * if stop < 0: * stop += shape # <<<<<<<<<<<<<< @@ -99019,7 +130310,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape); - /* "View.MemoryView":860 + /* "View.MemoryView":862 * if stop < 0: * stop += shape * if stop < 0: # <<<<<<<<<<<<<< @@ -99029,7 +130320,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_stop < 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":861 + /* "View.MemoryView":863 * stop += shape * if stop < 0: * stop = 0 # <<<<<<<<<<<<<< @@ -99038,7 +130329,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_stop = 0; - /* "View.MemoryView":860 + /* "View.MemoryView":862 * if stop < 0: * stop += shape * if stop < 0: # <<<<<<<<<<<<<< @@ -99047,7 +130338,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":858 + /* "View.MemoryView":860 * * if have_stop: * if stop < 0: # <<<<<<<<<<<<<< @@ -99057,7 +130348,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L17; } - /* "View.MemoryView":862 + /* "View.MemoryView":864 * if stop < 0: * stop = 0 * elif stop > shape: # <<<<<<<<<<<<<< @@ -99067,7 +130358,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0); if (__pyx_t_2) { - /* "View.MemoryView":863 + /* "View.MemoryView":865 * stop = 0 * elif stop > shape: * stop = shape # <<<<<<<<<<<<<< @@ -99076,7 +130367,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_stop = __pyx_v_shape; - /* "View.MemoryView":862 + /* "View.MemoryView":864 * if stop < 0: * stop = 0 * elif stop > shape: # <<<<<<<<<<<<<< @@ -99086,7 +130377,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } __pyx_L17:; - /* "View.MemoryView":857 + /* "View.MemoryView":859 * start = 0 * * if have_stop: # <<<<<<<<<<<<<< @@ -99096,7 +130387,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L16; } - /* "View.MemoryView":865 + /* "View.MemoryView":867 * stop = shape * else: * if negative_step: # <<<<<<<<<<<<<< @@ -99107,7 +130398,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = (__pyx_v_negative_step != 0); if (__pyx_t_2) { - /* "View.MemoryView":866 + /* "View.MemoryView":868 * else: * if negative_step: * stop = -1 # <<<<<<<<<<<<<< @@ -99116,7 +130407,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_stop = -1L; - /* "View.MemoryView":865 + /* "View.MemoryView":867 * stop = shape * else: * if negative_step: # <<<<<<<<<<<<<< @@ -99126,7 +130417,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L19; } - /* "View.MemoryView":868 + /* "View.MemoryView":870 * stop = -1 * else: * stop = shape # <<<<<<<<<<<<<< @@ -99140,7 +130431,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } __pyx_L16:; - /* "View.MemoryView":870 + /* "View.MemoryView":872 * stop = shape * * if not have_step: # <<<<<<<<<<<<<< @@ -99150,7 +130441,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":871 + /* "View.MemoryView":873 * * if not have_step: * step = 1 # <<<<<<<<<<<<<< @@ -99159,7 +130450,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_step = 1; - /* "View.MemoryView":870 + /* "View.MemoryView":872 * stop = shape * * if not have_step: # <<<<<<<<<<<<<< @@ -99168,7 +130459,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":875 + /* "View.MemoryView":877 * * with cython.cdivision(True): * new_shape = (stop - start) // step # <<<<<<<<<<<<<< @@ -99177,7 +130468,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step); - /* "View.MemoryView":877 + /* "View.MemoryView":879 * new_shape = (stop - start) // step * * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< @@ -99187,7 +130478,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":878 + /* "View.MemoryView":880 * * if (stop - start) - step * new_shape: * new_shape += 1 # <<<<<<<<<<<<<< @@ -99196,7 +130487,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_new_shape = (__pyx_v_new_shape + 1); - /* "View.MemoryView":877 + /* "View.MemoryView":879 * new_shape = (stop - start) // step * * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< @@ -99205,7 +130496,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":880 + /* "View.MemoryView":882 * new_shape += 1 * * if new_shape < 0: # <<<<<<<<<<<<<< @@ -99215,7 +130506,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":881 + /* "View.MemoryView":883 * * if new_shape < 0: * new_shape = 0 # <<<<<<<<<<<<<< @@ -99224,7 +130515,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_new_shape = 0; - /* "View.MemoryView":880 + /* "View.MemoryView":882 * new_shape += 1 * * if new_shape < 0: # <<<<<<<<<<<<<< @@ -99233,7 +130524,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":884 + /* "View.MemoryView":886 * * * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<< @@ -99242,7 +130533,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step); - /* "View.MemoryView":885 + /* "View.MemoryView":887 * * dst.strides[new_ndim] = stride * step * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<< @@ -99251,7 +130542,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape; - /* "View.MemoryView":886 + /* "View.MemoryView":888 * dst.strides[new_ndim] = stride * step * dst.shape[new_ndim] = new_shape * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<< @@ -99262,7 +130553,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } __pyx_L3:; - /* "View.MemoryView":889 + /* "View.MemoryView":891 * * * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< @@ -99272,7 +130563,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":890 + /* "View.MemoryView":892 * * if suboffset_dim[0] < 0: * dst.data += start * stride # <<<<<<<<<<<<<< @@ -99281,7 +130572,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride)); - /* "View.MemoryView":889 + /* "View.MemoryView":891 * * * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< @@ -99291,7 +130582,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L23; } - /* "View.MemoryView":892 + /* "View.MemoryView":894 * dst.data += start * stride * else: * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<< @@ -99304,7 +130595,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } __pyx_L23:; - /* "View.MemoryView":894 + /* "View.MemoryView":896 * dst.suboffsets[suboffset_dim[0]] += start * stride * * if suboffset >= 0: # <<<<<<<<<<<<<< @@ -99314,7 +130605,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":895 + /* "View.MemoryView":897 * * if suboffset >= 0: * if not is_slice: # <<<<<<<<<<<<<< @@ -99324,7 +130615,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":896 + /* "View.MemoryView":898 * if suboffset >= 0: * if not is_slice: * if new_ndim == 0: # <<<<<<<<<<<<<< @@ -99334,7 +130625,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":897 + /* "View.MemoryView":899 * if not is_slice: * if new_ndim == 0: * dst.data = ( dst.data)[0] + suboffset # <<<<<<<<<<<<<< @@ -99343,7 +130634,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset); - /* "View.MemoryView":896 + /* "View.MemoryView":898 * if suboffset >= 0: * if not is_slice: * if new_ndim == 0: # <<<<<<<<<<<<<< @@ -99353,7 +130644,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L26; } - /* "View.MemoryView":899 + /* "View.MemoryView":901 * dst.data = ( dst.data)[0] + suboffset * else: * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<< @@ -99362,18 +130653,18 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ /*else*/ { - /* "View.MemoryView":900 + /* "View.MemoryView":902 * else: * _err_dim(IndexError, "All dimensions preceding dimension %d " * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<< * else: * suboffset_dim[0] = new_ndim */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 899, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 901, __pyx_L1_error) } __pyx_L26:; - /* "View.MemoryView":895 + /* "View.MemoryView":897 * * if suboffset >= 0: * if not is_slice: # <<<<<<<<<<<<<< @@ -99383,7 +130674,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L25; } - /* "View.MemoryView":902 + /* "View.MemoryView":904 * "must be indexed and not sliced", dim) * else: * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<< @@ -99395,7 +130686,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } __pyx_L25:; - /* "View.MemoryView":894 + /* "View.MemoryView":896 * dst.suboffsets[suboffset_dim[0]] += start * stride * * if suboffset >= 0: # <<<<<<<<<<<<<< @@ -99404,7 +130695,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":904 + /* "View.MemoryView":906 * suboffset_dim[0] = new_ndim * * return 0 # <<<<<<<<<<<<<< @@ -99414,7 +130705,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_r = 0; goto __pyx_L0; - /* "View.MemoryView":807 + /* "View.MemoryView":809 * * @cname('__pyx_memoryview_slice_memviewslice') * cdef int slice_memviewslice( # <<<<<<<<<<<<<< @@ -99438,7 +130729,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, return __pyx_r; } -/* "View.MemoryView":910 +/* "View.MemoryView":912 * * @cname('__pyx_pybuffer_index') * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< @@ -99463,7 +130754,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pybuffer_index", 0); - /* "View.MemoryView":912 + /* "View.MemoryView":914 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, * Py_ssize_t dim) except NULL: * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<< @@ -99472,7 +130763,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ __pyx_v_suboffset = -1L; - /* "View.MemoryView":913 + /* "View.MemoryView":915 * Py_ssize_t dim) except NULL: * cdef Py_ssize_t shape, stride, suboffset = -1 * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<< @@ -99482,7 +130773,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P __pyx_t_1 = __pyx_v_view->itemsize; __pyx_v_itemsize = __pyx_t_1; - /* "View.MemoryView":916 + /* "View.MemoryView":918 * cdef char *resultp * * if view.ndim == 0: # <<<<<<<<<<<<<< @@ -99492,7 +130783,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":917 + /* "View.MemoryView":919 * * if view.ndim == 0: * shape = view.len / itemsize # <<<<<<<<<<<<<< @@ -99501,15 +130792,15 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(2, 917, __pyx_L1_error) + __PYX_ERR(2, 919, __pyx_L1_error) } else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) { PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); - __PYX_ERR(2, 917, __pyx_L1_error) + __PYX_ERR(2, 919, __pyx_L1_error) } __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); - /* "View.MemoryView":918 + /* "View.MemoryView":920 * if view.ndim == 0: * shape = view.len / itemsize * stride = itemsize # <<<<<<<<<<<<<< @@ -99518,7 +130809,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ __pyx_v_stride = __pyx_v_itemsize; - /* "View.MemoryView":916 + /* "View.MemoryView":918 * cdef char *resultp * * if view.ndim == 0: # <<<<<<<<<<<<<< @@ -99528,7 +130819,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P goto __pyx_L3; } - /* "View.MemoryView":920 + /* "View.MemoryView":922 * stride = itemsize * else: * shape = view.shape[dim] # <<<<<<<<<<<<<< @@ -99538,7 +130829,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P /*else*/ { __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]); - /* "View.MemoryView":921 + /* "View.MemoryView":923 * else: * shape = view.shape[dim] * stride = view.strides[dim] # <<<<<<<<<<<<<< @@ -99547,7 +130838,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]); - /* "View.MemoryView":922 + /* "View.MemoryView":924 * shape = view.shape[dim] * stride = view.strides[dim] * if view.suboffsets != NULL: # <<<<<<<<<<<<<< @@ -99557,7 +130848,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0); if (__pyx_t_2) { - /* "View.MemoryView":923 + /* "View.MemoryView":925 * stride = view.strides[dim] * if view.suboffsets != NULL: * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<< @@ -99566,7 +130857,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]); - /* "View.MemoryView":922 + /* "View.MemoryView":924 * shape = view.shape[dim] * stride = view.strides[dim] * if view.suboffsets != NULL: # <<<<<<<<<<<<<< @@ -99577,7 +130868,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P } __pyx_L3:; - /* "View.MemoryView":925 + /* "View.MemoryView":927 * suboffset = view.suboffsets[dim] * * if index < 0: # <<<<<<<<<<<<<< @@ -99587,7 +130878,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P __pyx_t_2 = ((__pyx_v_index < 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":926 + /* "View.MemoryView":928 * * if index < 0: * index += view.shape[dim] # <<<<<<<<<<<<<< @@ -99596,7 +130887,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim])); - /* "View.MemoryView":927 + /* "View.MemoryView":929 * if index < 0: * index += view.shape[dim] * if index < 0: # <<<<<<<<<<<<<< @@ -99606,26 +130897,26 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P __pyx_t_2 = ((__pyx_v_index < 0) != 0); if (unlikely(__pyx_t_2)) { - /* "View.MemoryView":928 + /* "View.MemoryView":930 * index += view.shape[dim] * if index < 0: * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< * * if index >= shape: */ - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 928, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 928, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 928, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 928, __pyx_L1_error) + __PYX_ERR(2, 930, __pyx_L1_error) - /* "View.MemoryView":927 + /* "View.MemoryView":929 * if index < 0: * index += view.shape[dim] * if index < 0: # <<<<<<<<<<<<<< @@ -99634,7 +130925,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ } - /* "View.MemoryView":925 + /* "View.MemoryView":927 * suboffset = view.suboffsets[dim] * * if index < 0: # <<<<<<<<<<<<<< @@ -99643,7 +130934,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ } - /* "View.MemoryView":930 + /* "View.MemoryView":932 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) * * if index >= shape: # <<<<<<<<<<<<<< @@ -99653,26 +130944,26 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0); if (unlikely(__pyx_t_2)) { - /* "View.MemoryView":931 + /* "View.MemoryView":933 * * if index >= shape: * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< * * resultp = bufp + index * stride */ - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 931, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 933, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 931, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 933, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 931, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 933, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 931, __pyx_L1_error) + __PYX_ERR(2, 933, __pyx_L1_error) - /* "View.MemoryView":930 + /* "View.MemoryView":932 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) * * if index >= shape: # <<<<<<<<<<<<<< @@ -99681,7 +130972,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ } - /* "View.MemoryView":933 + /* "View.MemoryView":935 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) * * resultp = bufp + index * stride # <<<<<<<<<<<<<< @@ -99690,7 +130981,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride)); - /* "View.MemoryView":934 + /* "View.MemoryView":936 * * resultp = bufp + index * stride * if suboffset >= 0: # <<<<<<<<<<<<<< @@ -99700,7 +130991,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":935 + /* "View.MemoryView":937 * resultp = bufp + index * stride * if suboffset >= 0: * resultp = ( resultp)[0] + suboffset # <<<<<<<<<<<<<< @@ -99709,7 +131000,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset); - /* "View.MemoryView":934 + /* "View.MemoryView":936 * * resultp = bufp + index * stride * if suboffset >= 0: # <<<<<<<<<<<<<< @@ -99718,7 +131009,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ } - /* "View.MemoryView":937 + /* "View.MemoryView":939 * resultp = ( resultp)[0] + suboffset * * return resultp # <<<<<<<<<<<<<< @@ -99728,7 +131019,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P __pyx_r = __pyx_v_resultp; goto __pyx_L0; - /* "View.MemoryView":910 + /* "View.MemoryView":912 * * @cname('__pyx_pybuffer_index') * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< @@ -99747,7 +131038,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P return __pyx_r; } -/* "View.MemoryView":943 +/* "View.MemoryView":945 * * @cname('__pyx_memslice_transpose') * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< @@ -99775,7 +131066,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { const char *__pyx_filename = NULL; int __pyx_clineno = 0; - /* "View.MemoryView":944 + /* "View.MemoryView":946 * @cname('__pyx_memslice_transpose') * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<< @@ -99785,7 +131076,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { __pyx_t_1 = __pyx_v_memslice->memview->view.ndim; __pyx_v_ndim = __pyx_t_1; - /* "View.MemoryView":946 + /* "View.MemoryView":948 * cdef int ndim = memslice.memview.view.ndim * * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<< @@ -99795,7 +131086,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { __pyx_t_2 = __pyx_v_memslice->shape; __pyx_v_shape = __pyx_t_2; - /* "View.MemoryView":947 + /* "View.MemoryView":949 * * cdef Py_ssize_t *shape = memslice.shape * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<< @@ -99805,7 +131096,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { __pyx_t_2 = __pyx_v_memslice->strides; __pyx_v_strides = __pyx_t_2; - /* "View.MemoryView":951 + /* "View.MemoryView":953 * * cdef int i, j * for i in range(ndim / 2): # <<<<<<<<<<<<<< @@ -99817,7 +131108,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "View.MemoryView":952 + /* "View.MemoryView":954 * cdef int i, j * for i in range(ndim / 2): * j = ndim - 1 - i # <<<<<<<<<<<<<< @@ -99826,7 +131117,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { */ __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i); - /* "View.MemoryView":953 + /* "View.MemoryView":955 * for i in range(ndim / 2): * j = ndim - 1 - i * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<< @@ -99838,7 +131129,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5; (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6; - /* "View.MemoryView":954 + /* "View.MemoryView":956 * j = ndim - 1 - i * strides[i], strides[j] = strides[j], strides[i] * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<< @@ -99850,7 +131141,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6; (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5; - /* "View.MemoryView":956 + /* "View.MemoryView":958 * shape[i], shape[j] = shape[j], shape[i] * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< @@ -99868,16 +131159,16 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { __pyx_L6_bool_binop_done:; if (__pyx_t_7) { - /* "View.MemoryView":957 + /* "View.MemoryView":959 * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<< * * return 1 */ - __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 957, __pyx_L1_error) + __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 959, __pyx_L1_error) - /* "View.MemoryView":956 + /* "View.MemoryView":958 * shape[i], shape[j] = shape[j], shape[i] * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< @@ -99887,7 +131178,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { } } - /* "View.MemoryView":959 + /* "View.MemoryView":961 * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") * * return 1 # <<<<<<<<<<<<<< @@ -99897,7 +131188,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { __pyx_r = 1; goto __pyx_L0; - /* "View.MemoryView":943 + /* "View.MemoryView":945 * * @cname('__pyx_memslice_transpose') * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< @@ -99921,7 +131212,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { return __pyx_r; } -/* "View.MemoryView":976 +/* "View.MemoryView":978 * cdef int (*to_dtype_func)(char *, object) except 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -99944,7 +131235,7 @@ static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewsl __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "View.MemoryView":977 + /* "View.MemoryView":979 * * def __dealloc__(self): * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<< @@ -99953,7 +131244,7 @@ static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewsl */ __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1); - /* "View.MemoryView":976 + /* "View.MemoryView":978 * cdef int (*to_dtype_func)(char *, object) except 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -99965,7 +131256,7 @@ static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewsl __Pyx_RefNannyFinishContext(); } -/* "View.MemoryView":979 +/* "View.MemoryView":981 * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< @@ -99983,7 +131274,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor int __pyx_clineno = 0; __Pyx_RefNannySetupContext("convert_item_to_object", 0); - /* "View.MemoryView":980 + /* "View.MemoryView":982 * * cdef convert_item_to_object(self, char *itemp): * if self.to_object_func != NULL: # <<<<<<<<<<<<<< @@ -99993,7 +131284,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0); if (__pyx_t_1) { - /* "View.MemoryView":981 + /* "View.MemoryView":983 * cdef convert_item_to_object(self, char *itemp): * if self.to_object_func != NULL: * return self.to_object_func(itemp) # <<<<<<<<<<<<<< @@ -100001,13 +131292,13 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor * return memoryview.convert_item_to_object(self, itemp) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 981, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":980 + /* "View.MemoryView":982 * * cdef convert_item_to_object(self, char *itemp): * if self.to_object_func != NULL: # <<<<<<<<<<<<<< @@ -100016,7 +131307,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor */ } - /* "View.MemoryView":983 + /* "View.MemoryView":985 * return self.to_object_func(itemp) * else: * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<< @@ -100025,14 +131316,14 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 983, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } - /* "View.MemoryView":979 + /* "View.MemoryView":981 * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< @@ -100051,7 +131342,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor return __pyx_r; } -/* "View.MemoryView":985 +/* "View.MemoryView":987 * return memoryview.convert_item_to_object(self, itemp) * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< @@ -100070,7 +131361,7 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo int __pyx_clineno = 0; __Pyx_RefNannySetupContext("assign_item_from_object", 0); - /* "View.MemoryView":986 + /* "View.MemoryView":988 * * cdef assign_item_from_object(self, char *itemp, object value): * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< @@ -100080,16 +131371,16 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0); if (__pyx_t_1) { - /* "View.MemoryView":987 + /* "View.MemoryView":989 * cdef assign_item_from_object(self, char *itemp, object value): * if self.to_dtype_func != NULL: * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<< * else: * memoryview.assign_item_from_object(self, itemp, value) */ - __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 987, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 989, __pyx_L1_error) - /* "View.MemoryView":986 + /* "View.MemoryView":988 * * cdef assign_item_from_object(self, char *itemp, object value): * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< @@ -100099,7 +131390,7 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo goto __pyx_L3; } - /* "View.MemoryView":989 + /* "View.MemoryView":991 * self.to_dtype_func(itemp, value) * else: * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<< @@ -100107,13 +131398,13 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo * @property */ /*else*/ { - __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 989, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 991, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L3:; - /* "View.MemoryView":985 + /* "View.MemoryView":987 * return memoryview.convert_item_to_object(self, itemp) * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< @@ -100134,7 +131425,7 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo return __pyx_r; } -/* "View.MemoryView":992 +/* "View.MemoryView":994 * * @property * def base(self): # <<<<<<<<<<<<<< @@ -100160,7 +131451,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":993 + /* "View.MemoryView":995 * @property * def base(self): * return self.from_object # <<<<<<<<<<<<<< @@ -100172,7 +131463,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__ __pyx_r = __pyx_v_self->from_object; goto __pyx_L0; - /* "View.MemoryView":992 + /* "View.MemoryView":994 * * @property * def base(self): # <<<<<<<<<<<<<< @@ -100300,7 +131591,7 @@ static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUS return __pyx_r; } -/* "View.MemoryView":999 +/* "View.MemoryView":1001 * * @cname('__pyx_memoryview_fromslice') * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< @@ -100328,7 +131619,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl int __pyx_clineno = 0; __Pyx_RefNannySetupContext("memoryview_fromslice", 0); - /* "View.MemoryView":1007 + /* "View.MemoryView":1009 * cdef _memoryviewslice result * * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< @@ -100338,7 +131629,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0); if (__pyx_t_1) { - /* "View.MemoryView":1008 + /* "View.MemoryView":1010 * * if memviewslice.memview == Py_None: * return None # <<<<<<<<<<<<<< @@ -100349,7 +131640,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "View.MemoryView":1007 + /* "View.MemoryView":1009 * cdef _memoryviewslice result * * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< @@ -100358,16 +131649,16 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ } - /* "View.MemoryView":1013 + /* "View.MemoryView":1015 * * * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<< * * result.from_slice = memviewslice */ - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1013, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1015, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1013, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1015, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -100378,13 +131669,13 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1013, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1015, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":1015 + /* "View.MemoryView":1017 * result = _memoryviewslice(None, 0, dtype_is_object) * * result.from_slice = memviewslice # <<<<<<<<<<<<<< @@ -100393,7 +131684,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->from_slice = __pyx_v_memviewslice; - /* "View.MemoryView":1016 + /* "View.MemoryView":1018 * * result.from_slice = memviewslice * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<< @@ -100402,14 +131693,14 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1); - /* "View.MemoryView":1018 + /* "View.MemoryView":1020 * __PYX_INC_MEMVIEW(&memviewslice, 1) * * result.from_object = ( memviewslice.memview).base # <<<<<<<<<<<<<< * result.typeinfo = memviewslice.memview.typeinfo * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1018, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1020, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_result->from_object); @@ -100417,7 +131708,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_v_result->from_object = __pyx_t_2; __pyx_t_2 = 0; - /* "View.MemoryView":1019 + /* "View.MemoryView":1021 * * result.from_object = ( memviewslice.memview).base * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<< @@ -100427,7 +131718,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo; __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4; - /* "View.MemoryView":1021 + /* "View.MemoryView":1023 * result.typeinfo = memviewslice.memview.typeinfo * * result.view = memviewslice.memview.view # <<<<<<<<<<<<<< @@ -100437,7 +131728,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_5 = __pyx_v_memviewslice.memview->view; __pyx_v_result->__pyx_base.view = __pyx_t_5; - /* "View.MemoryView":1022 + /* "View.MemoryView":1024 * * result.view = memviewslice.memview.view * result.view.buf = memviewslice.data # <<<<<<<<<<<<<< @@ -100446,7 +131737,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data); - /* "View.MemoryView":1023 + /* "View.MemoryView":1025 * result.view = memviewslice.memview.view * result.view.buf = memviewslice.data * result.view.ndim = ndim # <<<<<<<<<<<<<< @@ -100455,7 +131746,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim; - /* "View.MemoryView":1024 + /* "View.MemoryView":1026 * result.view.buf = memviewslice.data * result.view.ndim = ndim * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<< @@ -100464,7 +131755,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None; - /* "View.MemoryView":1025 + /* "View.MemoryView":1027 * result.view.ndim = ndim * (<__pyx_buffer *> &result.view).obj = Py_None * Py_INCREF(Py_None) # <<<<<<<<<<<<<< @@ -100473,7 +131764,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ Py_INCREF(Py_None); - /* "View.MemoryView":1027 + /* "View.MemoryView":1029 * Py_INCREF(Py_None) * * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<< @@ -100483,7 +131774,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0); if (__pyx_t_1) { - /* "View.MemoryView":1028 + /* "View.MemoryView":1030 * * if (memviewslice.memview).flags & PyBUF_WRITABLE: * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<< @@ -100492,7 +131783,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS; - /* "View.MemoryView":1027 + /* "View.MemoryView":1029 * Py_INCREF(Py_None) * * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<< @@ -100502,7 +131793,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl goto __pyx_L4; } - /* "View.MemoryView":1030 + /* "View.MemoryView":1032 * result.flags = PyBUF_RECORDS * else: * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<< @@ -100514,7 +131805,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl } __pyx_L4:; - /* "View.MemoryView":1032 + /* "View.MemoryView":1034 * result.flags = PyBUF_RECORDS_RO * * result.view.shape = result.from_slice.shape # <<<<<<<<<<<<<< @@ -100523,7 +131814,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape); - /* "View.MemoryView":1033 + /* "View.MemoryView":1035 * * result.view.shape = result.from_slice.shape * result.view.strides = result.from_slice.strides # <<<<<<<<<<<<<< @@ -100532,7 +131823,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides); - /* "View.MemoryView":1036 + /* "View.MemoryView":1038 * * * result.view.suboffsets = NULL # <<<<<<<<<<<<<< @@ -100541,7 +131832,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->__pyx_base.view.suboffsets = NULL; - /* "View.MemoryView":1037 + /* "View.MemoryView":1039 * * result.view.suboffsets = NULL * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<< @@ -100553,7 +131844,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_6 = __pyx_t_8; __pyx_v_suboffset = (__pyx_t_6[0]); - /* "View.MemoryView":1038 + /* "View.MemoryView":1040 * result.view.suboffsets = NULL * for suboffset in result.from_slice.suboffsets[:ndim]: * if suboffset >= 0: # <<<<<<<<<<<<<< @@ -100563,7 +131854,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0); if (__pyx_t_1) { - /* "View.MemoryView":1039 + /* "View.MemoryView":1041 * for suboffset in result.from_slice.suboffsets[:ndim]: * if suboffset >= 0: * result.view.suboffsets = result.from_slice.suboffsets # <<<<<<<<<<<<<< @@ -100572,7 +131863,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets); - /* "View.MemoryView":1040 + /* "View.MemoryView":1042 * if suboffset >= 0: * result.view.suboffsets = result.from_slice.suboffsets * break # <<<<<<<<<<<<<< @@ -100581,7 +131872,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ goto __pyx_L6_break; - /* "View.MemoryView":1038 + /* "View.MemoryView":1040 * result.view.suboffsets = NULL * for suboffset in result.from_slice.suboffsets[:ndim]: * if suboffset >= 0: # <<<<<<<<<<<<<< @@ -100592,7 +131883,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl } __pyx_L6_break:; - /* "View.MemoryView":1042 + /* "View.MemoryView":1044 * break * * result.view.len = result.view.itemsize # <<<<<<<<<<<<<< @@ -100602,7 +131893,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize; __pyx_v_result->__pyx_base.view.len = __pyx_t_9; - /* "View.MemoryView":1043 + /* "View.MemoryView":1045 * * result.view.len = result.view.itemsize * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<< @@ -100612,29 +131903,29 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim); for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { __pyx_t_6 = __pyx_t_8; - __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1043, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1045, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":1044 + /* "View.MemoryView":1046 * result.view.len = result.view.itemsize * for length in result.view.shape[:ndim]: * result.view.len *= length # <<<<<<<<<<<<<< * * result.to_object_func = to_object_func */ - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1044, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1046, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1044, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1046, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1044, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1046, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result->__pyx_base.view.len = __pyx_t_9; } - /* "View.MemoryView":1046 + /* "View.MemoryView":1048 * result.view.len *= length * * result.to_object_func = to_object_func # <<<<<<<<<<<<<< @@ -100643,7 +131934,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->to_object_func = __pyx_v_to_object_func; - /* "View.MemoryView":1047 + /* "View.MemoryView":1049 * * result.to_object_func = to_object_func * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<< @@ -100652,7 +131943,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func; - /* "View.MemoryView":1049 + /* "View.MemoryView":1051 * result.to_dtype_func = to_dtype_func * * return result # <<<<<<<<<<<<<< @@ -100664,7 +131955,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; - /* "View.MemoryView":999 + /* "View.MemoryView":1001 * * @cname('__pyx_memoryview_fromslice') * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< @@ -100686,7 +131977,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl return __pyx_r; } -/* "View.MemoryView":1052 +/* "View.MemoryView":1054 * * @cname('__pyx_memoryview_get_slice_from_memoryview') * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< @@ -100706,7 +131997,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_slice_from_memview", 0); - /* "View.MemoryView":1055 + /* "View.MemoryView":1057 * __Pyx_memviewslice *mslice) except NULL: * cdef _memoryviewslice obj * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< @@ -100717,20 +132008,20 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":1056 + /* "View.MemoryView":1058 * cdef _memoryviewslice obj * if isinstance(memview, _memoryviewslice): * obj = memview # <<<<<<<<<<<<<< * return &obj.from_slice * else: */ - if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1056, __pyx_L1_error) + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1058, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":1057 + /* "View.MemoryView":1059 * if isinstance(memview, _memoryviewslice): * obj = memview * return &obj.from_slice # <<<<<<<<<<<<<< @@ -100740,7 +132031,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p __pyx_r = (&__pyx_v_obj->from_slice); goto __pyx_L0; - /* "View.MemoryView":1055 + /* "View.MemoryView":1057 * __Pyx_memviewslice *mslice) except NULL: * cdef _memoryviewslice obj * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< @@ -100749,7 +132040,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p */ } - /* "View.MemoryView":1059 + /* "View.MemoryView":1061 * return &obj.from_slice * else: * slice_copy(memview, mslice) # <<<<<<<<<<<<<< @@ -100759,7 +132050,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p /*else*/ { __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice); - /* "View.MemoryView":1060 + /* "View.MemoryView":1062 * else: * slice_copy(memview, mslice) * return mslice # <<<<<<<<<<<<<< @@ -100770,7 +132061,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p goto __pyx_L0; } - /* "View.MemoryView":1052 + /* "View.MemoryView":1054 * * @cname('__pyx_memoryview_get_slice_from_memoryview') * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< @@ -100789,7 +132080,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p return __pyx_r; } -/* "View.MemoryView":1063 +/* "View.MemoryView":1065 * * @cname('__pyx_memoryview_slice_copy') * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< @@ -100810,7 +132101,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem Py_ssize_t __pyx_t_5; __Pyx_RefNannySetupContext("slice_copy", 0); - /* "View.MemoryView":1067 + /* "View.MemoryView":1069 * cdef (Py_ssize_t*) shape, strides, suboffsets * * shape = memview.view.shape # <<<<<<<<<<<<<< @@ -100820,7 +132111,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem __pyx_t_1 = __pyx_v_memview->view.shape; __pyx_v_shape = __pyx_t_1; - /* "View.MemoryView":1068 + /* "View.MemoryView":1070 * * shape = memview.view.shape * strides = memview.view.strides # <<<<<<<<<<<<<< @@ -100830,7 +132121,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem __pyx_t_1 = __pyx_v_memview->view.strides; __pyx_v_strides = __pyx_t_1; - /* "View.MemoryView":1069 + /* "View.MemoryView":1071 * shape = memview.view.shape * strides = memview.view.strides * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<< @@ -100840,7 +132131,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem __pyx_t_1 = __pyx_v_memview->view.suboffsets; __pyx_v_suboffsets = __pyx_t_1; - /* "View.MemoryView":1071 + /* "View.MemoryView":1073 * suboffsets = memview.view.suboffsets * * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<< @@ -100849,7 +132140,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem */ __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview); - /* "View.MemoryView":1072 + /* "View.MemoryView":1074 * * dst.memview = <__pyx_memoryview *> memview * dst.data = memview.view.buf # <<<<<<<<<<<<<< @@ -100858,7 +132149,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem */ __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf); - /* "View.MemoryView":1074 + /* "View.MemoryView":1076 * dst.data = memview.view.buf * * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<< @@ -100870,7 +132161,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_dim = __pyx_t_4; - /* "View.MemoryView":1075 + /* "View.MemoryView":1077 * * for dim in range(memview.view.ndim): * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<< @@ -100879,7 +132170,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem */ (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]); - /* "View.MemoryView":1076 + /* "View.MemoryView":1078 * for dim in range(memview.view.ndim): * dst.shape[dim] = shape[dim] * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<< @@ -100888,7 +132179,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem */ (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]); - /* "View.MemoryView":1077 + /* "View.MemoryView":1079 * dst.shape[dim] = shape[dim] * dst.strides[dim] = strides[dim] * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<< @@ -100903,7 +132194,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5; } - /* "View.MemoryView":1063 + /* "View.MemoryView":1065 * * @cname('__pyx_memoryview_slice_copy') * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< @@ -100915,7 +132206,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem __Pyx_RefNannyFinishContext(); } -/* "View.MemoryView":1080 +/* "View.MemoryView":1082 * * @cname('__pyx_memoryview_copy_object') * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< @@ -100933,7 +132224,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("memoryview_copy", 0); - /* "View.MemoryView":1083 + /* "View.MemoryView":1085 * "Create a new memoryview object" * cdef __Pyx_memviewslice memviewslice * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<< @@ -100942,7 +132233,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx */ __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice)); - /* "View.MemoryView":1084 + /* "View.MemoryView":1086 * cdef __Pyx_memviewslice memviewslice * slice_copy(memview, &memviewslice) * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<< @@ -100950,13 +132241,13 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx * @cname('__pyx_memoryview_copy_object_from_slice') */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1084, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1086, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "View.MemoryView":1080 + /* "View.MemoryView":1082 * * @cname('__pyx_memoryview_copy_object') * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< @@ -100975,7 +132266,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx return __pyx_r; } -/* "View.MemoryView":1087 +/* "View.MemoryView":1089 * * @cname('__pyx_memoryview_copy_object_from_slice') * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< @@ -100998,7 +132289,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview int __pyx_clineno = 0; __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0); - /* "View.MemoryView":1094 + /* "View.MemoryView":1096 * cdef int (*to_dtype_func)(char *, object) except 0 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< @@ -101009,7 +132300,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":1095 + /* "View.MemoryView":1097 * * if isinstance(memview, _memoryviewslice): * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<< @@ -101019,7 +132310,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func; __pyx_v_to_object_func = __pyx_t_3; - /* "View.MemoryView":1096 + /* "View.MemoryView":1098 * if isinstance(memview, _memoryviewslice): * to_object_func = (<_memoryviewslice> memview).to_object_func * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<< @@ -101029,7 +132320,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func; __pyx_v_to_dtype_func = __pyx_t_4; - /* "View.MemoryView":1094 + /* "View.MemoryView":1096 * cdef int (*to_dtype_func)(char *, object) except 0 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< @@ -101039,7 +132330,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview goto __pyx_L3; } - /* "View.MemoryView":1098 + /* "View.MemoryView":1100 * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func * else: * to_object_func = NULL # <<<<<<<<<<<<<< @@ -101049,7 +132340,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview /*else*/ { __pyx_v_to_object_func = NULL; - /* "View.MemoryView":1099 + /* "View.MemoryView":1101 * else: * to_object_func = NULL * to_dtype_func = NULL # <<<<<<<<<<<<<< @@ -101060,7 +132351,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview } __pyx_L3:; - /* "View.MemoryView":1101 + /* "View.MemoryView":1103 * to_dtype_func = NULL * * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<< @@ -101069,20 +132360,20 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview */ __Pyx_XDECREF(__pyx_r); - /* "View.MemoryView":1103 + /* "View.MemoryView":1105 * return memoryview_fromslice(memviewslice[0], memview.view.ndim, * to_object_func, to_dtype_func, * memview.dtype_is_object) # <<<<<<<<<<<<<< * * */ - __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1101, __pyx_L1_error) + __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - /* "View.MemoryView":1087 + /* "View.MemoryView":1089 * * @cname('__pyx_memoryview_copy_object_from_slice') * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< @@ -101101,7 +132392,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview return __pyx_r; } -/* "View.MemoryView":1109 +/* "View.MemoryView":1111 * * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< @@ -101113,7 +132404,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { Py_ssize_t __pyx_r; int __pyx_t_1; - /* "View.MemoryView":1110 + /* "View.MemoryView":1112 * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: * if arg < 0: # <<<<<<<<<<<<<< @@ -101123,7 +132414,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { __pyx_t_1 = ((__pyx_v_arg < 0) != 0); if (__pyx_t_1) { - /* "View.MemoryView":1111 + /* "View.MemoryView":1113 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: * if arg < 0: * return -arg # <<<<<<<<<<<<<< @@ -101133,7 +132424,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { __pyx_r = (-__pyx_v_arg); goto __pyx_L0; - /* "View.MemoryView":1110 + /* "View.MemoryView":1112 * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: * if arg < 0: # <<<<<<<<<<<<<< @@ -101142,7 +132433,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { */ } - /* "View.MemoryView":1113 + /* "View.MemoryView":1115 * return -arg * else: * return arg # <<<<<<<<<<<<<< @@ -101154,7 +132445,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { goto __pyx_L0; } - /* "View.MemoryView":1109 + /* "View.MemoryView":1111 * * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< @@ -101167,7 +132458,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { return __pyx_r; } -/* "View.MemoryView":1116 +/* "View.MemoryView":1118 * * @cname('__pyx_get_best_slice_order') * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< @@ -101185,7 +132476,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ int __pyx_t_3; int __pyx_t_4; - /* "View.MemoryView":1121 + /* "View.MemoryView":1123 * """ * cdef int i * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<< @@ -101194,7 +132485,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ */ __pyx_v_c_stride = 0; - /* "View.MemoryView":1122 + /* "View.MemoryView":1124 * cdef int i * cdef Py_ssize_t c_stride = 0 * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<< @@ -101203,7 +132494,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ */ __pyx_v_f_stride = 0; - /* "View.MemoryView":1124 + /* "View.MemoryView":1126 * cdef Py_ssize_t f_stride = 0 * * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< @@ -101213,7 +132504,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { __pyx_v_i = __pyx_t_1; - /* "View.MemoryView":1125 + /* "View.MemoryView":1127 * * for i in range(ndim - 1, -1, -1): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< @@ -101223,7 +132514,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1126 + /* "View.MemoryView":1128 * for i in range(ndim - 1, -1, -1): * if mslice.shape[i] > 1: * c_stride = mslice.strides[i] # <<<<<<<<<<<<<< @@ -101232,7 +132523,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ */ __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]); - /* "View.MemoryView":1127 + /* "View.MemoryView":1129 * if mslice.shape[i] > 1: * c_stride = mslice.strides[i] * break # <<<<<<<<<<<<<< @@ -101241,7 +132532,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ */ goto __pyx_L4_break; - /* "View.MemoryView":1125 + /* "View.MemoryView":1127 * * for i in range(ndim - 1, -1, -1): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< @@ -101252,7 +132543,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ } __pyx_L4_break:; - /* "View.MemoryView":1129 + /* "View.MemoryView":1131 * break * * for i in range(ndim): # <<<<<<<<<<<<<< @@ -101264,7 +132555,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "View.MemoryView":1130 + /* "View.MemoryView":1132 * * for i in range(ndim): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< @@ -101274,7 +132565,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1131 + /* "View.MemoryView":1133 * for i in range(ndim): * if mslice.shape[i] > 1: * f_stride = mslice.strides[i] # <<<<<<<<<<<<<< @@ -101283,7 +132574,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ */ __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]); - /* "View.MemoryView":1132 + /* "View.MemoryView":1134 * if mslice.shape[i] > 1: * f_stride = mslice.strides[i] * break # <<<<<<<<<<<<<< @@ -101292,7 +132583,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ */ goto __pyx_L7_break; - /* "View.MemoryView":1130 + /* "View.MemoryView":1132 * * for i in range(ndim): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< @@ -101303,7 +132594,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ } __pyx_L7_break:; - /* "View.MemoryView":1134 + /* "View.MemoryView":1136 * break * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< @@ -101313,7 +132604,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1135 + /* "View.MemoryView":1137 * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): * return 'C' # <<<<<<<<<<<<<< @@ -101323,7 +132614,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ __pyx_r = 'C'; goto __pyx_L0; - /* "View.MemoryView":1134 + /* "View.MemoryView":1136 * break * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< @@ -101332,7 +132623,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ */ } - /* "View.MemoryView":1137 + /* "View.MemoryView":1139 * return 'C' * else: * return 'F' # <<<<<<<<<<<<<< @@ -101344,7 +132635,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ goto __pyx_L0; } - /* "View.MemoryView":1116 + /* "View.MemoryView":1118 * * @cname('__pyx_get_best_slice_order') * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< @@ -101357,7 +132648,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ return __pyx_r; } -/* "View.MemoryView":1140 +/* "View.MemoryView":1142 * * @cython.cdivision(True) * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< @@ -101378,7 +132669,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v Py_ssize_t __pyx_t_5; Py_ssize_t __pyx_t_6; - /* "View.MemoryView":1147 + /* "View.MemoryView":1149 * * cdef Py_ssize_t i * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<< @@ -101387,7 +132678,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ __pyx_v_src_extent = (__pyx_v_src_shape[0]); - /* "View.MemoryView":1148 + /* "View.MemoryView":1150 * cdef Py_ssize_t i * cdef Py_ssize_t src_extent = src_shape[0] * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<< @@ -101396,7 +132687,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ __pyx_v_dst_extent = (__pyx_v_dst_shape[0]); - /* "View.MemoryView":1149 + /* "View.MemoryView":1151 * cdef Py_ssize_t src_extent = src_shape[0] * cdef Py_ssize_t dst_extent = dst_shape[0] * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<< @@ -101405,7 +132696,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ __pyx_v_src_stride = (__pyx_v_src_strides[0]); - /* "View.MemoryView":1150 + /* "View.MemoryView":1152 * cdef Py_ssize_t dst_extent = dst_shape[0] * cdef Py_ssize_t src_stride = src_strides[0] * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<< @@ -101414,7 +132705,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ __pyx_v_dst_stride = (__pyx_v_dst_strides[0]); - /* "View.MemoryView":1152 + /* "View.MemoryView":1154 * cdef Py_ssize_t dst_stride = dst_strides[0] * * if ndim == 1: # <<<<<<<<<<<<<< @@ -101424,7 +132715,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); if (__pyx_t_1) { - /* "View.MemoryView":1153 + /* "View.MemoryView":1155 * * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< @@ -101444,7 +132735,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v goto __pyx_L5_bool_binop_done; } - /* "View.MemoryView":1154 + /* "View.MemoryView":1156 * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and * src_stride == itemsize == dst_stride): # <<<<<<<<<<<<<< @@ -101459,7 +132750,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v __pyx_t_1 = __pyx_t_3; __pyx_L5_bool_binop_done:; - /* "View.MemoryView":1153 + /* "View.MemoryView":1155 * * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< @@ -101468,7 +132759,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ if (__pyx_t_1) { - /* "View.MemoryView":1155 + /* "View.MemoryView":1157 * if (src_stride > 0 and dst_stride > 0 and * src_stride == itemsize == dst_stride): * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<< @@ -101477,7 +132768,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent))); - /* "View.MemoryView":1153 + /* "View.MemoryView":1155 * * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< @@ -101487,7 +132778,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v goto __pyx_L4; } - /* "View.MemoryView":1157 + /* "View.MemoryView":1159 * memcpy(dst_data, src_data, itemsize * dst_extent) * else: * for i in range(dst_extent): # <<<<<<<<<<<<<< @@ -101500,7 +132791,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "View.MemoryView":1158 + /* "View.MemoryView":1160 * else: * for i in range(dst_extent): * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<< @@ -101509,7 +132800,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize)); - /* "View.MemoryView":1159 + /* "View.MemoryView":1161 * for i in range(dst_extent): * memcpy(dst_data, src_data, itemsize) * src_data += src_stride # <<<<<<<<<<<<<< @@ -101518,7 +132809,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); - /* "View.MemoryView":1160 + /* "View.MemoryView":1162 * memcpy(dst_data, src_data, itemsize) * src_data += src_stride * dst_data += dst_stride # <<<<<<<<<<<<<< @@ -101530,7 +132821,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v } __pyx_L4:; - /* "View.MemoryView":1152 + /* "View.MemoryView":1154 * cdef Py_ssize_t dst_stride = dst_strides[0] * * if ndim == 1: # <<<<<<<<<<<<<< @@ -101540,7 +132831,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v goto __pyx_L3; } - /* "View.MemoryView":1162 + /* "View.MemoryView":1164 * dst_data += dst_stride * else: * for i in range(dst_extent): # <<<<<<<<<<<<<< @@ -101553,7 +132844,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "View.MemoryView":1163 + /* "View.MemoryView":1165 * else: * for i in range(dst_extent): * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<< @@ -101562,7 +132853,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize); - /* "View.MemoryView":1167 + /* "View.MemoryView":1169 * src_shape + 1, dst_shape + 1, * ndim - 1, itemsize) * src_data += src_stride # <<<<<<<<<<<<<< @@ -101571,7 +132862,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); - /* "View.MemoryView":1168 + /* "View.MemoryView":1170 * ndim - 1, itemsize) * src_data += src_stride * dst_data += dst_stride # <<<<<<<<<<<<<< @@ -101583,7 +132874,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v } __pyx_L3:; - /* "View.MemoryView":1140 + /* "View.MemoryView":1142 * * @cython.cdivision(True) * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< @@ -101594,7 +132885,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v /* function exit code */ } -/* "View.MemoryView":1170 +/* "View.MemoryView":1172 * dst_data += dst_stride * * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< @@ -101604,7 +132895,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) { - /* "View.MemoryView":1173 + /* "View.MemoryView":1175 * __Pyx_memviewslice *dst, * int ndim, size_t itemsize) nogil: * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<< @@ -101613,7 +132904,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi */ _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize); - /* "View.MemoryView":1170 + /* "View.MemoryView":1172 * dst_data += dst_stride * * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< @@ -101624,7 +132915,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi /* function exit code */ } -/* "View.MemoryView":1177 +/* "View.MemoryView":1179 * * @cname('__pyx_memoryview_slice_get_size') * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< @@ -101641,7 +132932,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr Py_ssize_t *__pyx_t_3; Py_ssize_t *__pyx_t_4; - /* "View.MemoryView":1179 + /* "View.MemoryView":1181 * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: * "Return the size of the memory occupied by the slice in number of bytes" * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<< @@ -101651,7 +132942,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr __pyx_t_1 = __pyx_v_src->memview->view.itemsize; __pyx_v_size = __pyx_t_1; - /* "View.MemoryView":1181 + /* "View.MemoryView":1183 * cdef Py_ssize_t shape, size = src.memview.view.itemsize * * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<< @@ -101663,7 +132954,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr __pyx_t_2 = __pyx_t_4; __pyx_v_shape = (__pyx_t_2[0]); - /* "View.MemoryView":1182 + /* "View.MemoryView":1184 * * for shape in src.shape[:ndim]: * size *= shape # <<<<<<<<<<<<<< @@ -101673,7 +132964,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr __pyx_v_size = (__pyx_v_size * __pyx_v_shape); } - /* "View.MemoryView":1184 + /* "View.MemoryView":1186 * size *= shape * * return size # <<<<<<<<<<<<<< @@ -101683,7 +132974,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr __pyx_r = __pyx_v_size; goto __pyx_L0; - /* "View.MemoryView":1177 + /* "View.MemoryView":1179 * * @cname('__pyx_memoryview_slice_get_size') * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< @@ -101696,7 +132987,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr return __pyx_r; } -/* "View.MemoryView":1187 +/* "View.MemoryView":1189 * * @cname('__pyx_fill_contig_strides_array') * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< @@ -101712,7 +133003,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ int __pyx_t_3; int __pyx_t_4; - /* "View.MemoryView":1196 + /* "View.MemoryView":1198 * cdef int idx * * if order == 'F': # <<<<<<<<<<<<<< @@ -101722,7 +133013,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ __pyx_t_1 = ((__pyx_v_order == 'F') != 0); if (__pyx_t_1) { - /* "View.MemoryView":1197 + /* "View.MemoryView":1199 * * if order == 'F': * for idx in range(ndim): # <<<<<<<<<<<<<< @@ -101734,7 +133025,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_idx = __pyx_t_4; - /* "View.MemoryView":1198 + /* "View.MemoryView":1200 * if order == 'F': * for idx in range(ndim): * strides[idx] = stride # <<<<<<<<<<<<<< @@ -101743,7 +133034,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ */ (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; - /* "View.MemoryView":1199 + /* "View.MemoryView":1201 * for idx in range(ndim): * strides[idx] = stride * stride *= shape[idx] # <<<<<<<<<<<<<< @@ -101753,7 +133044,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); } - /* "View.MemoryView":1196 + /* "View.MemoryView":1198 * cdef int idx * * if order == 'F': # <<<<<<<<<<<<<< @@ -101763,7 +133054,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ goto __pyx_L3; } - /* "View.MemoryView":1201 + /* "View.MemoryView":1203 * stride *= shape[idx] * else: * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< @@ -101774,7 +133065,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) { __pyx_v_idx = __pyx_t_2; - /* "View.MemoryView":1202 + /* "View.MemoryView":1204 * else: * for idx in range(ndim - 1, -1, -1): * strides[idx] = stride # <<<<<<<<<<<<<< @@ -101783,7 +133074,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ */ (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; - /* "View.MemoryView":1203 + /* "View.MemoryView":1205 * for idx in range(ndim - 1, -1, -1): * strides[idx] = stride * stride *= shape[idx] # <<<<<<<<<<<<<< @@ -101795,7 +133086,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ } __pyx_L3:; - /* "View.MemoryView":1205 + /* "View.MemoryView":1207 * stride *= shape[idx] * * return stride # <<<<<<<<<<<<<< @@ -101805,7 +133096,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ __pyx_r = __pyx_v_stride; goto __pyx_L0; - /* "View.MemoryView":1187 + /* "View.MemoryView":1189 * * @cname('__pyx_fill_contig_strides_array') * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< @@ -101818,7 +133109,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ return __pyx_r; } -/* "View.MemoryView":1208 +/* "View.MemoryView":1210 * * @cname('__pyx_memoryview_copy_data_to_temp') * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< @@ -101842,7 +133133,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, const char *__pyx_filename = NULL; int __pyx_clineno = 0; - /* "View.MemoryView":1219 + /* "View.MemoryView":1221 * cdef void *result * * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< @@ -101852,7 +133143,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_t_1 = __pyx_v_src->memview->view.itemsize; __pyx_v_itemsize = __pyx_t_1; - /* "View.MemoryView":1220 + /* "View.MemoryView":1222 * * cdef size_t itemsize = src.memview.view.itemsize * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<< @@ -101861,7 +133152,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, */ __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim); - /* "View.MemoryView":1222 + /* "View.MemoryView":1224 * cdef size_t size = slice_get_size(src, ndim) * * result = malloc(size) # <<<<<<<<<<<<<< @@ -101870,7 +133161,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, */ __pyx_v_result = malloc(__pyx_v_size); - /* "View.MemoryView":1223 + /* "View.MemoryView":1225 * * result = malloc(size) * if not result: # <<<<<<<<<<<<<< @@ -101880,16 +133171,16 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1224 + /* "View.MemoryView":1226 * result = malloc(size) * if not result: * _err(MemoryError, NULL) # <<<<<<<<<<<<<< * * */ - __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 1224, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 1226, __pyx_L1_error) - /* "View.MemoryView":1223 + /* "View.MemoryView":1225 * * result = malloc(size) * if not result: # <<<<<<<<<<<<<< @@ -101898,7 +133189,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, */ } - /* "View.MemoryView":1227 + /* "View.MemoryView":1229 * * * tmpslice.data = result # <<<<<<<<<<<<<< @@ -101907,7 +133198,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, */ __pyx_v_tmpslice->data = ((char *)__pyx_v_result); - /* "View.MemoryView":1228 + /* "View.MemoryView":1230 * * tmpslice.data = result * tmpslice.memview = src.memview # <<<<<<<<<<<<<< @@ -101917,7 +133208,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_t_4 = __pyx_v_src->memview; __pyx_v_tmpslice->memview = __pyx_t_4; - /* "View.MemoryView":1229 + /* "View.MemoryView":1231 * tmpslice.data = result * tmpslice.memview = src.memview * for i in range(ndim): # <<<<<<<<<<<<<< @@ -101929,7 +133220,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "View.MemoryView":1230 + /* "View.MemoryView":1232 * tmpslice.memview = src.memview * for i in range(ndim): * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<< @@ -101938,7 +133229,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, */ (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]); - /* "View.MemoryView":1231 + /* "View.MemoryView":1233 * for i in range(ndim): * tmpslice.shape[i] = src.shape[i] * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< @@ -101948,7 +133239,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L; } - /* "View.MemoryView":1233 + /* "View.MemoryView":1235 * tmpslice.suboffsets[i] = -1 * * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<< @@ -101957,7 +133248,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, */ (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order)); - /* "View.MemoryView":1237 + /* "View.MemoryView":1239 * * * for i in range(ndim): # <<<<<<<<<<<<<< @@ -101969,7 +133260,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "View.MemoryView":1238 + /* "View.MemoryView":1240 * * for i in range(ndim): * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< @@ -101979,7 +133270,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1239 + /* "View.MemoryView":1241 * for i in range(ndim): * if tmpslice.shape[i] == 1: * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<< @@ -101988,7 +133279,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, */ (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0; - /* "View.MemoryView":1238 + /* "View.MemoryView":1240 * * for i in range(ndim): * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< @@ -101998,7 +133289,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, } } - /* "View.MemoryView":1241 + /* "View.MemoryView":1243 * tmpslice.strides[i] = 0 * * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< @@ -102008,7 +133299,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1242 + /* "View.MemoryView":1244 * * if slice_is_contig(src[0], order, ndim): * memcpy(result, src.data, size) # <<<<<<<<<<<<<< @@ -102017,7 +133308,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, */ (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size)); - /* "View.MemoryView":1241 + /* "View.MemoryView":1243 * tmpslice.strides[i] = 0 * * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< @@ -102027,7 +133318,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, goto __pyx_L9; } - /* "View.MemoryView":1244 + /* "View.MemoryView":1246 * memcpy(result, src.data, size) * else: * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<< @@ -102039,7 +133330,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, } __pyx_L9:; - /* "View.MemoryView":1246 + /* "View.MemoryView":1248 * copy_strided_to_strided(src, tmpslice, ndim, itemsize) * * return result # <<<<<<<<<<<<<< @@ -102049,7 +133340,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_r = __pyx_v_result; goto __pyx_L0; - /* "View.MemoryView":1208 + /* "View.MemoryView":1210 * * @cname('__pyx_memoryview_copy_data_to_temp') * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< @@ -102073,7 +133364,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, return __pyx_r; } -/* "View.MemoryView":1251 +/* "View.MemoryView":1253 * * @cname('__pyx_memoryview_err_extents') * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< @@ -102096,20 +133387,20 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent #endif __Pyx_RefNannySetupContext("_err_extents", 0); - /* "View.MemoryView":1254 + /* "View.MemoryView":1256 * Py_ssize_t extent2) except -1 with gil: * raise ValueError("got differing extents in dimension %d (got %d and %d)" % * (i, extent1, extent2)) # <<<<<<<<<<<<<< * * @cname('__pyx_memoryview_err_dim') */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1254, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1254, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1254, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1254, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); @@ -102121,24 +133412,24 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent __pyx_t_2 = 0; __pyx_t_3 = 0; - /* "View.MemoryView":1253 + /* "View.MemoryView":1255 * cdef int _err_extents(int i, Py_ssize_t extent1, * Py_ssize_t extent2) except -1 with gil: * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<< * (i, extent1, extent2)) * */ - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1253, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1253, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(2, 1253, __pyx_L1_error) + __PYX_ERR(2, 1255, __pyx_L1_error) - /* "View.MemoryView":1251 + /* "View.MemoryView":1253 * * @cname('__pyx_memoryview_err_extents') * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< @@ -102161,7 +133452,7 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent return __pyx_r; } -/* "View.MemoryView":1257 +/* "View.MemoryView":1259 * * @cname('__pyx_memoryview_err_dim') * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< @@ -102185,18 +133476,18 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, __Pyx_RefNannySetupContext("_err_dim", 0); __Pyx_INCREF(__pyx_v_error); - /* "View.MemoryView":1258 + /* "View.MemoryView":1260 * @cname('__pyx_memoryview_err_dim') * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<< * * @cname('__pyx_memoryview_err') */ - __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1258, __pyx_L1_error) + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1258, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1258, __pyx_L1_error) + __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1260, __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; @@ -102214,14 +133505,14 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1258, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(2, 1258, __pyx_L1_error) + __PYX_ERR(2, 1260, __pyx_L1_error) - /* "View.MemoryView":1257 + /* "View.MemoryView":1259 * * @cname('__pyx_memoryview_err_dim') * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< @@ -102245,7 +133536,7 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, return __pyx_r; } -/* "View.MemoryView":1261 +/* "View.MemoryView":1263 * * @cname('__pyx_memoryview_err') * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< @@ -102270,7 +133561,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { __Pyx_RefNannySetupContext("_err", 0); __Pyx_INCREF(__pyx_v_error); - /* "View.MemoryView":1262 + /* "View.MemoryView":1264 * @cname('__pyx_memoryview_err') * cdef int _err(object error, char *msg) except -1 with gil: * if msg != NULL: # <<<<<<<<<<<<<< @@ -102280,14 +133571,14 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { __pyx_t_1 = ((__pyx_v_msg != NULL) != 0); if (unlikely(__pyx_t_1)) { - /* "View.MemoryView":1263 + /* "View.MemoryView":1265 * cdef int _err(object error, char *msg) except -1 with gil: * if msg != NULL: * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<< * else: * raise error */ - __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1263, __pyx_L1_error) + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_error); __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; @@ -102303,14 +133594,14 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1263, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(2, 1263, __pyx_L1_error) + __PYX_ERR(2, 1265, __pyx_L1_error) - /* "View.MemoryView":1262 + /* "View.MemoryView":1264 * @cname('__pyx_memoryview_err') * cdef int _err(object error, char *msg) except -1 with gil: * if msg != NULL: # <<<<<<<<<<<<<< @@ -102319,7 +133610,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { */ } - /* "View.MemoryView":1265 + /* "View.MemoryView":1267 * raise error(msg.decode('ascii')) * else: * raise error # <<<<<<<<<<<<<< @@ -102328,10 +133619,10 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { */ /*else*/ { __Pyx_Raise(__pyx_v_error, 0, 0, 0); - __PYX_ERR(2, 1265, __pyx_L1_error) + __PYX_ERR(2, 1267, __pyx_L1_error) } - /* "View.MemoryView":1261 + /* "View.MemoryView":1263 * * @cname('__pyx_memoryview_err') * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< @@ -102355,7 +133646,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { return __pyx_r; } -/* "View.MemoryView":1268 +/* "View.MemoryView":1270 * * @cname('__pyx_memoryview_copy_contents') * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< @@ -102385,7 +133676,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; - /* "View.MemoryView":1276 + /* "View.MemoryView":1278 * Check for overlapping memory and verify the shapes. * """ * cdef void *tmpdata = NULL # <<<<<<<<<<<<<< @@ -102394,7 +133685,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_tmpdata = NULL; - /* "View.MemoryView":1277 + /* "View.MemoryView":1279 * """ * cdef void *tmpdata = NULL * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< @@ -102404,7 +133695,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_1 = __pyx_v_src.memview->view.itemsize; __pyx_v_itemsize = __pyx_t_1; - /* "View.MemoryView":1279 + /* "View.MemoryView":1281 * cdef size_t itemsize = src.memview.view.itemsize * cdef int i * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<< @@ -102413,7 +133704,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim); - /* "View.MemoryView":1280 + /* "View.MemoryView":1282 * cdef int i * cdef char order = get_best_order(&src, src_ndim) * cdef bint broadcasting = False # <<<<<<<<<<<<<< @@ -102422,7 +133713,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_broadcasting = 0; - /* "View.MemoryView":1281 + /* "View.MemoryView":1283 * cdef char order = get_best_order(&src, src_ndim) * cdef bint broadcasting = False * cdef bint direct_copy = False # <<<<<<<<<<<<<< @@ -102431,7 +133722,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_direct_copy = 0; - /* "View.MemoryView":1284 + /* "View.MemoryView":1286 * cdef __Pyx_memviewslice tmp * * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< @@ -102441,7 +133732,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1285 + /* "View.MemoryView":1287 * * if src_ndim < dst_ndim: * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<< @@ -102450,7 +133741,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim); - /* "View.MemoryView":1284 + /* "View.MemoryView":1286 * cdef __Pyx_memviewslice tmp * * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< @@ -102460,7 +133751,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ goto __pyx_L3; } - /* "View.MemoryView":1286 + /* "View.MemoryView":1288 * if src_ndim < dst_ndim: * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< @@ -102470,7 +133761,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1287 + /* "View.MemoryView":1289 * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<< @@ -102479,7 +133770,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim); - /* "View.MemoryView":1286 + /* "View.MemoryView":1288 * if src_ndim < dst_ndim: * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< @@ -102489,7 +133780,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ } __pyx_L3:; - /* "View.MemoryView":1289 + /* "View.MemoryView":1291 * broadcast_leading(&dst, dst_ndim, src_ndim) * * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<< @@ -102505,7 +133796,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ } __pyx_v_ndim = __pyx_t_5; - /* "View.MemoryView":1291 + /* "View.MemoryView":1293 * cdef int ndim = max(src_ndim, dst_ndim) * * for i in range(ndim): # <<<<<<<<<<<<<< @@ -102517,7 +133808,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "View.MemoryView":1292 + /* "View.MemoryView":1294 * * for i in range(ndim): * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< @@ -102527,7 +133818,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1293 + /* "View.MemoryView":1295 * for i in range(ndim): * if src.shape[i] != dst.shape[i]: * if src.shape[i] == 1: # <<<<<<<<<<<<<< @@ -102537,7 +133828,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1294 + /* "View.MemoryView":1296 * if src.shape[i] != dst.shape[i]: * if src.shape[i] == 1: * broadcasting = True # <<<<<<<<<<<<<< @@ -102546,7 +133837,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_broadcasting = 1; - /* "View.MemoryView":1295 + /* "View.MemoryView":1297 * if src.shape[i] == 1: * broadcasting = True * src.strides[i] = 0 # <<<<<<<<<<<<<< @@ -102555,7 +133846,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ (__pyx_v_src.strides[__pyx_v_i]) = 0; - /* "View.MemoryView":1293 + /* "View.MemoryView":1295 * for i in range(ndim): * if src.shape[i] != dst.shape[i]: * if src.shape[i] == 1: # <<<<<<<<<<<<<< @@ -102565,7 +133856,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ goto __pyx_L7; } - /* "View.MemoryView":1297 + /* "View.MemoryView":1299 * src.strides[i] = 0 * else: * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<< @@ -102573,11 +133864,11 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * if src.suboffsets[i] >= 0: */ /*else*/ { - __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1297, __pyx_L1_error) + __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1299, __pyx_L1_error) } __pyx_L7:; - /* "View.MemoryView":1292 + /* "View.MemoryView":1294 * * for i in range(ndim): * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< @@ -102586,7 +133877,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ } - /* "View.MemoryView":1299 + /* "View.MemoryView":1301 * _err_extents(i, dst.shape[i], src.shape[i]) * * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< @@ -102596,16 +133887,16 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1300 + /* "View.MemoryView":1302 * * if src.suboffsets[i] >= 0: * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<< * * if slices_overlap(&src, &dst, ndim, itemsize): */ - __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1300, __pyx_L1_error) + __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1302, __pyx_L1_error) - /* "View.MemoryView":1299 + /* "View.MemoryView":1301 * _err_extents(i, dst.shape[i], src.shape[i]) * * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< @@ -102615,7 +133906,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ } } - /* "View.MemoryView":1302 + /* "View.MemoryView":1304 * _err_dim(ValueError, "Dimension %d is not direct", i) * * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< @@ -102625,7 +133916,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1304 + /* "View.MemoryView":1306 * if slices_overlap(&src, &dst, ndim, itemsize): * * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< @@ -102635,7 +133926,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1305 + /* "View.MemoryView":1307 * * if not slice_is_contig(src, order, ndim): * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<< @@ -102644,7 +133935,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim); - /* "View.MemoryView":1304 + /* "View.MemoryView":1306 * if slices_overlap(&src, &dst, ndim, itemsize): * * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< @@ -102653,17 +133944,17 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ } - /* "View.MemoryView":1307 + /* "View.MemoryView":1309 * order = get_best_order(&dst, ndim) * * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<< * src = tmp * */ - __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(2, 1307, __pyx_L1_error) + __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(2, 1309, __pyx_L1_error) __pyx_v_tmpdata = __pyx_t_7; - /* "View.MemoryView":1308 + /* "View.MemoryView":1310 * * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) * src = tmp # <<<<<<<<<<<<<< @@ -102672,7 +133963,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_src = __pyx_v_tmp; - /* "View.MemoryView":1302 + /* "View.MemoryView":1304 * _err_dim(ValueError, "Dimension %d is not direct", i) * * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< @@ -102681,7 +133972,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ } - /* "View.MemoryView":1310 + /* "View.MemoryView":1312 * src = tmp * * if not broadcasting: # <<<<<<<<<<<<<< @@ -102691,7 +133982,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1313 + /* "View.MemoryView":1315 * * * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< @@ -102701,7 +133992,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1314 + /* "View.MemoryView":1316 * * if slice_is_contig(src, 'C', ndim): * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<< @@ -102710,7 +134001,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim); - /* "View.MemoryView":1313 + /* "View.MemoryView":1315 * * * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< @@ -102720,7 +134011,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ goto __pyx_L12; } - /* "View.MemoryView":1315 + /* "View.MemoryView":1317 * if slice_is_contig(src, 'C', ndim): * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< @@ -102730,7 +134021,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1316 + /* "View.MemoryView":1318 * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<< @@ -102739,7 +134030,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim); - /* "View.MemoryView":1315 + /* "View.MemoryView":1317 * if slice_is_contig(src, 'C', ndim): * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< @@ -102749,7 +134040,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ } __pyx_L12:; - /* "View.MemoryView":1318 + /* "View.MemoryView":1320 * direct_copy = slice_is_contig(dst, 'F', ndim) * * if direct_copy: # <<<<<<<<<<<<<< @@ -102759,7 +134050,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = (__pyx_v_direct_copy != 0); if (__pyx_t_2) { - /* "View.MemoryView":1320 + /* "View.MemoryView":1322 * if direct_copy: * * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< @@ -102768,7 +134059,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); - /* "View.MemoryView":1321 + /* "View.MemoryView":1323 * * refcount_copying(&dst, dtype_is_object, ndim, False) * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<< @@ -102777,7 +134068,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim))); - /* "View.MemoryView":1322 + /* "View.MemoryView":1324 * refcount_copying(&dst, dtype_is_object, ndim, False) * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< @@ -102786,7 +134077,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); - /* "View.MemoryView":1323 + /* "View.MemoryView":1325 * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) * refcount_copying(&dst, dtype_is_object, ndim, True) * free(tmpdata) # <<<<<<<<<<<<<< @@ -102795,7 +134086,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ free(__pyx_v_tmpdata); - /* "View.MemoryView":1324 + /* "View.MemoryView":1326 * refcount_copying(&dst, dtype_is_object, ndim, True) * free(tmpdata) * return 0 # <<<<<<<<<<<<<< @@ -102805,7 +134096,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_r = 0; goto __pyx_L0; - /* "View.MemoryView":1318 + /* "View.MemoryView":1320 * direct_copy = slice_is_contig(dst, 'F', ndim) * * if direct_copy: # <<<<<<<<<<<<<< @@ -102814,7 +134105,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ } - /* "View.MemoryView":1310 + /* "View.MemoryView":1312 * src = tmp * * if not broadcasting: # <<<<<<<<<<<<<< @@ -102823,7 +134114,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ } - /* "View.MemoryView":1326 + /* "View.MemoryView":1328 * return 0 * * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< @@ -102837,25 +134128,25 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_8 = (__pyx_t_2 != 0); if (__pyx_t_8) { - /* "View.MemoryView":1329 + /* "View.MemoryView":1331 * * * transpose_memslice(&src) # <<<<<<<<<<<<<< * transpose_memslice(&dst) * */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1329, __pyx_L1_error) + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1331, __pyx_L1_error) - /* "View.MemoryView":1330 + /* "View.MemoryView":1332 * * transpose_memslice(&src) * transpose_memslice(&dst) # <<<<<<<<<<<<<< * * refcount_copying(&dst, dtype_is_object, ndim, False) */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1330, __pyx_L1_error) + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1332, __pyx_L1_error) - /* "View.MemoryView":1326 + /* "View.MemoryView":1328 * return 0 * * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< @@ -102864,7 +134155,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ } - /* "View.MemoryView":1332 + /* "View.MemoryView":1334 * transpose_memslice(&dst) * * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< @@ -102873,7 +134164,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); - /* "View.MemoryView":1333 + /* "View.MemoryView":1335 * * refcount_copying(&dst, dtype_is_object, ndim, False) * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<< @@ -102882,7 +134173,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize); - /* "View.MemoryView":1334 + /* "View.MemoryView":1336 * refcount_copying(&dst, dtype_is_object, ndim, False) * copy_strided_to_strided(&src, &dst, ndim, itemsize) * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< @@ -102891,7 +134182,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); - /* "View.MemoryView":1336 + /* "View.MemoryView":1338 * refcount_copying(&dst, dtype_is_object, ndim, True) * * free(tmpdata) # <<<<<<<<<<<<<< @@ -102900,7 +134191,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ free(__pyx_v_tmpdata); - /* "View.MemoryView":1337 + /* "View.MemoryView":1339 * * free(tmpdata) * return 0 # <<<<<<<<<<<<<< @@ -102910,7 +134201,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_r = 0; goto __pyx_L0; - /* "View.MemoryView":1268 + /* "View.MemoryView":1270 * * @cname('__pyx_memoryview_copy_contents') * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< @@ -102934,7 +134225,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ return __pyx_r; } -/* "View.MemoryView":1340 +/* "View.MemoryView":1342 * * @cname('__pyx_memoryview_broadcast_leading') * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< @@ -102949,7 +134240,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic int __pyx_t_2; int __pyx_t_3; - /* "View.MemoryView":1344 + /* "View.MemoryView":1346 * int ndim_other) nogil: * cdef int i * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<< @@ -102958,7 +134249,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic */ __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim); - /* "View.MemoryView":1346 + /* "View.MemoryView":1348 * cdef int offset = ndim_other - ndim * * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< @@ -102968,7 +134259,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { __pyx_v_i = __pyx_t_1; - /* "View.MemoryView":1347 + /* "View.MemoryView":1349 * * for i in range(ndim - 1, -1, -1): * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<< @@ -102977,7 +134268,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic */ (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]); - /* "View.MemoryView":1348 + /* "View.MemoryView":1350 * for i in range(ndim - 1, -1, -1): * mslice.shape[i + offset] = mslice.shape[i] * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<< @@ -102986,7 +134277,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic */ (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]); - /* "View.MemoryView":1349 + /* "View.MemoryView":1351 * mslice.shape[i + offset] = mslice.shape[i] * mslice.strides[i + offset] = mslice.strides[i] * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<< @@ -102996,7 +134287,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]); } - /* "View.MemoryView":1351 + /* "View.MemoryView":1353 * mslice.suboffsets[i + offset] = mslice.suboffsets[i] * * for i in range(offset): # <<<<<<<<<<<<<< @@ -103008,7 +134299,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "View.MemoryView":1352 + /* "View.MemoryView":1354 * * for i in range(offset): * mslice.shape[i] = 1 # <<<<<<<<<<<<<< @@ -103017,7 +134308,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic */ (__pyx_v_mslice->shape[__pyx_v_i]) = 1; - /* "View.MemoryView":1353 + /* "View.MemoryView":1355 * for i in range(offset): * mslice.shape[i] = 1 * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<< @@ -103026,7 +134317,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic */ (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]); - /* "View.MemoryView":1354 + /* "View.MemoryView":1356 * mslice.shape[i] = 1 * mslice.strides[i] = mslice.strides[0] * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< @@ -103036,7 +134327,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L; } - /* "View.MemoryView":1340 + /* "View.MemoryView":1342 * * @cname('__pyx_memoryview_broadcast_leading') * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< @@ -103047,7 +134338,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic /* function exit code */ } -/* "View.MemoryView":1362 +/* "View.MemoryView":1364 * * @cname('__pyx_memoryview_refcount_copying') * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< @@ -103058,7 +134349,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) { int __pyx_t_1; - /* "View.MemoryView":1366 + /* "View.MemoryView":1368 * * * if dtype_is_object: # <<<<<<<<<<<<<< @@ -103068,7 +134359,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i __pyx_t_1 = (__pyx_v_dtype_is_object != 0); if (__pyx_t_1) { - /* "View.MemoryView":1367 + /* "View.MemoryView":1369 * * if dtype_is_object: * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<< @@ -103077,7 +134368,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i */ __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc); - /* "View.MemoryView":1366 + /* "View.MemoryView":1368 * * * if dtype_is_object: # <<<<<<<<<<<<<< @@ -103086,7 +134377,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i */ } - /* "View.MemoryView":1362 + /* "View.MemoryView":1364 * * @cname('__pyx_memoryview_refcount_copying') * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< @@ -103097,7 +134388,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i /* function exit code */ } -/* "View.MemoryView":1371 +/* "View.MemoryView":1373 * * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< @@ -103112,7 +134403,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da #endif __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); - /* "View.MemoryView":1374 + /* "View.MemoryView":1376 * Py_ssize_t *strides, int ndim, * bint inc) with gil: * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<< @@ -103121,7 +134412,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da */ __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc); - /* "View.MemoryView":1371 + /* "View.MemoryView":1373 * * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< @@ -103136,7 +134427,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da #endif } -/* "View.MemoryView":1377 +/* "View.MemoryView":1379 * * @cname('__pyx_memoryview_refcount_objects_in_slice') * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< @@ -103153,7 +134444,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss int __pyx_t_4; __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0); - /* "View.MemoryView":1381 + /* "View.MemoryView":1383 * cdef Py_ssize_t i * * for i in range(shape[0]): # <<<<<<<<<<<<<< @@ -103165,7 +134456,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "View.MemoryView":1382 + /* "View.MemoryView":1384 * * for i in range(shape[0]): * if ndim == 1: # <<<<<<<<<<<<<< @@ -103175,7 +134466,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss __pyx_t_4 = ((__pyx_v_ndim == 1) != 0); if (__pyx_t_4) { - /* "View.MemoryView":1383 + /* "View.MemoryView":1385 * for i in range(shape[0]): * if ndim == 1: * if inc: # <<<<<<<<<<<<<< @@ -103185,7 +134476,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss __pyx_t_4 = (__pyx_v_inc != 0); if (__pyx_t_4) { - /* "View.MemoryView":1384 + /* "View.MemoryView":1386 * if ndim == 1: * if inc: * Py_INCREF(( data)[0]) # <<<<<<<<<<<<<< @@ -103194,7 +134485,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss */ Py_INCREF((((PyObject **)__pyx_v_data)[0])); - /* "View.MemoryView":1383 + /* "View.MemoryView":1385 * for i in range(shape[0]): * if ndim == 1: * if inc: # <<<<<<<<<<<<<< @@ -103204,7 +134495,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss goto __pyx_L6; } - /* "View.MemoryView":1386 + /* "View.MemoryView":1388 * Py_INCREF(( data)[0]) * else: * Py_DECREF(( data)[0]) # <<<<<<<<<<<<<< @@ -103216,7 +134507,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss } __pyx_L6:; - /* "View.MemoryView":1382 + /* "View.MemoryView":1384 * * for i in range(shape[0]): * if ndim == 1: # <<<<<<<<<<<<<< @@ -103226,7 +134517,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss goto __pyx_L5; } - /* "View.MemoryView":1388 + /* "View.MemoryView":1390 * Py_DECREF(( data)[0]) * else: * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< @@ -103235,7 +134526,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss */ /*else*/ { - /* "View.MemoryView":1389 + /* "View.MemoryView":1391 * else: * refcount_objects_in_slice(data, shape + 1, strides + 1, * ndim - 1, inc) # <<<<<<<<<<<<<< @@ -103246,7 +134537,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss } __pyx_L5:; - /* "View.MemoryView":1391 + /* "View.MemoryView":1393 * ndim - 1, inc) * * data += strides[0] # <<<<<<<<<<<<<< @@ -103256,7 +134547,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0])); } - /* "View.MemoryView":1377 + /* "View.MemoryView":1379 * * @cname('__pyx_memoryview_refcount_objects_in_slice') * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< @@ -103268,7 +134559,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss __Pyx_RefNannyFinishContext(); } -/* "View.MemoryView":1397 +/* "View.MemoryView":1399 * * @cname('__pyx_memoryview_slice_assign_scalar') * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< @@ -103278,7 +134569,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) { - /* "View.MemoryView":1400 + /* "View.MemoryView":1402 * size_t itemsize, void *item, * bint dtype_is_object) nogil: * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< @@ -103287,7 +134578,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst */ __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0); - /* "View.MemoryView":1401 + /* "View.MemoryView":1403 * bint dtype_is_object) nogil: * refcount_copying(dst, dtype_is_object, ndim, False) * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<< @@ -103296,7 +134587,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst */ __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item); - /* "View.MemoryView":1403 + /* "View.MemoryView":1405 * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, * itemsize, item) * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< @@ -103305,7 +134596,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst */ __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1); - /* "View.MemoryView":1397 + /* "View.MemoryView":1399 * * @cname('__pyx_memoryview_slice_assign_scalar') * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< @@ -103316,7 +134607,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst /* function exit code */ } -/* "View.MemoryView":1407 +/* "View.MemoryView":1409 * * @cname('__pyx_memoryview__slice_assign_scalar') * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< @@ -103333,7 +134624,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; - /* "View.MemoryView":1411 + /* "View.MemoryView":1413 * size_t itemsize, void *item) nogil: * cdef Py_ssize_t i * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<< @@ -103342,7 +134633,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t */ __pyx_v_stride = (__pyx_v_strides[0]); - /* "View.MemoryView":1412 + /* "View.MemoryView":1414 * cdef Py_ssize_t i * cdef Py_ssize_t stride = strides[0] * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<< @@ -103351,7 +134642,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t */ __pyx_v_extent = (__pyx_v_shape[0]); - /* "View.MemoryView":1414 + /* "View.MemoryView":1416 * cdef Py_ssize_t extent = shape[0] * * if ndim == 1: # <<<<<<<<<<<<<< @@ -103361,7 +134652,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); if (__pyx_t_1) { - /* "View.MemoryView":1415 + /* "View.MemoryView":1417 * * if ndim == 1: * for i in range(extent): # <<<<<<<<<<<<<< @@ -103373,7 +134664,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "View.MemoryView":1416 + /* "View.MemoryView":1418 * if ndim == 1: * for i in range(extent): * memcpy(data, item, itemsize) # <<<<<<<<<<<<<< @@ -103382,7 +134673,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t */ (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize)); - /* "View.MemoryView":1417 + /* "View.MemoryView":1419 * for i in range(extent): * memcpy(data, item, itemsize) * data += stride # <<<<<<<<<<<<<< @@ -103392,7 +134683,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t __pyx_v_data = (__pyx_v_data + __pyx_v_stride); } - /* "View.MemoryView":1414 + /* "View.MemoryView":1416 * cdef Py_ssize_t extent = shape[0] * * if ndim == 1: # <<<<<<<<<<<<<< @@ -103402,7 +134693,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t goto __pyx_L3; } - /* "View.MemoryView":1419 + /* "View.MemoryView":1421 * data += stride * else: * for i in range(extent): # <<<<<<<<<<<<<< @@ -103415,7 +134706,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "View.MemoryView":1420 + /* "View.MemoryView":1422 * else: * for i in range(extent): * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< @@ -103424,7 +134715,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t */ __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item); - /* "View.MemoryView":1422 + /* "View.MemoryView":1424 * _slice_assign_scalar(data, shape + 1, strides + 1, * ndim - 1, itemsize, item) * data += stride # <<<<<<<<<<<<<< @@ -103436,7 +134727,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t } __pyx_L3:; - /* "View.MemoryView":1407 + /* "View.MemoryView":1409 * * @cname('__pyx_memoryview__slice_assign_scalar') * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< @@ -103534,12 +134825,12 @@ static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSE PyObject *__pyx_v___pyx_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; + PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -103548,114 +134839,118 @@ static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSE /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result - * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<< + * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) */ - __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0); - if (__pyx_t_1) { + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__26, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { /* "(tree fragment)":5 * cdef object __pyx_result - * if __pyx_checksum != 0xb068931: + * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< - * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) * __pyx_result = Enum.__new__(__pyx_type) */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_2); - __pyx_v___pyx_PickleError = __pyx_t_2; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError); + __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v___pyx_PickleError = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "(tree fragment)":6 - * if __pyx_checksum != 0xb068931: + * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< * __pyx_result = Enum.__new__(__pyx_type) * if __pyx_state is not None: */ - __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_INCREF(__pyx_v___pyx_PickleError); - __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); + __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); + __Pyx_DECREF_SET(__pyx_t_1, function); } } - __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(2, 6, __pyx_L1_error) /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result - * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<< + * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) */ } /* "(tree fragment)":7 * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); + __Pyx_DECREF_SET(__pyx_t_1, function); } } - __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v___pyx_result = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v___pyx_type); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v___pyx_result = __pyx_t_4; + __pyx_t_4 = 0; /* "(tree fragment)":8 - * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) * __pyx_result = Enum.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) * return __pyx_result */ - __pyx_t_1 = (__pyx_v___pyx_state != Py_None); - __pyx_t_6 = (__pyx_t_1 != 0); - if (__pyx_t_6) { + __pyx_t_3 = (__pyx_v___pyx_state != Py_None); + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { /* "(tree fragment)":9 * __pyx_result = Enum.__new__(__pyx_type) @@ -103665,12 +134960,12 @@ static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSE * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error) - __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "(tree fragment)":8 - * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) * __pyx_result = Enum.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) @@ -103698,10 +134993,10 @@ static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSE /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -104839,10 +136134,31 @@ static PyMethodDef __pyx_methods[] = { {"compute_sdp_rule", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9cyext_acv_77compute_sdp_rule, METH_VARARGS|METH_KEYWORDS, 0}, {"compute_sdp_maxrule", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9cyext_acv_79compute_sdp_maxrule, METH_VARARGS|METH_KEYWORDS, 0}, {"compute_sdp_maxrule_verbose", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9cyext_acv_81compute_sdp_maxrule_verbose, METH_VARARGS|METH_KEYWORDS, 0}, - {"compute_sdp_rf", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9cyext_acv_83compute_sdp_rf, METH_VARARGS|METH_KEYWORDS, 0}, - {"compute_sdp_rf_same_set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9cyext_acv_85compute_sdp_rf_same_set, METH_VARARGS|METH_KEYWORDS, 0}, - {"global_sdp_rf", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9cyext_acv_87global_sdp_rf, METH_VARARGS|METH_KEYWORDS, 0}, - {"sufficient_expl_rf", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9cyext_acv_89sufficient_expl_rf, METH_VARARGS|METH_KEYWORDS, 0}, + {"compute_ddp_rule", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9cyext_acv_83compute_ddp_rule, METH_VARARGS|METH_KEYWORDS, 0}, + {"compute_ddp_weights", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9cyext_acv_85compute_ddp_weights, METH_VARARGS|METH_KEYWORDS, 0}, + {"compute_ddp_weights_verbose", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9cyext_acv_87compute_ddp_weights_verbose, METH_VARARGS|METH_KEYWORDS, 0}, + {"compute_ddp_cond_weights", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9cyext_acv_89compute_ddp_cond_weights, METH_VARARGS|METH_KEYWORDS, 0}, + {"compute_sdp_rf", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9cyext_acv_91compute_sdp_rf, METH_VARARGS|METH_KEYWORDS, 0}, + {"compute_ddp_rf", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9cyext_acv_93compute_ddp_rf, METH_VARARGS|METH_KEYWORDS, 0}, + {"compute_ddp_rf_same_set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9cyext_acv_95compute_ddp_rf_same_set, METH_VARARGS|METH_KEYWORDS, 0}, + {"global_ddp_rf", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9cyext_acv_97global_ddp_rf, METH_VARARGS|METH_KEYWORDS, 0}, + {"compute_sdp_rf_same_set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9cyext_acv_99compute_sdp_rf_same_set, METH_VARARGS|METH_KEYWORDS, 0}, + {"global_sdp_rf", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9cyext_acv_101global_sdp_rf, METH_VARARGS|METH_KEYWORDS, 0}, + {"sufficient_expl_rf", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9cyext_acv_103sufficient_expl_rf, METH_VARARGS|METH_KEYWORDS, 0}, + {"sufficient_cxpl_rf", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9cyext_acv_105sufficient_cxpl_rf, METH_VARARGS|METH_KEYWORDS, 0}, + {"compute_ddp_intv_weights", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9cyext_acv_107compute_ddp_intv_weights, METH_VARARGS|METH_KEYWORDS, 0}, + {"compute_ddp_intv_same_set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9cyext_acv_109compute_ddp_intv_same_set, METH_VARARGS|METH_KEYWORDS, 0}, + {"global_ddp_intv", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9cyext_acv_111global_ddp_intv, METH_VARARGS|METH_KEYWORDS, 0}, + {"compute_cdp_rule", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9cyext_acv_113compute_cdp_rule, METH_VARARGS|METH_KEYWORDS, 0}, + {"compute_cdp_cond_weights", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9cyext_acv_115compute_cdp_cond_weights, METH_VARARGS|METH_KEYWORDS, 0}, + {"compute_cdp_rf", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9cyext_acv_117compute_cdp_rf, METH_VARARGS|METH_KEYWORDS, 0}, + {"compute_cdp_rf_same_set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9cyext_acv_119compute_cdp_rf_same_set, METH_VARARGS|METH_KEYWORDS, 0}, + {"global_cdp_rf", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9cyext_acv_121global_cdp_rf, METH_VARARGS|METH_KEYWORDS, 0}, + {"compute_cdp_weights", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9cyext_acv_123compute_cdp_weights, METH_VARARGS|METH_KEYWORDS, 0}, + {"compute_cdp_weights_verbose", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9cyext_acv_125compute_cdp_weights_verbose, METH_VARARGS|METH_KEYWORDS, 0}, + {"compute_cdp_intv_weights", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9cyext_acv_127compute_cdp_intv_weights, METH_VARARGS|METH_KEYWORDS, 0}, + {"compute_cdp_intv_same_set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9cyext_acv_129compute_cdp_intv_same_set, METH_VARARGS|METH_KEYWORDS, 0}, + {"global_cdp_intv", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9cyext_acv_131global_cdp_intv, METH_VARARGS|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; @@ -104896,10 +136212,11 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0}, {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0}, {&__pyx_kp_s_Check_condition_in_the_computati, __pyx_k_Check_condition_in_the_computati, sizeof(__pyx_k_Check_condition_in_the_computati), 0, 0, 1, 0}, + {&__pyx_n_s_DOWN, __pyx_k_DOWN, sizeof(__pyx_k_DOWN), 0, 0, 1, 1}, {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1}, {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0}, {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, - {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0}, + {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0}, {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0}, @@ -104915,6 +136232,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_S, __pyx_k_S, sizeof(__pyx_k_S), 0, 0, 1, 1}, {&__pyx_n_s_S_star, __pyx_k_S_star, sizeof(__pyx_k_S_star), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_n_s_UP, __pyx_k_UP, sizeof(__pyx_k_UP), 0, 0, 1, 1}, {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1}, @@ -104942,6 +136260,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_comb, __pyx_k_comb, sizeof(__pyx_k_comb), 0, 0, 1, 1}, {&__pyx_n_s_combinations, __pyx_k_combinations, sizeof(__pyx_k_combinations), 0, 0, 1, 1}, {&__pyx_n_s_concatenate, __pyx_k_concatenate, sizeof(__pyx_k_concatenate), 0, 0, 1, 1}, + {&__pyx_n_s_cond, __pyx_k_cond, sizeof(__pyx_k_cond), 0, 0, 1, 1}, {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0}, {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0}, {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, @@ -104949,6 +136268,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_double, __pyx_k_double, sizeof(__pyx_k_double), 0, 0, 1, 1}, + {&__pyx_n_s_down, __pyx_k_down, sizeof(__pyx_k_down), 0, 0, 1, 1}, {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1}, {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, @@ -105048,6 +136368,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0}, {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0}, {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1}, + {&__pyx_n_s_up, __pyx_k_up, sizeof(__pyx_k_up), 0, 0, 1, 1}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, {&__pyx_n_s_weighted_percentile, __pyx_k_weighted_percentile, sizeof(__pyx_k_weighted_percentile), 0, 0, 1, 1}, @@ -105062,12 +136383,12 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 906, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 2501, __pyx_L1_error) __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 945, __pyx_L1_error) - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 148, __pyx_L1_error) - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 151, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 149, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 152, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 2, __pyx_L1_error) - __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 404, __pyx_L1_error) - __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 613, __pyx_L1_error) - __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 832, __pyx_L1_error) + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 406, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 615, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 834, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -105135,7 +136456,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":945 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":945 * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -105146,7 +136467,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":951 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":951 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -105157,58 +136478,58 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - /* "View.MemoryView":133 + /* "View.MemoryView":134 * * if not self.ndim: * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< * * if itemsize <= 0: */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 133, __pyx_L1_error) + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); - /* "View.MemoryView":136 + /* "View.MemoryView":137 * * if itemsize <= 0: * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< * * if not isinstance(format, bytes): */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 136, __pyx_L1_error) + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); - /* "View.MemoryView":148 + /* "View.MemoryView":149 * * if not self._shape: * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< * * */ - __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 148, __pyx_L1_error) + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); - /* "View.MemoryView":176 + /* "View.MemoryView":177 * self.data = malloc(self.len) * if not self.data: * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< * * if self.dtype_is_object: */ - __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 176, __pyx_L1_error) + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); - /* "View.MemoryView":192 + /* "View.MemoryView":193 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * if not (flags & bufmode): * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< * info.buf = self.data * info.len = self.len */ - __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 192, __pyx_L1_error) + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); @@ -105231,58 +136552,58 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); - /* "View.MemoryView":418 + /* "View.MemoryView":420 * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<< * * have_slices, index = _unellipsify(index, self.view.ndim) */ - __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 418, __pyx_L1_error) + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); - /* "View.MemoryView":495 + /* "View.MemoryView":497 * result = struct.unpack(self.view.format, bytesitem) * except struct.error: * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< * else: * if len(self.view.format) == 1: */ - __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 495, __pyx_L1_error) + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); - /* "View.MemoryView":520 + /* "View.MemoryView":522 * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<< * * if flags & PyBUF_ND: */ - __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 520, __pyx_L1_error) + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); - /* "View.MemoryView":570 + /* "View.MemoryView":572 * if self.view.strides == NULL: * * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 570, __pyx_L1_error) + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); - /* "View.MemoryView":577 + /* "View.MemoryView":579 * def suboffsets(self): * if self.view.suboffsets == NULL: * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ - __pyx_tuple__20 = PyTuple_New(1); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 577, __pyx_L1_error) + __pyx_tuple__20 = PyTuple_New(1); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); @@ -105308,14 +136629,14 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); - /* "View.MemoryView":703 + /* "View.MemoryView":705 * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< * * */ - __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 703, __pyx_L1_error) + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 705, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); @@ -105337,6 +136658,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_tuple__26 = PyTuple_Pack(3, __pyx_int_184977713, __pyx_int_136983863, __pyx_int_112105877); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); /* "cyext_acv.pyx":455 * return np.array(sdp) @@ -105345,75 +136669,75 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * s = list(iterable) * return itertools.chain.from_iterable(itertools.combinations(s, r) for r in range(len(s) + 1)) */ - __pyx_tuple__26 = PyTuple_Pack(4, __pyx_n_s_iterable, __pyx_n_s_s, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); - __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_acv_explainers_cyext_acv_cyext_a, __pyx_n_s_powerset, 455, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 455, __pyx_L1_error) + __pyx_tuple__27 = PyTuple_Pack(4, __pyx_n_s_iterable, __pyx_n_s_s, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 455, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_acv_explainers_cyext_acv_cyext_a, __pyx_n_s_powerset, 455, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 455, __pyx_L1_error) - /* "View.MemoryView":286 + /* "View.MemoryView":287 * return self.name * * cdef generic = Enum("") # <<<<<<<<<<<<<< * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(2, 286, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(2, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); - /* "View.MemoryView":287 + /* "View.MemoryView":288 * * cdef generic = Enum("") * cdef strided = Enum("") # default # <<<<<<<<<<<<<< * cdef indirect = Enum("") * */ - __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(2, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(2, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); - /* "View.MemoryView":288 + /* "View.MemoryView":289 * cdef generic = Enum("") * cdef strided = Enum("") # default * cdef indirect = Enum("") # <<<<<<<<<<<<<< * * */ - __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(2, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__30); - __Pyx_GIVEREF(__pyx_tuple__30); + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(2, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); - /* "View.MemoryView":291 + /* "View.MemoryView":292 * * * cdef contiguous = Enum("") # <<<<<<<<<<<<<< * cdef indirect_contiguous = Enum("") * */ - __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(2, 291, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__31); - __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(2, 292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); - /* "View.MemoryView":292 + /* "View.MemoryView":293 * * cdef contiguous = Enum("") * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< * * */ - __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(2, 292, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__32); - __Pyx_GIVEREF(__pyx_tuple__32); + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(2, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); /* "(tree fragment)":1 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ - __pyx_tuple__33 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(2, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__33); - __Pyx_GIVEREF(__pyx_tuple__33); - __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(2, 1, __pyx_L1_error) + __pyx_tuple__34 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(2, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -105430,6 +136754,7 @@ PyEval_InitThreads(); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_umethod_PyList_Type_copy.type = (PyObject*)&PyList_Type; + __pyx_umethod_PyList_Type_remove.type = (PyObject*)&PyList_Type; if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_float_1e_10 = PyFloat_FromDouble(1e+10); if (unlikely(!__pyx_float_1e_10)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_float_neg_1e_10 = PyFloat_FromDouble(-1e+10); if (unlikely(!__pyx_float_neg_1e_10)) __PYX_ERR(0, 1, __pyx_L1_error) @@ -105437,6 +136762,8 @@ if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_112105877 = PyInt_FromLong(112105877L); if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_136983863 = PyInt_FromLong(136983863L); if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; @@ -105506,21 +136833,21 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_ptype_9cyext_acv___pyx_scope_struct_1_genexpr = &__pyx_type_9cyext_acv___pyx_scope_struct_1_genexpr; __pyx_vtabptr_array = &__pyx_vtable_array; __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview; - if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 106, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type___pyx_array.tp_print = 0; #endif - if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 106, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 106, __pyx_L1_error) __pyx_array_type = &__pyx_type___pyx_array; - if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 279, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 280, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type___pyx_MemviewEnum.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 279, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 280, __pyx_L1_error) __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum; __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview; __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer; @@ -105530,30 +136857,30 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed; __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object; __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object; - if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 331, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type___pyx_memoryview.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 331, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 331, __pyx_L1_error) __pyx_memoryview_type = &__pyx_type___pyx_memoryview; __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; - if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 967, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type___pyx_memoryviewslice.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 967, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 967, __pyx_L1_error) __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; __Pyx_RefNannyFinishContext(); return 0; @@ -105949,90 +137276,90 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":209 + /* "View.MemoryView":210 * info.obj = self * * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< * * def __dealloc__(array self): */ - __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 209, __pyx_L1_error) + __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 209, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 210, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_array_type); - /* "View.MemoryView":286 + /* "View.MemoryView":287 * return self.name * * cdef generic = Enum("") # <<<<<<<<<<<<<< * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 286, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(generic); __Pyx_DECREF_SET(generic, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":287 + /* "View.MemoryView":288 * * cdef generic = Enum("") * cdef strided = Enum("") # default # <<<<<<<<<<<<<< * cdef indirect = Enum("") * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 287, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(strided); __Pyx_DECREF_SET(strided, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":288 + /* "View.MemoryView":289 * cdef generic = Enum("") * cdef strided = Enum("") # default * cdef indirect = Enum("") # <<<<<<<<<<<<<< * * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 288, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(indirect); __Pyx_DECREF_SET(indirect, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":291 + /* "View.MemoryView":292 * * * cdef contiguous = Enum("") # <<<<<<<<<<<<<< * cdef indirect_contiguous = Enum("") * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 291, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(contiguous); __Pyx_DECREF_SET(contiguous, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":292 + /* "View.MemoryView":293 * * cdef contiguous = Enum("") * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< * * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 292, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(indirect_contiguous); __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":316 + /* "View.MemoryView":317 * * DEF THREAD_LOCKS_PREALLOCATED = 8 * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<< @@ -106041,7 +137368,7 @@ if (!__Pyx_RefNanny) { */ __pyx_memoryview_thread_locks_used = 0; - /* "View.MemoryView":317 + /* "View.MemoryView":318 * DEF THREAD_LOCKS_PREALLOCATED = 8 * cdef int __pyx_memoryview_thread_locks_used = 0 * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<< @@ -106058,29 +137385,29 @@ if (!__Pyx_RefNanny) { __pyx_t_3[7] = PyThread_allocate_lock(); memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3, sizeof(__pyx_memoryview_thread_locks[0]) * (8)); - /* "View.MemoryView":549 + /* "View.MemoryView":551 * info.obj = self * * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< * * */ - __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 549, __pyx_L1_error) + __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 549, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 551, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_memoryview_type); - /* "View.MemoryView":995 + /* "View.MemoryView":997 * return self.from_object * * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< * * */ - __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 995, __pyx_L1_error) + __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 997, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 995, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 997, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_memoryviewslice_type); @@ -106541,7 +137868,7 @@ __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview, static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN { va_list vargs; char msg[200]; -#ifdef HAVE_STDARG_PROTOTYPES +#if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES) va_start(vargs, fmt); #else va_start(vargs); @@ -107645,6 +138972,58 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObje return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); } +/* CallUnboundCMethod1 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { + if (likely(cfunc->func)) { + int flag = cfunc->flag; + if (flag == METH_O) { + return (*(cfunc->func))(self, arg); + } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) { + if (PY_VERSION_HEX >= 0x030700A0) { + return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); + } else { + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); + } + } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) { + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); + } + } + return __Pyx__CallUnboundCMethod1(cfunc, self, arg); +} +#endif +static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ + PyObject *args, *result = NULL; + if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_COMPILING_IN_CPYTHON + if (cfunc->func && (cfunc->flag & METH_VARARGS)) { + args = PyTuple_New(1); + if (unlikely(!args)) goto bad; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + if (cfunc->flag & METH_KEYWORDS) + result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); + else + result = (*cfunc->func)(self, args); + } else { + args = PyTuple_New(2); + if (unlikely(!args)) goto bad; + Py_INCREF(self); + PyTuple_SET_ITEM(args, 0, self); + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 1, arg); + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + } +#else + args = PyTuple_Pack(2, self, arg); + if (unlikely(!args)) goto bad; + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); +#endif +bad: + Py_XDECREF(args); + return result; +} + /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK static _PyErr_StackItem * @@ -107820,7 +139199,7 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq return (equals == Py_EQ); } else { int result; -#if CYTHON_USE_UNICODE_INTERNALS +#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; @@ -108523,17 +139902,35 @@ static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; + PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; + PyObject *getstate = NULL; #if CYTHON_USE_PYTYPE_LOOKUP - if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; + getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); #else - if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; + getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); + if (!getstate && PyErr_Occurred()) { + goto __PYX_BAD; + } +#endif + if (getstate) { +#if CYTHON_USE_PYTYPE_LOOKUP + object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); +#else + object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); + if (!object_getstate && PyErr_Occurred()) { + goto __PYX_BAD; + } #endif + if (object_getstate != getstate) { + goto __PYX_GOOD; + } + } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else @@ -108578,6 +139975,8 @@ static int __Pyx_setup_reduce(PyObject* type_obj) { #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); + Py_XDECREF(object_getstate); + Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); @@ -108774,6 +140173,12 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { #include "compile.h" #include "frameobject.h" #include "traceback.h" +#if PY_VERSION_HEX >= 0x030b00a6 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { @@ -108837,14 +140242,24 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); - if (!py_code) goto bad; + if (!py_code) { + /* If the code object creation fails, then we should clear the + fetched exception references and propagate the new exception */ + Py_XDECREF(ptype); + Py_XDECREF(pvalue); + Py_XDECREF(ptraceback); + goto bad; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( @@ -110250,6 +141665,11 @@ static CYTHON_INLINE int __pyx_memview_set_long(const char *itemp, PyObject *obj return result; } +/* MemviewDtypeToObject */ + static CYTHON_INLINE PyObject *__pyx_memview_get_double__const__(const char *itemp) { + return (PyObject *) PyFloat_FromDouble(*(double const *) itemp); +} + /* Declarations */ #if CYTHON_CCOMPLEX #ifdef __cplusplus @@ -112229,6 +143649,12 @@ __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, /* CoroutineBase */ #include #include +#if PY_VERSION_HEX >= 0x030b00a6 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) { PyObject *et, *ev, *tb; @@ -113216,11 +144642,33 @@ static int __pyx_Generator_init(void) { /* CheckBinaryVersion */ static int __Pyx_check_binary_version(void) { - char ctversion[4], rtversion[4]; - PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); - PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); - if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char ctversion[5]; + int same=1, i, found_dot; + const char* rt_from_call = Py_GetVersion(); + PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + found_dot = 0; + for (i = 0; i < 4; i++) { + if (!ctversion[i]) { + same = (rt_from_call[i] < '0' || rt_from_call[i] > '9'); + break; + } + if (rt_from_call[i] != ctversion[i]) { + same = 0; + break; + } + } + if (!same) { + char rtversion[5] = {'\0'}; char message[200]; + for (i=0; i<4; ++i) { + if (rt_from_call[i] == '.') { + if (found_dot) break; + found_dot = 1; + } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') { + break; + } + rtversion[i] = rt_from_call[i]; + } PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", diff --git a/acv_explainers/cyext_acv/cyext_acv.pyx b/acv_explainers/cyext_acv/cyext_acv.pyx index aa892a7..da190b7 100644 --- a/acv_explainers/cyext_acv/cyext_acv.pyx +++ b/acv_explainers/cyext_acv/cyext_acv.pyx @@ -4241,7 +4241,7 @@ cpdef global_sdp_rf_v0(double[:, :] X, double[::1] y_X, double[:, :] data, doub @cython.cdivision(True) cdef double single_compute_exp_rf(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, - int & max_depth, int & min_node_size, int & classifier, double & t) nogil: + int & max_depth, int & min_node_size, int & classifier, double[:] & t) nogil: cdef unsigned int n_trees = features.shape[0] cdef unsigned int N = data.shape[0] @@ -4317,7 +4317,7 @@ cdef double single_compute_exp_rf(double[:] & x, double & y_x, double[:, :] & d @cython.cdivision(True) cpdef compute_exp_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, - int max_depth, int min_node_size, int & classifier, double & t): + int max_depth, int min_node_size, int & classifier, double[:, :] & t): cdef int N = X.shape[0] cdef double[::1] sdp = np.zeros(N) @@ -4325,7 +4325,7 @@ cpdef compute_exp_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double for i in prange(N, nogil=True, schedule='dynamic'): sdp[i] = single_compute_exp_rf(X[i], y_X[i], data, y_data, S[i], features, thresholds, children_left, children_right, - max_depth, min_node_size, classifier, t) + max_depth, min_node_size, classifier, t[i]) return np.array(sdp) @cython.boundscheck(False) @@ -4575,7 +4575,7 @@ cdef double single_compute_cdf_rf(double[:] & x, double & y_x, double[:, :] & d @cython.cdivision(True) cpdef compute_cdf_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, - int max_depth, int min_node_size, int & classifier, double & t): + int max_depth, int min_node_size, int & classifier, double[:] & t): cdef int N = X.shape[0] cdef double[::1] sdp = np.zeros(N) @@ -4583,7 +4583,7 @@ cpdef compute_cdf_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double for i in prange(N, nogil=True): sdp[i] = single_compute_cdf_rf(X[i], y_X[i], data, y_data, S[i], features, thresholds, children_left, children_right, - max_depth, min_node_size, classifier, t) + max_depth, min_node_size, classifier, t[i]) return np.array(sdp) @@ -5133,7 +5133,7 @@ cpdef compute_sdp_maxrule_biased_v2(double[:, :] X, double[::1] y_X, double[:, @cython.cdivision(True) cdef double single_compute_sdp_rule(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, - int & max_depth, int & min_node_size, int & classifier, double & t, double[:, :] & partition) nogil: + int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition) nogil: cdef unsigned int n_trees = features.shape[0] cdef unsigned int N = data.shape[0] @@ -5204,7 +5204,7 @@ cdef double single_compute_sdp_rule(double[:] & x, double & y_x, double[:, :] & else: it = in_data.begin() while(it != in_data.end()): - sdp += (1./(n_trees*in_data.size())) * ((y_x - y_data[deref(it)])*(y_x - y_data[deref(it)]) <= t) + sdp += (1./(n_trees*in_data.size())) * (t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1]) inc(it) return sdp @@ -5215,7 +5215,7 @@ cdef double single_compute_sdp_rule(double[:] & x, double & y_x, double[:, :] & @cython.cdivision(True) cpdef compute_sdp_rule(double[:, :] & X, double[::1] & y_X, double[:, :] & data, double[::1] & y_data, vector[vector[int]] & S, int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, - int & max_depth, int & min_node_size, int & classifier, double & t): + int & max_depth, int & min_node_size, int & classifier, double[:, :] & t): buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) buffer[:, :, 0] = -1e+10 @@ -5228,7 +5228,7 @@ cpdef compute_sdp_rule(double[:, :] & X, double[::1] & y_X, double[:, :] & data for i in prange(N, nogil=True, schedule='dynamic'): sdp[i] = single_compute_sdp_rule(X[i], y_X[i], data, y_data, S[i], features, thresholds, children_left, children_right, - max_depth, min_node_size, classifier, t, partition_byobs[i]) + max_depth, min_node_size, classifier, t[i], partition_byobs[i]) return np.array(sdp), np.array(partition_byobs) @@ -5238,7 +5238,7 @@ cpdef compute_sdp_rule(double[:, :] & X, double[::1] & y_X, double[:, :] & data @cython.cdivision(True) cdef double single_compute_sdp_rule_weights(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, - int & max_depth, int & min_node_size, int & classifier, double & t, double[:, :] & partition, + int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition, double[:] & w) nogil: cdef unsigned int n_trees = features.shape[0] @@ -5311,7 +5311,7 @@ cdef double single_compute_sdp_rule_weights(double[:] & x, double & y_x, double else: it = in_data.begin() while(it != in_data.end()): - sdp += (1./(n_trees*in_data.size())) * ((y_x - y_data[deref(it)])*(y_x - y_data[deref(it)]) <= t) + sdp += (1./(n_trees*in_data.size())) * (t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1]) w[deref(it)] += (1./(n_trees*in_data.size())) inc(it) @@ -5324,7 +5324,7 @@ cdef double single_compute_sdp_rule_weights(double[:] & x, double & y_x, double @cython.cdivision(True) cpdef compute_sdp_maxrule(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, - int max_depth, int min_node_size, int & classifier, double & t, double & pi): + int max_depth, int min_node_size, int & classifier, double[:, :] & t, double & pi): buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) buffer[:, :, 0] = -1e+10 @@ -5348,13 +5348,13 @@ cpdef compute_sdp_maxrule(double[:, :] X, double[::1] y_X, double[:, :] data, d for i in range(N): sdp[i] = single_compute_sdp_rule_weights(X[i], y_X[i], data, y_data, S[i], features, thresholds, children_left, children_right, - max_depth, min_node_size, classifier, t, partition_byobs[i], weights[i]) + max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i]) for j in prange(data.shape[0], nogil=True, schedule='dynamic'): if weights[i, j] != 0: sdp_data[i, j] = single_compute_sdp_rule(data[j], y_X[i], data, y_data, S[i], features, thresholds, children_left, children_right, - max_depth, min_node_size, classifier, t, partition_byobs_data[i, j]) + max_depth, min_node_size, classifier, t[i], partition_byobs_data[i, j]) return np.array(sdp), np.array(partition_byobs), np.array(sdp_data), np.array(partition_byobs_data), np.array(weights) @@ -5364,7 +5364,7 @@ cpdef compute_sdp_maxrule(double[:, :] X, double[::1] y_X, double[:, :] data, d @cython.cdivision(True) cpdef compute_sdp_maxrule_verbose(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, - int max_depth, int min_node_size, int & classifier, double & t, double & pi): + int max_depth, int min_node_size, int & classifier, double[:, :] & t, double & pi): buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) buffer[:, :, 0] = -1e+10 @@ -5388,13 +5388,13 @@ cpdef compute_sdp_maxrule_verbose(double[:, :] X, double[::1] y_X, double[:, :] for i in tqdm(range(N)): sdp[i] = single_compute_sdp_rule_weights(X[i], y_X[i], data, y_data, S[i], features, thresholds, children_left, children_right, - max_depth, min_node_size, classifier, t, partition_byobs[i], weights[i]) + max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i]) for j in prange(data.shape[0], nogil=True, schedule='dynamic'): if weights[i, j] != 0: sdp_data[i, j] = single_compute_sdp_rule(data[j], y_X[i], data, y_data, S[i], features, thresholds, children_left, children_right, - max_depth, min_node_size, classifier, t, partition_byobs_data[i, j]) + max_depth, min_node_size, classifier, t[i], partition_byobs_data[i, j]) return np.array(sdp), np.array(partition_byobs), np.array(sdp_data), np.array(partition_byobs_data), np.array(weights) @@ -5403,9 +5403,9 @@ cpdef compute_sdp_maxrule_verbose(double[:, :] X, double[::1] y_X, double[:, :] @cython.wraparound(False) @cython.nonecheck(False) @cython.cdivision(True) -cdef double single_compute_sdp_rf(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, +cdef double single_compute_ddp_rule(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, - int & max_depth, int & min_node_size, int & classifier, double & t) nogil: + int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition) nogil: cdef unsigned int n_trees = features.shape[0] cdef unsigned int N = data.shape[0] @@ -5436,6 +5436,9 @@ cdef double single_compute_sdp_rf(double[:] & x, double & y_x, double[:, :] & d if x[features[b, it_node]] <= thresholds[b, it_node]: nodes_child.insert(children_left[b, it_node]) + if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + partition[features[b, it_node], 1] = thresholds[b, it_node] + it = in_data.begin() while(it != in_data.end()): if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: @@ -5446,6 +5449,9 @@ cdef double single_compute_sdp_rf(double[:] & x, double & y_x, double[:, :] & d else: nodes_child.insert(children_right[b, it_node]) + if partition[features[b, it_node], 0] <= thresholds[b, it_node]: + partition[features[b, it_node], 0] = thresholds[b, it_node] + it = in_data.begin() while(it != in_data.end()): if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: @@ -5465,12 +5471,12 @@ cdef double single_compute_sdp_rf(double[:] & x, double & y_x, double[:, :] & d if classifier == 1: it = in_data.begin() while(it != in_data.end()): - sdp += (1./(n_trees*in_data.size())) * (y_x == y_data[deref(it)]) + sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) inc(it) else: it = in_data.begin() while(it != in_data.end()): - sdp += (1./(n_trees*in_data.size())) * ((y_x - y_data[deref(it)])*(y_x - y_data[deref(it)]) <= t) + sdp += (1./(n_trees*in_data.size())) * (1-(t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) inc(it) return sdp @@ -5479,193 +5485,2147 @@ cdef double single_compute_sdp_rf(double[:] & x, double & y_x, double[:, :] & d @cython.wraparound(False) @cython.nonecheck(False) @cython.cdivision(True) -cpdef compute_sdp_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, - int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, - int max_depth, int min_node_size, int & classifier, double & t): - - cdef int N = X.shape[0] - cdef double[::1] sdp = np.zeros(N) - cdef int i - for i in prange(N, nogil=True, schedule='dynamic'): - sdp[i] = single_compute_sdp_rf(X[i], y_X[i], data, y_data, S[i], - features, thresholds, children_left, children_right, - max_depth, min_node_size, classifier, t) - return np.array(sdp) +cpdef compute_ddp_rule(double[:, :] & X, double[::1] & y_X, double[:, :] & data, double[::1] & y_data, vector[vector[int]] & S, + int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + int & max_depth, int & min_node_size, int & classifier, double[:, :] & t): -@cython.boundscheck(False) -@cython.wraparound(False) -@cython.nonecheck(False) -@cython.cdivision(True) -cpdef compute_sdp_rf_same_set(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[int] S, - int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, - int max_depth, int min_node_size, int & classifier, double & t): + buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + buffer[:, :, 0] = -1e+10 + cdef double [:, :, :] partition_byobs = buffer cdef int N = X.shape[0] cdef double[::1] sdp = np.zeros(N) cdef int i + for i in prange(N, nogil=True, schedule='dynamic'): - sdp[i] = single_compute_sdp_rf(X[i], y_X[i], data, y_data, S, + sdp[i] = single_compute_ddp_rule(X[i], y_X[i], data, y_data, S[i], features, thresholds, children_left, children_right, - max_depth, min_node_size, classifier, t) - return np.array(sdp) + max_depth, min_node_size, classifier, t[i], partition_byobs[i]) + return np.array(sdp), np.array(partition_byobs) @cython.boundscheck(False) @cython.wraparound(False) @cython.nonecheck(False) @cython.cdivision(True) -cpdef global_sdp_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, - int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, - int max_depth, int min_node_size, int & classifier, double & t, list C, double pi_level, - int minimal, bint stop, list search_space): +cdef double single_compute_ddp_rule_weights(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, + int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition, + double[:] & w) nogil: - cdef unsigned int N = X.shape[0] - cdef unsigned int m = X.shape[1] + cdef unsigned int n_trees = features.shape[0] + cdef unsigned int N = data.shape[0] + cdef double s, sdp + cdef int o + sdp = 0 - cdef double[:] sdp, sdp_b, sdp_ba - cdef double[:] sdp_global - cdef double[:] in_data - sdp = np.zeros((N)) - sdp_b = np.zeros((N)) - sdp_global = np.zeros((m)) - in_data = np.zeros(N) + cdef int b, level, i, it_node + cdef set[int] nodes_level, nodes_child, in_data, in_data_b + cdef set[int].iterator it, it_point - cdef unsigned int it, it_s, a_it, b_it, o_all, p, p_s, nb_leaf, p_u, p_d, p_su, p_sd, down, up - cdef double ss, ss_a, ss_u, ss_d - cdef int b, leaf_numb, i, s, s_0, s_1, S_size, j, max_size, size + for b in range(n_trees): + nodes_child.clear() + nodes_level.clear() + nodes_level.insert(0) - cdef vector[int] S, len_s_star - len_s_star = np.zeros((N), dtype=np.int) + in_data.clear() + in_data_b.clear() + for i in range(N): + in_data.insert(i) + in_data_b.insert(i) - cdef list power, va_id + for level in range(max_depth): + it_point = nodes_level.begin() + while(it_point != nodes_level.end()): + it_node = deref(it_point) + if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + if x[features[b, it_node]] <= thresholds[b, it_node]: + nodes_child.insert(children_left[b, it_node]) - cdef vector[long] R, r - R.resize(N) - for i in range(N): - R[i] = i - r.resize(N) + if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + partition[features[b, it_node], 1] = thresholds[b, it_node] - cdef long[:] R_buf - R_buf = np.zeros((N), dtype=np.int) + it = in_data.begin() + while(it != in_data.end()): + if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + in_data_b.erase(deref(it)) + inc(it) + in_data = in_data_b - X_arr = np.array(X, dtype=np.double) - y_X_arr = np.array(y_X, dtype=np.double) + else: + nodes_child.insert(children_right[b, it_node]) - if C[0] != []: - remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] - va_id = [[i] for i in search_space if i not in remove_va] - for ci in range(len(C)): - i = 0 - for cj in range(len(C[ci])): - if C[ci][cj] in search_space: - i += 1 + if partition[features[b, it_node], 0] <= thresholds[b, it_node]: + partition[features[b, it_node], 0] = thresholds[b, it_node] + + it = in_data.begin() + while(it != in_data.end()): + if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + in_data_b.erase(deref(it)) + inc(it) + in_data = in_data_b + else: + nodes_child.insert(children_left[b, it_node]) + nodes_child.insert(children_right[b, it_node]) + + if in_data.size() < min_node_size: break - if i != 0: - va_id += [C[ci]] - else: - va_id = [[i] for i in search_space] + inc(it_point) - m = len(va_id) - power = [] - max_size = 0 - for size in range(m + 1): - power_b = [] - for co in itertools.combinations(va_id, size): - power_b.append(np.array(sum(list(co),[]))) - max_size += 1 - power.append(power_b) - if max_size >= 2**15: - break + nodes_level = nodes_child - cdef vector[vector[vector[long]]] power_cpp = power - cdef long[:, :] s_star - s_star = -1*np.ones((N, X.shape[1]), dtype=np.int) + if classifier == 1: + it = in_data.begin() + while(it != in_data.end()): + sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) + w[deref(it)] += (1./(n_trees*in_data.size())) + inc(it) + else: + it = in_data.begin() + while(it != in_data.end()): + sdp += (1./(n_trees*in_data.size())) * (1-(t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) + w[deref(it)] += (1./(n_trees*in_data.size())) + inc(it) + return sdp - cdef long power_set_size = 2**m - S = np.zeros((data.shape[1]), dtype=np.int) - for s_0 in tqdm(range(minimal, m + 1)): - for s_1 in range(0, power_cpp[s_0].size()): - for i in range(power_cpp[s_0][s_1].size()): - S[i] = power_cpp[s_0][s_1][i] +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.nonecheck(False) +@cython.cdivision(True) +cpdef compute_ddp_weights(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, + int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + int max_depth, int min_node_size, int & classifier, double[:, :] & t, double & pi): - S_size = power_cpp[s_0][s_1].size() - r.clear() - N = R.size() - in_data = np.zeros(X.shape[0]) + buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + buffer[:, :, 0] = -1e+10 + cdef double [:, :, :] partition_byobs = buffer - for i in range(N): - R_buf[i] = R[i] - in_data[R_buf[i]] = 1 + cdef int N = X.shape[0] + cdef double[::1] sdp = np.zeros(N) + cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + cdef int i, j - # sdp_b[R_buf[i]] = single_compute_sdp_rf(X[R_buf[i]], y_X[R_buf[i]], data, y_data, S[:S_size], features, thresholds, children_left, children_right, - # max_depth, min_node_size, classifier, t) + for i in prange(N, nogil=True, schedule='dynamic'): + sdp[i] = single_compute_ddp_rule_weights(X[i], y_X[i], data, y_data, S[i], + features, thresholds, children_left, children_right, + max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i]) - sdp_ba = compute_sdp_rf_same_set(X_arr[np.array(in_data, dtype=bool)], - y_X_arr[np.array(in_data, dtype=bool)], - data, y_data, S[:S_size], features, thresholds, children_left, - children_right, max_depth, min_node_size, classifier, t) + return np.array(sdp), np.array(weights) - for i in range(N): - sdp_b[R_buf[i]] = sdp_ba[i] - if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: - sdp[R_buf[i]] = sdp_b[R_buf[i]] - len_s_star[R_buf[i]] = S_size - for s in range(S_size): - s_star[R_buf[i], s] = S[s] +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.nonecheck(False) +@cython.cdivision(True) +cpdef compute_ddp_weights_verbose(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, + int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + int max_depth, int min_node_size, int & classifier, double[:, :] & t, double & pi): - if S_size == X.shape[1]: - sdp[R_buf[i]] = 1 - len_s_star[R_buf[i]] = S_size - for s in range(S_size): - s_star[R_buf[i], s] = S[s] - for s in range(len_s_star[R_buf[i]], X.shape[1]): # to filter (important for coalition) - s_star[R_buf[i], s] = -1 + buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + buffer[:, :, 0] = -1e+10 + cdef double [:, :, :] partition_byobs = buffer - for i in range(N): - if sdp[R_buf[i]] >= pi_level: - r.push_back(R[i]) - for s in range(len_s_star[R_buf[i]]): - sdp_global[s_star[R_buf[i], s]] += 1 + cdef int N = X.shape[0] + cdef double[::1] sdp = np.zeros(N) + cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + cdef int i, j - for i in range(r.size()): - std_remove[vector[long].iterator, long](R.begin(), R.end(), r[i]) - R.pop_back() + for i in tqdm(range(N)): + sdp[i] = single_compute_ddp_rule_weights(X[i], y_X[i], data, y_data, S[i], + features, thresholds, children_left, children_right, + max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i]) - if (R.size() == 0 or S_size >= X.shape[1]/2) and stop: - break - return np.asarray(sdp_global)/X.shape[0], np.array(s_star, dtype=np.long), np.array(len_s_star, dtype=np.long), np.array(sdp) + return np.array(sdp), np.array(weights) @cython.boundscheck(False) @cython.wraparound(False) @cython.nonecheck(False) @cython.cdivision(True) -cpdef sufficient_expl_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, - int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, - int max_depth, int min_node_size, int & classifier, double & t, list C, double pi_level, - int minimal, bint stop, list search_space): - - cdef unsigned int N = X.shape[0] - cdef unsigned int m = X.shape[1] +cdef double single_compute_ddp_cond_rule_weights(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, + int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition, + double[:] & w, const double[:, :] & cond) nogil: - cdef double[:] sdp, sdp_b, sdp_ba - cdef double[:] sdp_global - sdp = np.zeros((N)) - sdp_global = np.zeros((m)) + cdef unsigned int n_trees = features.shape[0] + cdef unsigned int N = data.shape[0] + cdef double s, sdp + cdef int o + sdp = 0 + + cdef int b, level, i, it_node + cdef set[int] nodes_level, nodes_child, in_data, in_data_b + cdef set[int].iterator it, it_point + + for b in range(n_trees): + nodes_child.clear() + nodes_level.clear() + nodes_level.insert(0) + + in_data.clear() + in_data_b.clear() + for i in range(N): + in_data.insert(i) + in_data_b.insert(i) + + for level in range(max_depth): + it_point = nodes_level.begin() + while(it_point != nodes_level.end()): + it_node = deref(it_point) + if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + if x[features[b, it_node]] <= thresholds[b, it_node]: + nodes_child.insert(children_left[b, it_node]) + + if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + partition[features[b, it_node], 1] = thresholds[b, it_node] + + it = in_data.begin() + while(it != in_data.end()): + if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + in_data_b.erase(deref(it)) + inc(it) + in_data = in_data_b + + else: + nodes_child.insert(children_right[b, it_node]) + + if partition[features[b, it_node], 0] <= thresholds[b, it_node]: + partition[features[b, it_node], 0] = thresholds[b, it_node] + + it = in_data.begin() + while(it != in_data.end()): + if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + in_data_b.erase(deref(it)) + inc(it) + in_data = in_data_b + + elif features[b, it_node] >=0 and cond[features[b, it_node], 1] <= thresholds[b, it_node]: + nodes_child.insert(children_left[b, it_node]) + + if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + partition[features[b, it_node], 1] = thresholds[b, it_node] + + it = in_data.begin() + while(it != in_data.end()): + if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + in_data_b.erase(deref(it)) + inc(it) + in_data = in_data_b + + elif features[b, it_node] >=0 and cond[features[b, it_node], 0] > thresholds[b, it_node]: + nodes_child.insert(children_right[b, it_node]) + + if partition[features[b, it_node], 0] <= thresholds[b, it_node]: + partition[features[b, it_node], 0] = thresholds[b, it_node] + + it = in_data.begin() + while(it != in_data.end()): + if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + in_data_b.erase(deref(it)) + inc(it) + in_data = in_data_b + + elif features[b, it_node] >=0 and cond[features[b, it_node], 1] >= thresholds[b, it_node] and cond[features[b, it_node], 0] <= thresholds[b, it_node]: + nodes_child.insert(children_left[b, it_node]) + nodes_child.insert(children_right[b, it_node]) + + # if partition[features[b, it_node], 0] <= thresholds[b, it_node]: # TO DO: compute correctly the partition in this case + # partition[features[b, it_node], 0] = cond[features[b, it_node], 0] + + # if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + # partition[features[b, it_node], 1] = cond[features[b, it_node], 1] + + # it = in_data.begin() + # while(it != in_data.end()): + # if data[deref(it), features[b, it_node]] < cond[features[b, it_node], 0] or data[deref(it), features[b, it_node]] > cond[features[b, it_node], 1]: + # in_data_b.erase(deref(it)) + # inc(it) + # in_data = in_data_b + + else: + nodes_child.insert(children_left[b, it_node]) + nodes_child.insert(children_right[b, it_node]) + + if in_data.size() < min_node_size: + break + inc(it_point) + + nodes_level = nodes_child + + if classifier == 1: + it = in_data.begin() + while(it != in_data.end()): + sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) + w[deref(it)] += (1./(n_trees*in_data.size())) + inc(it) + else: + it = in_data.begin() + while(it != in_data.end()): + sdp += (1./(n_trees*in_data.size())) * (1-(t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) + w[deref(it)] += (1./(n_trees*in_data.size())) + inc(it) + + return sdp + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.nonecheck(False) +@cython.cdivision(True) +cpdef compute_ddp_cond_weights(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, + int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + const double [:, :, :] & cond, + int max_depth, int min_node_size, int & classifier, double[:, :] & t, double & pi): + + buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + buffer[:, :, 0] = -1e+10 + cdef double [:, :, :] partition_byobs = buffer + + cdef int N = X.shape[0] + cdef double[::1] sdp = np.zeros(N) + cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + cdef int i, j + + for i in prange(N, nogil=True, schedule='dynamic'): + sdp[i] = single_compute_ddp_cond_rule_weights(X[i], y_X[i], data, y_data, S[i], + features, thresholds, children_left, children_right, + max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i], cond[i]) + + return np.array(sdp), np.array(weights) + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.nonecheck(False) +@cython.cdivision(True) +cdef double single_compute_sdp_rf(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, + int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + int & max_depth, int & min_node_size, int & classifier, double[:] & t) nogil: + + cdef unsigned int n_trees = features.shape[0] + cdef unsigned int N = data.shape[0] + cdef double s, sdp + cdef int o + sdp = 0 + + cdef int b, level, i, it_node + cdef set[int] nodes_level, nodes_child, in_data, in_data_b + cdef set[int].iterator it, it_point + + for b in range(n_trees): + nodes_child.clear() + nodes_level.clear() + nodes_level.insert(0) + + in_data.clear() + in_data_b.clear() + for i in range(N): + in_data.insert(i) + in_data_b.insert(i) + + for level in range(max_depth): + it_point = nodes_level.begin() + while(it_point != nodes_level.end()): + it_node = deref(it_point) + if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + if x[features[b, it_node]] <= thresholds[b, it_node]: + nodes_child.insert(children_left[b, it_node]) + + it = in_data.begin() + while(it != in_data.end()): + if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + in_data_b.erase(deref(it)) + inc(it) + in_data = in_data_b + + else: + nodes_child.insert(children_right[b, it_node]) + + it = in_data.begin() + while(it != in_data.end()): + if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + in_data_b.erase(deref(it)) + inc(it) + in_data = in_data_b + else: + nodes_child.insert(children_left[b, it_node]) + nodes_child.insert(children_right[b, it_node]) + + if in_data.size() < min_node_size: + break + inc(it_point) + + nodes_level = nodes_child + + if classifier == 1: + it = in_data.begin() + while(it != in_data.end()): + sdp += (1./(n_trees*in_data.size())) * (y_x == y_data[deref(it)]) + inc(it) + else: + it = in_data.begin() + while(it != in_data.end()): + sdp += (1./(n_trees*in_data.size())) * (t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1]) + inc(it) + + return sdp + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.nonecheck(False) +@cython.cdivision(True) +cpdef compute_sdp_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, + int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + int max_depth, int min_node_size, int & classifier, double[:, :] & t): + + cdef int N = X.shape[0] + cdef double[::1] sdp = np.zeros(N) + cdef int i + for i in prange(N, nogil=True, schedule='dynamic'): + sdp[i] = single_compute_sdp_rf(X[i], y_X[i], data, y_data, S[i], + features, thresholds, children_left, children_right, + max_depth, min_node_size, classifier, t[i]) + return np.array(sdp) + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.nonecheck(False) +@cython.cdivision(True) +cdef double single_compute_ddp_rf(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, + int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + int & max_depth, int & min_node_size, int & classifier, double[:] & t) nogil: + + cdef unsigned int n_trees = features.shape[0] + cdef unsigned int N = data.shape[0] + cdef double s, sdp + cdef int o + sdp = 0 + + cdef int b, level, i, it_node + cdef set[int] nodes_level, nodes_child, in_data, in_data_b + cdef set[int].iterator it, it_point + + for b in range(n_trees): + nodes_child.clear() + nodes_level.clear() + nodes_level.insert(0) + + in_data.clear() + in_data_b.clear() + for i in range(N): + in_data.insert(i) + in_data_b.insert(i) + + for level in range(max_depth): + it_point = nodes_level.begin() + while(it_point != nodes_level.end()): + it_node = deref(it_point) + if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + if x[features[b, it_node]] <= thresholds[b, it_node]: + nodes_child.insert(children_left[b, it_node]) + + it = in_data.begin() + while(it != in_data.end()): + if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + in_data_b.erase(deref(it)) + inc(it) + in_data = in_data_b + + else: + nodes_child.insert(children_right[b, it_node]) + + it = in_data.begin() + while(it != in_data.end()): + if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + in_data_b.erase(deref(it)) + inc(it) + in_data = in_data_b + else: + nodes_child.insert(children_left[b, it_node]) + nodes_child.insert(children_right[b, it_node]) + + if in_data.size() < min_node_size: + break + inc(it_point) + + nodes_level = nodes_child + + if classifier == 1: + it = in_data.begin() + while(it != in_data.end()): + sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) + inc(it) + else: + it = in_data.begin() + while(it != in_data.end()): + sdp += (1./(n_trees*in_data.size())) * (1-(t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) + inc(it) + + return sdp + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.nonecheck(False) +@cython.cdivision(True) +cpdef compute_ddp_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, + int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + int max_depth, int min_node_size, int & classifier, double[:, :] & t): + + cdef int N = X.shape[0] + cdef double[::1] sdp = np.zeros(N) + cdef int i + for i in prange(N, nogil=True, schedule='dynamic'): + sdp[i] = single_compute_ddp_rf(X[i], y_X[i], data, y_data, S[i], + features, thresholds, children_left, children_right, + max_depth, min_node_size, classifier, t[i]) + return np.array(sdp) + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.nonecheck(False) +@cython.cdivision(True) +cpdef compute_ddp_rf_same_set(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[int] S, + int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + int max_depth, int min_node_size, int & classifier, double[:, :] & t): + + cdef int N = X.shape[0] + cdef double[::1] sdp = np.zeros(N) + cdef int i + for i in prange(N, nogil=True, schedule='dynamic'): + sdp[i] = single_compute_ddp_rf(X[i], y_X[i], data, y_data, S, + features, thresholds, children_left, children_right, + max_depth, min_node_size, classifier, t[i]) + return np.array(sdp) + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.nonecheck(False) +@cython.cdivision(True) +cpdef global_ddp_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, + int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + int max_depth, int min_node_size, int & classifier, double[:, :] & t, list C, double pi_level, + int minimal, bint stop, list search_space): + + cdef unsigned int N = X.shape[0] + cdef unsigned int m = X.shape[1] + + cdef double[:] sdp, sdp_b, sdp_ba + cdef double[:] sdp_global + cdef double[:] in_data + sdp = np.zeros((N)) + sdp_b = np.zeros((N)) + sdp_global = np.zeros((m)) + in_data = np.zeros(N) + + cdef unsigned int it, it_s, a_it, b_it, o_all, p, p_s, nb_leaf, p_u, p_d, p_su, p_sd, down, up + cdef double ss, ss_a, ss_u, ss_d + cdef int b, leaf_numb, i, s, s_0, s_1, S_size, j, max_size, size + + cdef vector[int] S, len_s_star + len_s_star = np.zeros((N), dtype=np.int) + + cdef list power, va_id + + cdef vector[long] R, r + R.resize(N) + for i in range(N): + R[i] = i + r.resize(N) + + cdef long[:] R_buf + R_buf = np.zeros((N), dtype=np.int) + + X_arr = np.array(X, dtype=np.double) + y_X_arr = np.array(y_X, dtype=np.double) + t_arr = np.array(t, dtype=np.double) + + if C[0] != []: + remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] + va_id = [[i] for i in search_space if i not in remove_va] + for ci in range(len(C)): + i = 0 + for cj in range(len(C[ci])): + if C[ci][cj] in search_space: + i += 1 + break + if i != 0: + va_id += [C[ci]] + else: + va_id = [[i] for i in search_space] + + m = len(va_id) + power = [] + max_size = 0 + for size in range(m + 1): + power_b = [] + for co in itertools.combinations(va_id, size): + power_b.append(np.array(sum(list(co),[]))) + max_size += 1 + power.append(power_b) + if max_size >= 2**15: + break + + cdef vector[vector[vector[long]]] power_cpp = power + cdef long[:, :] s_star + s_star = -1*np.ones((N, X.shape[1]), dtype=np.int) + + cdef long power_set_size = 2**m + S = np.zeros((data.shape[1]), dtype=np.int) + S_bar = np.zeros((data.shape[1]), dtype=np.int) + + for s_0 in tqdm(range(minimal, m+1)): + for s_1 in range(0, power_cpp[s_0].size()): + for i in range(power_cpp[s_0][s_1].size()): + S[i] = power_cpp[s_0][s_1][i] + + S_size = power_cpp[s_0][s_1].size() + r.clear() + N = R.size() + in_data = np.zeros(X.shape[0]) + + S_bar_set = list(range(data.shape[1])) + for i in range(S_size): + S_bar_set.remove(S[i]) + + for i in range(data.shape[1]-S_size): + S_bar[i] = S_bar_set[i] + + for i in range(N): + R_buf[i] = R[i] + in_data[R_buf[i]] = 1 + + # sdp_b[R_buf[i]] = single_compute_ddp_rf(X[R_buf[i]], y_X[R_buf[i]], data, y_data, S_bar[:m-S_size], features, thresholds, children_left, children_right, + # max_depth, min_node_size, classifier, t) + + sdp_ba = compute_ddp_rf_same_set(X_arr[np.array(in_data, dtype=bool)], + y_X_arr[np.array(in_data, dtype=bool)], + data, y_data, S_bar[:data.shape[1]-S_size], features, thresholds, children_left, + children_right, max_depth, min_node_size, classifier, t_arr[np.array(in_data, dtype=bool)]) + + for i in range(N): + sdp_b[R_buf[i]] = sdp_ba[i] + if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: + sdp[R_buf[i]] = sdp_b[R_buf[i]] + len_s_star[R_buf[i]] = S_size + for s in range(S_size): + s_star[R_buf[i], s] = S[s] + + if S_size == X.shape[1]: + sdp[R_buf[i]] = 1 + len_s_star[R_buf[i]] = S_size + for s in range(S_size): + s_star[R_buf[i], s] = S[s] + for s in range(len_s_star[R_buf[i]], X.shape[1]): # to filter (important for coalition) + s_star[R_buf[i], s] = -1 + + for i in range(N): + if sdp[R_buf[i]] >= pi_level: + r.push_back(R[i]) + for s in range(len_s_star[R_buf[i]]): + sdp_global[s_star[R_buf[i], s]] += 1 + + for i in range(r.size()): + std_remove[vector[long].iterator, long](R.begin(), R.end(), r[i]) + R.pop_back() + + if (R.size() == 0 or S_size >= X.shape[1]/2) and stop: + break + + return np.asarray(sdp_global)/X.shape[0], np.array(s_star, dtype=np.long), np.array(len_s_star, dtype=np.long), np.array(sdp) + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.nonecheck(False) +@cython.cdivision(True) +cpdef compute_sdp_rf_same_set(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[int] S, + int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + int max_depth, int min_node_size, int & classifier, double[:, :] & t): + + cdef int N = X.shape[0] + cdef double[::1] sdp = np.zeros(N) + cdef int i + for i in prange(N, nogil=True, schedule='dynamic'): + sdp[i] = single_compute_sdp_rf(X[i], y_X[i], data, y_data, S, + features, thresholds, children_left, children_right, + max_depth, min_node_size, classifier, t[i]) + return np.array(sdp) + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.nonecheck(False) +@cython.cdivision(True) +cpdef global_sdp_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, + int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + int max_depth, int min_node_size, int & classifier, double[:, :] & t, list C, double pi_level, + int minimal, bint stop, list search_space): + + cdef unsigned int N = X.shape[0] + cdef unsigned int m = X.shape[1] + + cdef double[:] sdp, sdp_b, sdp_ba + cdef double[:] sdp_global + cdef double[:] in_data + sdp = np.zeros((N)) + sdp_b = np.zeros((N)) + sdp_global = np.zeros((m)) + in_data = np.zeros(N) + + cdef unsigned int it, it_s, a_it, b_it, o_all, p, p_s, nb_leaf, p_u, p_d, p_su, p_sd, down, up + cdef double ss, ss_a, ss_u, ss_d + cdef int b, leaf_numb, i, s, s_0, s_1, S_size, j, max_size, size + + cdef vector[int] S, len_s_star + len_s_star = np.zeros((N), dtype=np.int) + + cdef list power, va_id + + cdef vector[long] R, r + R.resize(N) + for i in range(N): + R[i] = i + r.resize(N) + + cdef long[:] R_buf + R_buf = np.zeros((N), dtype=np.int) + + X_arr = np.array(X, dtype=np.double) + y_X_arr = np.array(y_X, dtype=np.double) + t_arr = np.array(t, dtype=np.double) + + if C[0] != []: + remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] + va_id = [[i] for i in search_space if i not in remove_va] + for ci in range(len(C)): + i = 0 + for cj in range(len(C[ci])): + if C[ci][cj] in search_space: + i += 1 + break + if i != 0: + va_id += [C[ci]] + else: + va_id = [[i] for i in search_space] + + m = len(va_id) + power = [] + max_size = 0 + for size in range(m + 1): + power_b = [] + for co in itertools.combinations(va_id, size): + power_b.append(np.array(sum(list(co),[]))) + max_size += 1 + power.append(power_b) + if max_size >= 2**15: + break + + cdef vector[vector[vector[long]]] power_cpp = power + cdef long[:, :] s_star + s_star = -1*np.ones((N, X.shape[1]), dtype=np.int) + + + cdef long power_set_size = 2**m + S = np.zeros((data.shape[1]), dtype=np.int) + + for s_0 in tqdm(range(minimal, m + 1)): + for s_1 in range(0, power_cpp[s_0].size()): + for i in range(power_cpp[s_0][s_1].size()): + S[i] = power_cpp[s_0][s_1][i] + + S_size = power_cpp[s_0][s_1].size() + r.clear() + N = R.size() + in_data = np.zeros(X.shape[0]) + + for i in range(N): + R_buf[i] = R[i] + in_data[R_buf[i]] = 1 + + # sdp_b[R_buf[i]] = single_compute_sdp_rf(X[R_buf[i]], y_X[R_buf[i]], data, y_data, S[:S_size], features, thresholds, children_left, children_right, + # max_depth, min_node_size, classifier, t) + + sdp_ba = compute_sdp_rf_same_set(X_arr[np.array(in_data, dtype=bool)], + y_X_arr[np.array(in_data, dtype=bool)], + data, y_data, S[:S_size], features, thresholds, children_left, + children_right, max_depth, min_node_size, classifier, t_arr[np.array(in_data, dtype=bool)]) + + for i in range(N): + sdp_b[R_buf[i]] = sdp_ba[i] + if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: + sdp[R_buf[i]] = sdp_b[R_buf[i]] + len_s_star[R_buf[i]] = S_size + for s in range(S_size): + s_star[R_buf[i], s] = S[s] + + if S_size == X.shape[1]: + sdp[R_buf[i]] = 1 + len_s_star[R_buf[i]] = S_size + for s in range(S_size): + s_star[R_buf[i], s] = S[s] + for s in range(len_s_star[R_buf[i]], X.shape[1]): # to filter (important for coalition) + s_star[R_buf[i], s] = -1 + + for i in range(N): + if sdp[R_buf[i]] >= pi_level: + r.push_back(R[i]) + for s in range(len_s_star[R_buf[i]]): + sdp_global[s_star[R_buf[i], s]] += 1 + + for i in range(r.size()): + std_remove[vector[long].iterator, long](R.begin(), R.end(), r[i]) + R.pop_back() + + if (R.size() == 0 or S_size >= X.shape[1]/2) and stop: + break + + return np.asarray(sdp_global)/X.shape[0], np.array(s_star, dtype=np.long), np.array(len_s_star, dtype=np.long), np.array(sdp) + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.nonecheck(False) +@cython.cdivision(True) +cpdef sufficient_expl_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, + int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + int max_depth, int min_node_size, int & classifier, double[:, :] & t, list C, double pi_level, + int minimal, bint stop, list search_space): + + cdef unsigned int N = X.shape[0] + cdef unsigned int m = X.shape[1] + + cdef double[:] sdp, sdp_b, sdp_ba + cdef double[:] sdp_global + sdp = np.zeros((N)) + sdp_global = np.zeros((m)) + + cdef unsigned int it, it_s, a_it, b_it, o_all, p, p_s, nb_leaf, p_u, p_d, p_su, p_sd, down, up + cdef double ss, ss_a, ss_u, ss_d, K + cdef int b, leaf_numb, i, s, s_0, s_1, S_size, j, max_size, size, subset, a, k + K = 0 + + cdef vector[int] S, len_s_star + len_s_star = np.zeros((N), dtype=np.int) + + cdef list power, va_id + + if C[0] != []: + remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] + va_id = [[i] for i in search_space if i not in remove_va] + for ci in range(len(C)): + i = 0 + for cj in range(len(C[ci])): + if C[ci][cj] in search_space: + i += 1 + break + if i != 0: + va_id += [C[ci]] + else: + va_id = [[i] for i in search_space] + + m = len(va_id) + power = [] + max_size = 0 + for size in range(m + 1): + power_b = [] + for co in itertools.combinations(va_id, size): + power_b.append(np.array(sum(list(co),[]))) + max_size += 1 + power.append(power_b) + if max_size >= 2**15: + break + + cdef vector[vector[vector[long]]] power_cpp = power + cdef long[:, :] s_star + s_star = -1*np.ones((N, X.shape[1]), dtype=np.int) + + + cdef long power_set_size = 2**m + S = np.zeros((data.shape[1]), dtype=np.int) + + cdef vector[vector[vector[long]]] sufficient = [[[-1]] for i in range(N)] + cdef vector[vector[double]] sufficient_sdp = [[-1] for i in range(N)] + + for s_0 in tqdm(range(minimal, m + 1)): + for s_1 in range(0, power_cpp[s_0].size()): + for i in range(power_cpp[s_0][s_1].size()): + S[i] = power_cpp[s_0][s_1][i] + + S_size = power_cpp[s_0][s_1].size() + sdp = compute_sdp_rf_same_set(X, y_X, data, y_data, S[:S_size], features, thresholds, children_left, + children_right, max_depth, min_node_size, classifier, t) + + for i in range(N): + if sdp[i] >= pi_level: + subset = 0 + for j in range(sufficient[i].size()): + a = 0 + for k in range(sufficient[i][j].size()): + if std_find[vector[long].iterator, long](power_cpp[s_0][s_1].begin(), power_cpp[s_0][s_1].end(), sufficient[i][j][k]) != power_cpp[s_0][s_1].end(): + a += 1 + if a == sufficient[i][j].size(): + subset = 1 + break + + if subset == 0: + sufficient[i].push_back(power_cpp[s_0][s_1]) + sufficient_sdp[i].push_back(sdp[i]) + for s in range(S_size): + sdp_global[S[s]] += 1 + K += 1 + + return sufficient, sufficient_sdp, np.asarray(sdp_global)/K + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.nonecheck(False) +@cython.cdivision(True) +cpdef sufficient_cxpl_rf(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, + int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + int max_depth, int min_node_size, int & classifier, double[:, :] & t, list C, double pi_level, + int minimal, bint stop, list search_space): + + cdef unsigned int N = X.shape[0] + cdef unsigned int m = X.shape[1] + + cdef double[:] sdp, sdp_b, sdp_ba + cdef double[:] sdp_global + sdp = np.zeros((N)) + sdp_global = np.zeros((m)) + + cdef unsigned int it, it_s, a_it, b_it, o_all, p, p_s, nb_leaf, p_u, p_d, p_su, p_sd, down, up + cdef double ss, ss_a, ss_u, ss_d, K + cdef int b, leaf_numb, i, s, s_0, s_1, S_size, j, max_size, size, subset, a, k + K = 0 + + cdef vector[int] S, len_s_star + len_s_star = np.zeros((N), dtype=np.int) + + cdef list power, va_id + + if C[0] != []: + remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] + va_id = [[i] for i in search_space if i not in remove_va] + for ci in range(len(C)): + i = 0 + for cj in range(len(C[ci])): + if C[ci][cj] in search_space: + i += 1 + break + if i != 0: + va_id += [C[ci]] + else: + va_id = [[i] for i in search_space] + + m = len(va_id) + power = [] + max_size = 0 + for size in range(m + 1): + power_b = [] + for co in itertools.combinations(va_id, size): + power_b.append(np.array(sum(list(co),[]))) + max_size += 1 + power.append(power_b) + if max_size >= 2**15: + break + + cdef vector[vector[vector[long]]] power_cpp = power + cdef long[:, :] s_star + s_star = -1*np.ones((N, X.shape[1]), dtype=np.int) + + + cdef long power_set_size = 2**m + S = np.zeros((data.shape[1]), dtype=np.int) + + cdef vector[vector[vector[long]]] sufficient = [[[-1]] for i in range(N)] + cdef vector[vector[double]] sufficient_sdp = [[-1] for i in range(N)] + + for s_0 in tqdm(range(minimal, m + 1)): + for s_1 in range(0, power_cpp[s_0].size()): + for i in range(power_cpp[s_0][s_1].size()): + S[i] = power_cpp[s_0][s_1][i] + + S_size = power_cpp[s_0][s_1].size() + sdp = compute_ddp_rf_same_set(X, y_X, data, y_data, S[:S_size], features, thresholds, children_left, + children_right, max_depth, min_node_size, classifier, t) + + for i in range(N): + if sdp[i] >= pi_level: + subset = 0 + for j in range(sufficient[i].size()): + a = 0 + for k in range(sufficient[i][j].size()): + if std_find[vector[long].iterator, long](power_cpp[s_0][s_1].begin(), power_cpp[s_0][s_1].end(), sufficient[i][j][k]) != power_cpp[s_0][s_1].end(): + a += 1 + if a == sufficient[i][j].size(): + subset = 1 + break + + if subset == 0: + sufficient[i].push_back(power_cpp[s_0][s_1]) + sufficient_sdp[i].push_back(sdp[i]) + for s in range(S_size): + sdp_global[S[s]] += 1 + K += 1 + + return sufficient, sufficient_sdp, np.asarray(sdp_global)/K + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.nonecheck(False) +@cython.cdivision(True) +cdef double single_compute_ddp_intv_rule_weights(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, + int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition, + double[:] & w, const double[:, :] & cond) nogil: + + cdef unsigned int n_trees = features.shape[0] + cdef unsigned int N = data.shape[0] + cdef double s, sdp + cdef int o + sdp = 0 + + cdef int b, level, i, it_node + cdef set[int] nodes_level, nodes_child, in_data, in_data_b + cdef set[int].iterator it, it_point + + for b in range(n_trees): + nodes_child.clear() + nodes_level.clear() + nodes_level.insert(0) + + in_data.clear() + in_data_b.clear() + for i in range(N): + in_data.insert(i) + in_data_b.insert(i) + + for level in range(max_depth): + it_point = nodes_level.begin() + while(it_point != nodes_level.end()): + it_node = deref(it_point) + if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + nodes_child.insert(children_left[b, it_node]) + nodes_child.insert(children_right[b, it_node]) + + elif features[b, it_node] >=0 and cond[features[b, it_node], 1] <= thresholds[b, it_node]: + nodes_child.insert(children_left[b, it_node]) + + if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + partition[features[b, it_node], 1] = thresholds[b, it_node] + + it = in_data.begin() + while(it != in_data.end()): + if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + in_data_b.erase(deref(it)) + inc(it) + in_data = in_data_b + + elif features[b, it_node] >=0 and cond[features[b, it_node], 0] > thresholds[b, it_node]: + nodes_child.insert(children_right[b, it_node]) + + if partition[features[b, it_node], 0] <= thresholds[b, it_node]: + partition[features[b, it_node], 0] = thresholds[b, it_node] + + it = in_data.begin() + while(it != in_data.end()): + if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + in_data_b.erase(deref(it)) + inc(it) + in_data = in_data_b + + elif features[b, it_node] >=0 and cond[features[b, it_node], 1] >= thresholds[b, it_node] and cond[features[b, it_node], 0] <= thresholds[b, it_node]: + nodes_child.insert(children_left[b, it_node]) + nodes_child.insert(children_right[b, it_node]) + + # if partition[features[b, it_node], 0] <= thresholds[b, it_node]: # TO DO: compute correctly the partition in this case + # partition[features[b, it_node], 0] = cond[features[b, it_node], 0] + + # if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + # partition[features[b, it_node], 1] = cond[features[b, it_node], 1] + + # it = in_data.begin() + # while(it != in_data.end()): + # if data[deref(it), features[b, it_node]] < cond[features[b, it_node], 0] or data[deref(it), features[b, it_node]] > cond[features[b, it_node], 1]: + # in_data_b.erase(deref(it)) + # inc(it) + # in_data = in_data_b + + else: + nodes_child.insert(children_left[b, it_node]) + nodes_child.insert(children_right[b, it_node]) + + if in_data.size() < min_node_size: + break + inc(it_point) + + nodes_level = nodes_child + + if classifier == 1: + it = in_data.begin() + while(it != in_data.end()): + sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) + w[deref(it)] += (1./(n_trees*in_data.size())) + inc(it) + else: + it = in_data.begin() + while(it != in_data.end()): + sdp += (1./(n_trees*in_data.size())) * (1-(t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) + w[deref(it)] += (1./(n_trees*in_data.size())) + inc(it) + + return sdp + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.nonecheck(False) +@cython.cdivision(True) +cpdef compute_ddp_intv_weights(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, + int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + const double [:, :, :] & cond, + int max_depth, int min_node_size, int & classifier, double[:, :] & t): + + buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + buffer[:, :, 0] = -1e+10 + cdef double [:, :, :] partition_byobs = buffer + + cdef int N = X.shape[0] + cdef double[::1] sdp = np.zeros(N) + cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + cdef int i, j + + for i in prange(N, nogil=True, schedule='dynamic'): + sdp[i] = single_compute_ddp_intv_rule_weights(X[i], y_X[i], data, y_data, S[i], + features, thresholds, children_left, children_right, + max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i], cond[i]) + + return np.array(sdp), np.array(weights) + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.nonecheck(False) +@cython.cdivision(True) +cpdef compute_ddp_intv_same_set(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[int] S, + int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + const double [:, :, :] & cond, + int max_depth, int min_node_size, int & classifier, double[:, :] & t): + + buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + buffer[:, :, 0] = -1e+10 + cdef double [:, :, :] partition_byobs = buffer + + cdef int N = X.shape[0] + cdef double[::1] sdp = np.zeros(N) + cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + cdef int i, j + + for i in prange(N, nogil=True, schedule='dynamic'): + sdp[i] = single_compute_ddp_intv_rule_weights(X[i], y_X[i], data, y_data, S, + features, thresholds, children_left, children_right, + max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i], cond[i]) + + return np.array(sdp) + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.nonecheck(False) +@cython.cdivision(True) +cpdef global_ddp_intv(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, + int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + const double [:, :, :] & cond, + int max_depth, int min_node_size, int & classifier, double[:, :] & t, list C, double pi_level, + int minimal, bint stop, list search_space): + + cdef unsigned int N = X.shape[0] + cdef unsigned int m = X.shape[1] + + cdef double[:] sdp, sdp_b, sdp_ba + cdef double[:] sdp_global + cdef double[:] in_data + sdp = np.zeros((N)) + sdp_b = np.zeros((N)) + sdp_global = np.zeros((m)) + in_data = np.zeros(N) + + cdef unsigned int it, it_s, a_it, b_it, o_all, p, p_s, nb_leaf, p_u, p_d, p_su, p_sd, down, up + cdef double ss, ss_a, ss_u, ss_d + cdef int b, leaf_numb, i, s, s_0, s_1, S_size, j, max_size, size + + cdef vector[int] S, len_s_star + len_s_star = np.zeros((N), dtype=np.int) + + cdef list power, va_id + + cdef vector[long] R, r + R.resize(N) + for i in range(N): + R[i] = i + r.resize(N) + + cdef long[:] R_buf + R_buf = np.zeros((N), dtype=np.int) + + X_arr = np.array(X, dtype=np.double) + y_X_arr = np.array(y_X, dtype=np.double) + cond_arr = np.array(cond) + t_arr = np.array(t, dtype=np.double) + + # buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + # buffer[:, :, 0] = -1e+10 + # cdef double [:, :, :] partition_byobs = buffer + # cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + + if C[0] != []: + remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] + va_id = [[i] for i in search_space if i not in remove_va] + for ci in range(len(C)): + i = 0 + for cj in range(len(C[ci])): + if C[ci][cj] in search_space: + i += 1 + break + if i != 0: + va_id += [C[ci]] + else: + va_id = [[i] for i in search_space] + + m = len(va_id) + power = [] + max_size = 0 + for size in range(m + 1): + power_b = [] + for co in itertools.combinations(va_id, size): + power_b.append(np.array(sum(list(co),[]))) + max_size += 1 + power.append(power_b) + if max_size >= 2**15: + break + + cdef vector[vector[vector[long]]] power_cpp = power + cdef long[:, :] s_star + s_star = -1*np.ones((N, X.shape[1]), dtype=np.int) + + + cdef long power_set_size = 2**m + S = np.zeros((data.shape[1]), dtype=np.int) + + for s_0 in tqdm(range(minimal, m + 1)): + for s_1 in range(0, power_cpp[s_0].size()): + for i in range(power_cpp[s_0][s_1].size()): + S[i] = power_cpp[s_0][s_1][i] + + S_size = power_cpp[s_0][s_1].size() + r.clear() + N = R.size() + in_data = np.zeros(X.shape[0]) + + for i in range(N): + R_buf[i] = R[i] + in_data[R_buf[i]] = 1 + + # sdp_b[R_buf[i]] = single_compute_ddp_intv_rule_weights(X[R_buf[i]], y_X[R_buf[i]], data, y_data, S[:S_size], + # features, thresholds, children_left, children_right, + # max_depth, min_node_size, classifier, t, + # partition_byobs[R_buf[i]], weights[R_buf[i]], cond[R_buf[i]]) + + sdp_ba = compute_ddp_intv_same_set(X_arr[np.array(in_data, dtype=bool)], + y_X_arr[np.array(in_data, dtype=bool)], + data, y_data, S[:S_size], features, thresholds, children_left, + children_right, cond_arr[np.array(in_data, dtype=bool)], max_depth, min_node_size, classifier, t_arr[np.array(in_data, dtype=bool)]) + + for i in range(N): + sdp_b[R_buf[i]] = sdp_ba[i] + if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: + sdp[R_buf[i]] = sdp_b[R_buf[i]] + len_s_star[R_buf[i]] = S_size + for s in range(S_size): + s_star[R_buf[i], s] = S[s] + + if S_size == X.shape[1]: + sdp[R_buf[i]] = 1 + len_s_star[R_buf[i]] = S_size + for s in range(S_size): + s_star[R_buf[i], s] = S[s] + for s in range(len_s_star[R_buf[i]], X.shape[1]): # to filter (important for coalition) + s_star[R_buf[i], s] = -1 + + for i in range(N): + if sdp[R_buf[i]] >= pi_level: + r.push_back(R[i]) + for s in range(len_s_star[R_buf[i]]): + sdp_global[s_star[R_buf[i], s]] += 1 + + for i in range(r.size()): + std_remove[vector[long].iterator, long](R.begin(), R.end(), r[i]) + R.pop_back() + + if (R.size() == 0 or S_size >= X.shape[1]/2) and stop: + break + + return np.asarray(sdp_global)/X.shape[0], np.array(s_star, dtype=np.long), np.array(len_s_star, dtype=np.long), np.array(sdp) + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.nonecheck(False) +@cython.cdivision(True) +cdef double single_compute_cdp_rule(double[:] & x, double & y_x, double & down, double & up, double[:, :] & data, double[::1] & y_data, vector[int] & S, + int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition) nogil: + + cdef unsigned int n_trees = features.shape[0] + cdef unsigned int N = data.shape[0] + cdef double s, sdp + cdef int o + sdp = 0 + + cdef int b, level, i, it_node + cdef set[int] nodes_level, nodes_child, in_data, in_data_b + cdef set[int].iterator it, it_point + + for b in range(n_trees): + nodes_child.clear() + nodes_level.clear() + nodes_level.insert(0) + + in_data.clear() + in_data_b.clear() + for i in range(N): + in_data.insert(i) + in_data_b.insert(i) + + for level in range(max_depth): + it_point = nodes_level.begin() + while(it_point != nodes_level.end()): + it_node = deref(it_point) + if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + if x[features[b, it_node]] <= thresholds[b, it_node]: + nodes_child.insert(children_left[b, it_node]) + + if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + partition[features[b, it_node], 1] = thresholds[b, it_node] + + it = in_data.begin() + while(it != in_data.end()): + if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + in_data_b.erase(deref(it)) + inc(it) + in_data = in_data_b + + else: + nodes_child.insert(children_right[b, it_node]) + + if partition[features[b, it_node], 0] <= thresholds[b, it_node]: + partition[features[b, it_node], 0] = thresholds[b, it_node] + + it = in_data.begin() + while(it != in_data.end()): + if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + in_data_b.erase(deref(it)) + inc(it) + in_data = in_data_b + else: + nodes_child.insert(children_left[b, it_node]) + nodes_child.insert(children_right[b, it_node]) + + if in_data.size() < min_node_size: + break + inc(it_point) + + nodes_level = nodes_child + + if classifier == 1: + it = in_data.begin() + while(it != in_data.end()): + sdp += (1./(n_trees*in_data.size())) * (y_x == y_data[deref(it)]) + inc(it) + else: + it = in_data.begin() + while(it != in_data.end()): + sdp += (1./(n_trees*in_data.size())) * (down<=y_data[deref(it)]<=up) + inc(it) + + return sdp + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.nonecheck(False) +@cython.cdivision(True) +cpdef compute_cdp_rule(double[:, :] & X, double[::1] & y_X, double[::1] down, double[::1] up, double[:, :] & data, double[::1] & y_data, vector[vector[int]] & S, + int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + int & max_depth, int & min_node_size, int & classifier, double[:, :] & t): + + buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + buffer[:, :, 0] = -1e+10 + cdef double [:, :, :] partition_byobs = buffer + + cdef int N = X.shape[0] + cdef double[::1] sdp = np.zeros(N) + cdef int i + + for i in prange(N, nogil=True, schedule='dynamic'): + sdp[i] = single_compute_cdp_rule(X[i], y_X[i], down[i], up[i], data, y_data, S[i], + features, thresholds, children_left, children_right, + max_depth, min_node_size, classifier, t[i], partition_byobs[i]) + + return np.array(sdp), np.array(partition_byobs) + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.nonecheck(False) +@cython.cdivision(True) +cdef double single_compute_cdp_cond_rule_weights(double[:] & x, double & y_x, double & down, double & up, double[:, :] & data, double[::1] & y_data, vector[int] & S, + int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition, + double[:] & w, const double[:, :] & cond) nogil: + + cdef unsigned int n_trees = features.shape[0] + cdef unsigned int N = data.shape[0] + cdef double s, sdp + cdef int o + sdp = 0 + + cdef int b, level, i, it_node + cdef set[int] nodes_level, nodes_child, in_data, in_data_b + cdef set[int].iterator it, it_point + + for b in range(n_trees): + nodes_child.clear() + nodes_level.clear() + nodes_level.insert(0) + + in_data.clear() + in_data_b.clear() + for i in range(N): + in_data.insert(i) + in_data_b.insert(i) + + for level in range(max_depth): + it_point = nodes_level.begin() + while(it_point != nodes_level.end()): + it_node = deref(it_point) + if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + if x[features[b, it_node]] <= thresholds[b, it_node]: + nodes_child.insert(children_left[b, it_node]) + + if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + partition[features[b, it_node], 1] = thresholds[b, it_node] + + it = in_data.begin() + while(it != in_data.end()): + if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + in_data_b.erase(deref(it)) + inc(it) + in_data = in_data_b + + else: + nodes_child.insert(children_right[b, it_node]) + + if partition[features[b, it_node], 0] <= thresholds[b, it_node]: + partition[features[b, it_node], 0] = thresholds[b, it_node] + + it = in_data.begin() + while(it != in_data.end()): + if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + in_data_b.erase(deref(it)) + inc(it) + in_data = in_data_b + + elif features[b, it_node] >=0 and cond[features[b, it_node], 1] <= thresholds[b, it_node]: + nodes_child.insert(children_left[b, it_node]) + + if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + partition[features[b, it_node], 1] = thresholds[b, it_node] + + it = in_data.begin() + while(it != in_data.end()): + if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + in_data_b.erase(deref(it)) + inc(it) + in_data = in_data_b + + elif features[b, it_node] >=0 and cond[features[b, it_node], 0] > thresholds[b, it_node]: + nodes_child.insert(children_right[b, it_node]) + + if partition[features[b, it_node], 0] <= thresholds[b, it_node]: + partition[features[b, it_node], 0] = thresholds[b, it_node] + + it = in_data.begin() + while(it != in_data.end()): + if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + in_data_b.erase(deref(it)) + inc(it) + in_data = in_data_b + + elif features[b, it_node] >=0 and cond[features[b, it_node], 1] >= thresholds[b, it_node] and cond[features[b, it_node], 0] <= thresholds[b, it_node]: + nodes_child.insert(children_left[b, it_node]) + nodes_child.insert(children_right[b, it_node]) + + # if partition[features[b, it_node], 0] <= thresholds[b, it_node]: # TO DO: compute correctly the partition in this case + # partition[features[b, it_node], 0] = cond[features[b, it_node], 0] + + # if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + # partition[features[b, it_node], 1] = cond[features[b, it_node], 1] + + # it = in_data.begin() + # while(it != in_data.end()): + # if data[deref(it), features[b, it_node]] < cond[features[b, it_node], 0] or data[deref(it), features[b, it_node]] > cond[features[b, it_node], 1]: + # in_data_b.erase(deref(it)) + # inc(it) + # in_data = in_data_b + + else: + nodes_child.insert(children_left[b, it_node]) + nodes_child.insert(children_right[b, it_node]) + + if in_data.size() < min_node_size: + break + inc(it_point) + + nodes_level = nodes_child + + if classifier == 1: + it = in_data.begin() + while(it != in_data.end()): + sdp += (1./(n_trees*in_data.size())) * (y_x == y_data[deref(it)]) + w[deref(it)] += (1./(n_trees*in_data.size())) + inc(it) + else: + it = in_data.begin() + while(it != in_data.end()): + sdp += (1./(n_trees*in_data.size())) * (down <=y_data[deref(it)]<= up) + w[deref(it)] += (1./(n_trees*in_data.size())) + inc(it) + + return sdp + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.nonecheck(False) +@cython.cdivision(True) +cpdef compute_cdp_cond_weights(double[:, :] X, double[::1] y_X, double[::1] down, double[::1] up, double[:, :] data, double[::1] y_data, vector[vector[int]] S, + int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + const double [:, :, :] & cond, + int max_depth, int min_node_size, int & classifier, double[:, :] & t, double & pi): + + buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + buffer[:, :, 0] = -1e+10 + cdef double [:, :, :] partition_byobs = buffer + + cdef int N = X.shape[0] + cdef double[::1] sdp = np.zeros(N) + cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + cdef int i, j + + for i in prange(N, nogil=True, schedule='dynamic'): + sdp[i] = single_compute_cdp_cond_rule_weights(X[i], y_X[i], down[i], up[i], data, y_data, S[i], + features, thresholds, children_left, children_right, + max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i], cond[i]) + + return np.array(sdp), np.array(weights) + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.nonecheck(False) +@cython.cdivision(True) +cdef double single_compute_cdp_rf(double[:] & x, double & y_x, double & down, double & up, double[:, :] & data, double[::1] & y_data, vector[int] & S, + int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + int & max_depth, int & min_node_size, int & classifier, double[:] & t) nogil: + + cdef unsigned int n_trees = features.shape[0] + cdef unsigned int N = data.shape[0] + cdef double s, sdp + cdef int o + sdp = 0 + + cdef int b, level, i, it_node + cdef set[int] nodes_level, nodes_child, in_data, in_data_b + cdef set[int].iterator it, it_point + + for b in range(n_trees): + nodes_child.clear() + nodes_level.clear() + nodes_level.insert(0) + + in_data.clear() + in_data_b.clear() + for i in range(N): + in_data.insert(i) + in_data_b.insert(i) + + for level in range(max_depth): + it_point = nodes_level.begin() + while(it_point != nodes_level.end()): + it_node = deref(it_point) + if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + if x[features[b, it_node]] <= thresholds[b, it_node]: + nodes_child.insert(children_left[b, it_node]) + + it = in_data.begin() + while(it != in_data.end()): + if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + in_data_b.erase(deref(it)) + inc(it) + in_data = in_data_b + + else: + nodes_child.insert(children_right[b, it_node]) + + it = in_data.begin() + while(it != in_data.end()): + if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + in_data_b.erase(deref(it)) + inc(it) + in_data = in_data_b + else: + nodes_child.insert(children_left[b, it_node]) + nodes_child.insert(children_right[b, it_node]) + + if in_data.size() < min_node_size: + break + inc(it_point) + + nodes_level = nodes_child + + if classifier == 1: + it = in_data.begin() + while(it != in_data.end()): + sdp += (1./(n_trees*in_data.size())) * (y_x == y_data[deref(it)]) + inc(it) + else: + it = in_data.begin() + while(it != in_data.end()): + sdp += (1./(n_trees*in_data.size())) * (down<=y_data[deref(it)]<= up) + inc(it) + + return sdp + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.nonecheck(False) +@cython.cdivision(True) +cpdef compute_cdp_rf(double[:, :] X, double[::1] y_X, double[::1] down, double[::1] up, double[:, :] data, double[::1] y_data, vector[vector[int]] S, + int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + int max_depth, int min_node_size, int & classifier, double[:, :] & t): + + cdef int N = X.shape[0] + cdef double[::1] sdp = np.zeros(N) + cdef int i + for i in prange(N, nogil=True, schedule='dynamic'): + sdp[i] = single_compute_cdp_rf(X[i], y_X[i], down[i], up[i], data, y_data, S[i], + features, thresholds, children_left, children_right, + max_depth, min_node_size, classifier, t[i]) + return np.array(sdp) + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.nonecheck(False) +@cython.cdivision(True) +cpdef compute_cdp_rf_same_set(double[:, :] X, double[::1] y_X, double[::1] down, double[::1] up, double[:, :] data, double[::1] y_data, vector[int] S, + int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + int max_depth, int min_node_size, int & classifier, double[:, :] & t): + + cdef int N = X.shape[0] + cdef double[::1] sdp = np.zeros(N) + cdef int i + for i in prange(N, nogil=True, schedule='dynamic'): + sdp[i] = single_compute_cdp_rf(X[i], y_X[i], down[i], up[i], data, y_data, S, + features, thresholds, children_left, children_right, + max_depth, min_node_size, classifier, t[i]) + return np.array(sdp) + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.nonecheck(False) +@cython.cdivision(True) +cpdef global_cdp_rf(double[:, :] X, double[::1] y_X, double[::1] DOWN, double[::1] UP, double[:, :] data, double[::1] y_data, + int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + int max_depth, int min_node_size, int & classifier, double[:, :] & t, list C, double pi_level, + int minimal, bint stop, list search_space): + + cdef unsigned int N = X.shape[0] + cdef unsigned int m = X.shape[1] + + cdef double[:] sdp, sdp_b, sdp_ba + cdef double[:] sdp_global + cdef double[:] in_data + sdp = np.zeros((N)) + sdp_b = np.zeros((N)) + sdp_global = np.zeros((m)) + in_data = np.zeros(N) + + cdef unsigned int it, it_s, a_it, b_it, o_all, p, p_s, nb_leaf, p_u, p_d, p_su, p_sd, down, up + cdef double ss, ss_a, ss_u, ss_d + cdef int b, leaf_numb, i, s, s_0, s_1, S_size, j, max_size, size + + cdef vector[int] S, len_s_star + len_s_star = np.zeros((N), dtype=np.int) + + cdef list power, va_id + + cdef vector[long] R, r + R.resize(N) + for i in range(N): + R[i] = i + r.resize(N) + + cdef long[:] R_buf + R_buf = np.zeros((N), dtype=np.int) + + X_arr = np.array(X, dtype=np.double) + y_X_arr = np.array(y_X, dtype=np.double) + down_arr = np.array(DOWN, dtype=np.double) + up_arr = np.array(UP, dtype=np.double) + t_arr = np.array(t, dtype=np.double) + + if C[0] != []: + remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] + va_id = [[i] for i in search_space if i not in remove_va] + for ci in range(len(C)): + i = 0 + for cj in range(len(C[ci])): + if C[ci][cj] in search_space: + i += 1 + break + if i != 0: + va_id += [C[ci]] + else: + va_id = [[i] for i in search_space] + + m = len(va_id) + power = [] + max_size = 0 + for size in range(m + 1): + power_b = [] + for co in itertools.combinations(va_id, size): + power_b.append(np.array(sum(list(co),[]))) + max_size += 1 + power.append(power_b) + if max_size >= 2**15: + break + + cdef vector[vector[vector[long]]] power_cpp = power + cdef long[:, :] s_star + s_star = -1*np.ones((N, X.shape[1]), dtype=np.int) + + cdef long power_set_size = 2**m + S = np.zeros((data.shape[1]), dtype=np.int) + S_bar = np.zeros((data.shape[1]), dtype=np.int) + + for s_0 in tqdm(range(minimal, m+1)): + for s_1 in range(0, power_cpp[s_0].size()): + for i in range(power_cpp[s_0][s_1].size()): + S[i] = power_cpp[s_0][s_1][i] + + S_size = power_cpp[s_0][s_1].size() + r.clear() + N = R.size() + in_data = np.zeros(X.shape[0]) + + S_bar_set = list(range(data.shape[1])) + for i in range(S_size): + S_bar_set.remove(S[i]) + + for i in range(data.shape[1]-S_size): + S_bar[i] = S_bar_set[i] + + for i in range(N): + R_buf[i] = R[i] + in_data[R_buf[i]] = 1 + + # sdp_b[R_buf[i]] = single_compute_ddp_rf(X[R_buf[i]], y_X[R_buf[i]], down[R_buf[i]], up[R[buf[i]], data, y_data, S_bar[:m-S_size], features, thresholds, children_left, children_right, + # max_depth, min_node_size, classifier, t) + + sdp_ba = compute_cdp_rf_same_set(X_arr[np.array(in_data, dtype=bool)], + y_X_arr[np.array(in_data, dtype=bool)], down_arr[np.array(in_data, dtype=bool)], + up_arr[np.array(in_data, dtype=bool)], + data, y_data, S_bar[:data.shape[1]-S_size], features, thresholds, children_left, + children_right, max_depth, min_node_size, classifier, t_arr[np.array(in_data, dtype=bool)]) + + for i in range(N): + sdp_b[R_buf[i]] = sdp_ba[i] + if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: + sdp[R_buf[i]] = sdp_b[R_buf[i]] + len_s_star[R_buf[i]] = S_size + for s in range(S_size): + s_star[R_buf[i], s] = S[s] + + if S_size == X.shape[1]: + sdp[R_buf[i]] = 1 + len_s_star[R_buf[i]] = S_size + for s in range(S_size): + s_star[R_buf[i], s] = S[s] + for s in range(len_s_star[R_buf[i]], X.shape[1]): # to filter (important for coalition) + s_star[R_buf[i], s] = -1 + + for i in range(N): + if sdp[R_buf[i]] >= pi_level: + r.push_back(R[i]) + for s in range(len_s_star[R_buf[i]]): + sdp_global[s_star[R_buf[i], s]] += 1 + + for i in range(r.size()): + std_remove[vector[long].iterator, long](R.begin(), R.end(), r[i]) + R.pop_back() + + if (R.size() == 0 or S_size >= X.shape[1]/2) and stop: + break + + return np.asarray(sdp_global)/X.shape[0], np.array(s_star, dtype=np.long), np.array(len_s_star, dtype=np.long), np.array(sdp) + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.nonecheck(False) +@cython.cdivision(True) +cdef double single_compute_cdp_rule_weights(double[:] & x, double & y_x, double & down, double & up, double[:, :] & data, double[::1] & y_data, vector[int] & S, + int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition, + double[:] & w) nogil: + + cdef unsigned int n_trees = features.shape[0] + cdef unsigned int N = data.shape[0] + cdef double s, sdp + cdef int o + sdp = 0 + + cdef int b, level, i, it_node + cdef set[int] nodes_level, nodes_child, in_data, in_data_b + cdef set[int].iterator it, it_point + + for b in range(n_trees): + nodes_child.clear() + nodes_level.clear() + nodes_level.insert(0) + + in_data.clear() + in_data_b.clear() + for i in range(N): + in_data.insert(i) + in_data_b.insert(i) + + for level in range(max_depth): + it_point = nodes_level.begin() + while(it_point != nodes_level.end()): + it_node = deref(it_point) + if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + if x[features[b, it_node]] <= thresholds[b, it_node]: + nodes_child.insert(children_left[b, it_node]) + + if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + partition[features[b, it_node], 1] = thresholds[b, it_node] + + it = in_data.begin() + while(it != in_data.end()): + if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + in_data_b.erase(deref(it)) + inc(it) + in_data = in_data_b + + else: + nodes_child.insert(children_right[b, it_node]) + + if partition[features[b, it_node], 0] <= thresholds[b, it_node]: + partition[features[b, it_node], 0] = thresholds[b, it_node] + + it = in_data.begin() + while(it != in_data.end()): + if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + in_data_b.erase(deref(it)) + inc(it) + in_data = in_data_b + else: + nodes_child.insert(children_left[b, it_node]) + nodes_child.insert(children_right[b, it_node]) + + if in_data.size() < min_node_size: + break + inc(it_point) + + nodes_level = nodes_child + + if classifier == 1: + it = in_data.begin() + while(it != in_data.end()): + sdp += (1./(n_trees*in_data.size())) * (y_x == y_data[deref(it)]) + w[deref(it)] += (1./(n_trees*in_data.size())) + inc(it) + else: + it = in_data.begin() + while(it != in_data.end()): + sdp += (1./(n_trees*in_data.size())) * (down<=y_data[deref(it)]<=up) + w[deref(it)] += (1./(n_trees*in_data.size())) + inc(it) + + return sdp + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.nonecheck(False) +@cython.cdivision(True) +cpdef compute_cdp_weights(double[:, :] X, double[::1] y_X, double[::1] down, double[::1] up, double[:, :] data, double[::1] y_data, vector[vector[int]] S, + int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + int max_depth, int min_node_size, int & classifier, double[:, :] & t, double & pi): + + buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + buffer[:, :, 0] = -1e+10 + cdef double [:, :, :] partition_byobs = buffer + + cdef int N = X.shape[0] + cdef double[::1] sdp = np.zeros(N) + cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + cdef int i, j + + for i in prange(N, nogil=True, schedule='dynamic'): + sdp[i] = single_compute_cdp_rule_weights(X[i], y_X[i], down[i], up[i], data, y_data, S[i], + features, thresholds, children_left, children_right, + max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i]) + + return np.array(sdp), np.array(weights) + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.nonecheck(False) +@cython.cdivision(True) +cpdef compute_cdp_weights_verbose(double[:, :] X, double[::1] y_X, double[::1] down, double[::1] up, double[:, :] data, double[::1] y_data, vector[vector[int]] S, + int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + int max_depth, int min_node_size, int & classifier, double[:, :] & t, double & pi): + + buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + buffer[:, :, 0] = -1e+10 + cdef double [:, :, :] partition_byobs = buffer + + cdef int N = X.shape[0] + cdef double[::1] sdp = np.zeros(N) + cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + cdef int i, j + + for i in tqdm(range(N)): + sdp[i] = single_compute_cdp_rule_weights(X[i], y_X[i], down[i], up[i], data, y_data, S[i], + features, thresholds, children_left, children_right, + max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i]) + + + return np.array(sdp), np.array(weights) + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.nonecheck(False) +@cython.cdivision(True) +cdef double single_compute_cdp_intv_rule_weights(double[:] & x, double & y_x, double[:, :] & data, double[::1] & y_data, vector[int] & S, + int[:, :] & features, double[:, :] & thresholds, int[:, :] & children_left, int[:, :] & children_right, + int & max_depth, int & min_node_size, int & classifier, double[:] & t, double[:, :] & partition, + double[:] & w, const double[:, :] & cond) nogil: + + cdef unsigned int n_trees = features.shape[0] + cdef unsigned int N = data.shape[0] + cdef double s, sdp + cdef int o + sdp = 0 + + cdef int b, level, i, it_node + cdef set[int] nodes_level, nodes_child, in_data, in_data_b + cdef set[int].iterator it, it_point + + for b in range(n_trees): + nodes_child.clear() + nodes_level.clear() + nodes_level.insert(0) + + in_data.clear() + in_data_b.clear() + for i in range(N): + in_data.insert(i) + in_data_b.insert(i) + + for level in range(max_depth): + it_point = nodes_level.begin() + while(it_point != nodes_level.end()): + it_node = deref(it_point) + if std_find[vector[int].iterator, int](S.begin(), S.end(), features[b, it_node]) != S.end(): + nodes_child.insert(children_left[b, it_node]) + nodes_child.insert(children_right[b, it_node]) + + elif features[b, it_node] >=0 and cond[features[b, it_node], 1] <= thresholds[b, it_node]: + nodes_child.insert(children_left[b, it_node]) + + if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + partition[features[b, it_node], 1] = thresholds[b, it_node] + + it = in_data.begin() + while(it != in_data.end()): + if data[deref(it), features[b, it_node]] > thresholds[b, it_node]: + in_data_b.erase(deref(it)) + inc(it) + in_data = in_data_b + + elif features[b, it_node] >=0 and cond[features[b, it_node], 0] > thresholds[b, it_node]: + nodes_child.insert(children_right[b, it_node]) + + if partition[features[b, it_node], 0] <= thresholds[b, it_node]: + partition[features[b, it_node], 0] = thresholds[b, it_node] + + it = in_data.begin() + while(it != in_data.end()): + if data[deref(it), features[b, it_node]] <= thresholds[b, it_node]: + in_data_b.erase(deref(it)) + inc(it) + in_data = in_data_b + + elif features[b, it_node] >=0 and cond[features[b, it_node], 1] >= thresholds[b, it_node] and cond[features[b, it_node], 0] <= thresholds[b, it_node]: + nodes_child.insert(children_left[b, it_node]) + nodes_child.insert(children_right[b, it_node]) + + # if partition[features[b, it_node], 0] <= thresholds[b, it_node]: # TO DO: compute correctly the partition in this case + # partition[features[b, it_node], 0] = cond[features[b, it_node], 0] + + # if partition[features[b, it_node], 1] >= thresholds[b, it_node]: + # partition[features[b, it_node], 1] = cond[features[b, it_node], 1] + + # it = in_data.begin() + # while(it != in_data.end()): + # if data[deref(it), features[b, it_node]] < cond[features[b, it_node], 0] or data[deref(it), features[b, it_node]] > cond[features[b, it_node], 1]: + # in_data_b.erase(deref(it)) + # inc(it) + # in_data = in_data_b + + else: + nodes_child.insert(children_left[b, it_node]) + nodes_child.insert(children_right[b, it_node]) + + if in_data.size() < min_node_size: + break + inc(it_point) + + nodes_level = nodes_child + + if classifier == 1: + it = in_data.begin() + while(it != in_data.end()): + sdp += (1./(n_trees*in_data.size())) * (y_x != y_data[deref(it)]) + w[deref(it)] += (1./(n_trees*in_data.size())) + inc(it) + else: + it = in_data.begin() + while(it != in_data.end()): + sdp += (1./(n_trees*in_data.size())) * ((t[0]<=y_data[deref(it)])*(y_data[deref(it)] <= t[1])) + w[deref(it)] += (1./(n_trees*in_data.size())) + inc(it) + + return sdp + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.nonecheck(False) +@cython.cdivision(True) +cpdef compute_cdp_intv_weights(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[vector[int]] S, + int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + const double [:, :, :] & cond, + int max_depth, int min_node_size, int & classifier, double[:, :] & t): + + buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + buffer[:, :, 0] = -1e+10 + cdef double [:, :, :] partition_byobs = buffer + + cdef int N = X.shape[0] + cdef double[::1] sdp = np.zeros(N) + cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + cdef int i, j + + for i in prange(N, nogil=True, schedule='dynamic'): + sdp[i] = single_compute_cdp_intv_rule_weights(X[i], y_X[i], data, y_data, S[i], + features, thresholds, children_left, children_right, + max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i], cond[i]) + + return np.array(sdp), np.array(weights) + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.nonecheck(False) +@cython.cdivision(True) +cpdef compute_cdp_intv_same_set(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, vector[int] S, + int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + const double [:, :, :] & cond, + int max_depth, int min_node_size, int & classifier, double[:, :] & t): + + buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + buffer[:, :, 0] = -1e+10 + cdef double [:, :, :] partition_byobs = buffer + + cdef int N = X.shape[0] + cdef double[::1] sdp = np.zeros(N) + cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + cdef int i, j + + for i in prange(N, nogil=True, schedule='dynamic'): + sdp[i] = single_compute_cdp_intv_rule_weights(X[i], y_X[i], data, y_data, S, + features, thresholds, children_left, children_right, + max_depth, min_node_size, classifier, t[i], partition_byobs[i], weights[i], cond[i]) + + return np.array(sdp) + + +@cython.boundscheck(False) +@cython.wraparound(False) +@cython.nonecheck(False) +@cython.cdivision(True) +cpdef global_cdp_intv(double[:, :] X, double[::1] y_X, double[:, :] data, double[::1] y_data, + int[:, :] features, double[:, :] thresholds, int[:, :] children_left, int[:, :] children_right, + const double [:, :, :] & cond, + int max_depth, int min_node_size, int & classifier, double[:, :] & t, list C, double pi_level, + int minimal, bint stop, list search_space): + + cdef unsigned int N = X.shape[0] + cdef unsigned int m = X.shape[1] + + cdef double[:] sdp, sdp_b, sdp_ba + cdef double[:] sdp_global + cdef double[:] in_data + sdp = np.zeros((N)) + sdp_b = np.zeros((N)) + sdp_global = np.zeros((m)) + in_data = np.zeros(N) cdef unsigned int it, it_s, a_it, b_it, o_all, p, p_s, nb_leaf, p_u, p_d, p_su, p_sd, down, up - cdef double ss, ss_a, ss_u, ss_d, K - cdef int b, leaf_numb, i, s, s_0, s_1, S_size, j, max_size, size, subset, a, k - K = 0 + cdef double ss, ss_a, ss_u, ss_d + cdef int b, leaf_numb, i, s, s_0, s_1, S_size, j, max_size, size cdef vector[int] S, len_s_star len_s_star = np.zeros((N), dtype=np.int) cdef list power, va_id + cdef vector[long] R, r + R.resize(N) + for i in range(N): + R[i] = i + r.resize(N) + + cdef long[:] R_buf + R_buf = np.zeros((N), dtype=np.int) + + X_arr = np.array(X, dtype=np.double) + y_X_arr = np.array(y_X, dtype=np.double) + cond_arr = np.array(cond) + t_arr = np.array(t, dtype=np.double) + + # buffer = 1e+10 * np.ones(shape=(X.shape[0], X.shape[1], 2)) + # buffer[:, :, 0] = -1e+10 + # cdef double [:, :, :] partition_byobs = buffer + # cdef double[:, :] weights = np.zeros(shape=(N, data.shape[0])) + if C[0] != []: remove_va = [C[ci][cj] for ci in range(len(C)) for cj in range(len(C[ci]))] va_id = [[i] for i in search_space if i not in remove_va] @@ -5700,35 +7660,57 @@ cpdef sufficient_expl_rf(double[:, :] X, double[::1] y_X, double[:, :] data, do cdef long power_set_size = 2**m S = np.zeros((data.shape[1]), dtype=np.int) - cdef vector[vector[vector[long]]] sufficient = [[[-1]] for i in range(N)] - cdef vector[vector[double]] sufficient_sdp = [[-1] for i in range(N)] - for s_0 in tqdm(range(minimal, m + 1)): for s_1 in range(0, power_cpp[s_0].size()): for i in range(power_cpp[s_0][s_1].size()): S[i] = power_cpp[s_0][s_1][i] S_size = power_cpp[s_0][s_1].size() - sdp = compute_sdp_rf_same_set(X, y_X, data, y_data, S[:S_size], features, thresholds, children_left, - children_right, max_depth, min_node_size, classifier, t) + r.clear() + N = R.size() + in_data = np.zeros(X.shape[0]) for i in range(N): - if sdp[i] >= pi_level: - subset = 0 - for j in range(sufficient[i].size()): - a = 0 - for k in range(sufficient[i][j].size()): - if std_find[vector[long].iterator, long](power_cpp[s_0][s_1].begin(), power_cpp[s_0][s_1].end(), sufficient[i][j][k]) != power_cpp[s_0][s_1].end(): - a += 1 - if a == sufficient[i][j].size(): - subset = 1 - break + R_buf[i] = R[i] + in_data[R_buf[i]] = 1 - if subset == 0: - sufficient[i].push_back(power_cpp[s_0][s_1]) - sufficient_sdp[i].push_back(sdp[i]) - for s in range(S_size): - sdp_global[S[s]] += 1 - K += 1 + # sdp_b[R_buf[i]] = single_compute_cdp_intv_rule_weights(X[R_buf[i]], y_X[R_buf[i]], data, y_data, S[:S_size], + # features, thresholds, children_left, children_right, + # max_depth, min_node_size, classifier, t, + # partition_byobs[R_buf[i]], weights[R_buf[i]], cond[R_buf[i]]) - return sufficient, sufficient_sdp, np.asarray(sdp_global)/K + sdp_ba = compute_cdp_intv_same_set(X_arr[np.array(in_data, dtype=bool)], + y_X_arr[np.array(in_data, dtype=bool)], + data, y_data, S[:S_size], features, thresholds, children_left, + children_right, cond_arr[np.array(in_data, dtype=bool)], max_depth, min_node_size, classifier, t_arr[np.array(in_data, dtype=bool)]) + + for i in range(N): + sdp_b[R_buf[i]] = sdp_ba[i] + if sdp_b[R_buf[i]] >= sdp[R_buf[i]]: + sdp[R_buf[i]] = sdp_b[R_buf[i]] + len_s_star[R_buf[i]] = S_size + for s in range(S_size): + s_star[R_buf[i], s] = S[s] + + if S_size == X.shape[1]: + sdp[R_buf[i]] = 1 + len_s_star[R_buf[i]] = S_size + for s in range(S_size): + s_star[R_buf[i], s] = S[s] + for s in range(len_s_star[R_buf[i]], X.shape[1]): # to filter (important for coalition) + s_star[R_buf[i], s] = -1 + + for i in range(N): + if sdp[R_buf[i]] >= pi_level: + r.push_back(R[i]) + for s in range(len_s_star[R_buf[i]]): + sdp_global[s_star[R_buf[i], s]] += 1 + + for i in range(r.size()): + std_remove[vector[long].iterator, long](R.begin(), R.end(), r[i]) + R.pop_back() + + if (R.size() == 0 or S_size >= X.shape[1]/2) and stop: + break + + return np.asarray(sdp_global)/X.shape[0], np.array(s_star, dtype=np.long), np.array(len_s_star, dtype=np.long), np.array(sdp) diff --git a/acv_explainers/cyext_acv/cyext_acv_cache.cpp b/acv_explainers/cyext_acv/cyext_acv_cache.cpp index f9b1e72..0feb3b8 100644 --- a/acv_explainers/cyext_acv/cyext_acv_cache.cpp +++ b/acv_explainers/cyext_acv/cyext_acv_cache.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.28 */ +/* Generated by Cython 0.29.32 */ /* BEGIN: Cython Metadata { @@ -29,8 +29,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_28" -#define CYTHON_HEX_VERSION 0x001D1CF0 +#define CYTHON_ABI "0_29_32" +#define CYTHON_HEX_VERSION 0x001D20F0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -69,6 +69,7 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_PYTYPE_LOOKUP @@ -105,10 +106,14 @@ END: Cython Metadata */ #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900) + #endif #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 1 #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif @@ -146,10 +151,59 @@ END: Cython Metadata */ #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(PY_NOGIL) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_NOGIL 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #ifndef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 1 + #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif @@ -199,7 +253,7 @@ END: Cython Metadata */ #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030B00A1) + #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000) #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) @@ -216,6 +270,9 @@ END: Cython Metadata */ #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) #endif + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 + #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) @@ -681,8 +738,10 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { } __Pyx_PyAsyncMethodsStruct; #endif -#if defined(WIN32) || defined(MS_WINDOWS) - #define _USE_MATH_DEFINES +#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) + #if !defined(_USE_MATH_DEFINES) + #define _USE_MATH_DEFINES + #endif #endif #include #ifdef NAN @@ -1001,30 +1060,26 @@ typedef struct { #ifndef CYTHON_ATOMICS #define CYTHON_ATOMICS 1 #endif +#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS #define __pyx_atomic_int_type int -#if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\ - (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\ - !defined(__i386__) - #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1) - #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1) +#if CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\ + (__GNUC_MINOR__ > 1 ||\ + (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2)))) + #define __pyx_atomic_incr_aligned(value) __sync_fetch_and_add(value, 1) + #define __pyx_atomic_decr_aligned(value) __sync_fetch_and_sub(value, 1) #ifdef __PYX_DEBUG_ATOMICS #warning "Using GNU atomics" #endif -#elif CYTHON_ATOMICS && defined(_MSC_VER) && 0 - #include +#elif CYTHON_ATOMICS && defined(_MSC_VER) && CYTHON_COMPILING_IN_NOGIL + #include #undef __pyx_atomic_int_type - #define __pyx_atomic_int_type LONG - #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value) - #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value) + #define __pyx_atomic_int_type long + #pragma intrinsic (_InterlockedExchangeAdd) + #define __pyx_atomic_incr_aligned(value) _InterlockedExchangeAdd(value, 1) + #define __pyx_atomic_decr_aligned(value) _InterlockedExchangeAdd(value, -1) #ifdef __PYX_DEBUG_ATOMICS #pragma message ("Using MSVC atomics") #endif -#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0 - #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value) - #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value) - #ifdef __PYX_DEBUG_ATOMICS - #warning "Using Intel atomics" - #endif #else #undef CYTHON_ATOMICS #define CYTHON_ATOMICS 0 @@ -1035,9 +1090,9 @@ typedef struct { typedef volatile __pyx_atomic_int_type __pyx_atomic_int; #if CYTHON_ATOMICS #define __pyx_add_acquisition_count(memview)\ - __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) + __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview)) #define __pyx_sub_acquisition_count(memview)\ - __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) + __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview)) #else #define __pyx_add_acquisition_count(memview)\ __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) @@ -1082,7 +1137,7 @@ typedef struct { } __Pyx_BufFmt_Context; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":690 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":690 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -1091,7 +1146,7 @@ typedef struct { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":691 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":691 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -1100,7 +1155,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":692 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":692 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -1109,7 +1164,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":693 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":693 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -1118,7 +1173,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":697 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":697 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -1127,7 +1182,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":698 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":698 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -1136,7 +1191,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":699 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":699 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -1145,7 +1200,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":700 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":700 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -1154,7 +1209,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":704 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":704 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -1163,7 +1218,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":705 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":705 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -1172,7 +1227,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":714 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":714 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< @@ -1181,7 +1236,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":715 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":715 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< @@ -1190,7 +1245,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":716 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":716 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -1199,7 +1254,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":718 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":718 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -1208,7 +1263,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":719 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":719 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -1217,7 +1272,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":720 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":720 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -1226,7 +1281,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":722 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":722 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -1235,7 +1290,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":723 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":723 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -1244,7 +1299,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":725 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":725 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -1253,7 +1308,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":726 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":726 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -1262,7 +1317,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":727 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":727 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -1310,7 +1365,7 @@ struct __pyx_MemviewEnum_obj; struct __pyx_memoryview_obj; struct __pyx_memoryviewslice_obj; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":729 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":729 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -1319,7 +1374,7 @@ struct __pyx_memoryviewslice_obj; */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":730 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":730 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -1328,7 +1383,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":731 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":731 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -1337,7 +1392,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":733 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":733 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -1346,7 +1401,7 @@ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; */ typedef npy_cdouble __pyx_t_5numpy_complex_t; -/* "View.MemoryView":105 +/* "View.MemoryView":106 * * @cname("__pyx_array") * cdef class array: # <<<<<<<<<<<<<< @@ -1371,7 +1426,7 @@ struct __pyx_array_obj { }; -/* "View.MemoryView":279 +/* "View.MemoryView":280 * * @cname('__pyx_MemviewEnum') * cdef class Enum(object): # <<<<<<<<<<<<<< @@ -1384,7 +1439,7 @@ struct __pyx_MemviewEnum_obj { }; -/* "View.MemoryView":330 +/* "View.MemoryView":331 * * @cname('__pyx_memoryview') * cdef class memoryview(object): # <<<<<<<<<<<<<< @@ -1407,7 +1462,7 @@ struct __pyx_memoryview_obj { }; -/* "View.MemoryView":965 +/* "View.MemoryView":967 * * @cname('__pyx_memoryviewslice') * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< @@ -1424,7 +1479,7 @@ struct __pyx_memoryviewslice_obj { -/* "View.MemoryView":105 +/* "View.MemoryView":106 * * @cname("__pyx_array") * cdef class array: # <<<<<<<<<<<<<< @@ -1438,7 +1493,7 @@ struct __pyx_vtabstruct_array { static struct __pyx_vtabstruct_array *__pyx_vtabptr_array; -/* "View.MemoryView":330 +/* "View.MemoryView":331 * * @cname('__pyx_memoryview') * cdef class memoryview(object): # <<<<<<<<<<<<<< @@ -1458,7 +1513,7 @@ struct __pyx_vtabstruct_memoryview { static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview; -/* "View.MemoryView":965 +/* "View.MemoryView":967 * * @cname('__pyx_memoryviewslice') * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< @@ -1676,6 +1731,12 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, #if CYTHON_FAST_PYCALL static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" +#if PY_VERSION_HEX >= 0x030b00a6 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) @@ -1940,6 +2001,12 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { /* DivInt[long].proto */ static CYTHON_INLINE long __Pyx_div_long(long, long); +/* PySequenceContains.proto */ +static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); @@ -2523,7 +2590,7 @@ static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview"; static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview"; static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; -static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))"; +static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))"; static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported"; static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s"; static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)"; @@ -2542,7 +2609,7 @@ static PyObject *__pyx_kp_s_Cannot_index_with_type_s; static PyObject *__pyx_n_s_Ellipsis; static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr; static PyObject *__pyx_n_s_ImportError; -static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0; +static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0; static PyObject *__pyx_n_s_IndexError; static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte; static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr; @@ -2700,6 +2767,8 @@ static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; +static PyObject *__pyx_int_112105877; +static PyObject *__pyx_int_136983863; static PyObject *__pyx_int_184977713; static PyObject *__pyx_int_neg_1; static PyObject *__pyx_tuple_; @@ -2728,7 +2797,8 @@ static PyObject *__pyx_tuple__23; static PyObject *__pyx_tuple__24; static PyObject *__pyx_tuple__25; static PyObject *__pyx_tuple__26; -static PyObject *__pyx_codeobj__27; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_codeobj__28; /* Late includes */ /* "cyext_acv_cache.pyx":22 @@ -12979,7 +13049,7 @@ static PyObject *__pyx_pf_15cyext_acv_cache_10leaves_cache_normalized(CYTHON_UNU return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":735 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":735 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -12996,7 +13066,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":736 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":736 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -13010,7 +13080,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":735 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":735 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -13029,7 +13099,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":738 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":738 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -13046,7 +13116,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":739 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":739 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -13060,7 +13130,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":738 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":738 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -13079,7 +13149,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":741 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":741 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -13096,7 +13166,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":742 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":742 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -13110,7 +13180,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":741 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":741 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -13129,7 +13199,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":744 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":744 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -13146,7 +13216,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":745 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":745 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -13160,7 +13230,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":744 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":744 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -13179,7 +13249,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":747 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":747 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -13196,7 +13266,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":748 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":748 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -13210,7 +13280,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":747 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":747 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -13229,7 +13299,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":750 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":750 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -13243,7 +13313,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ int __pyx_t_1; __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":751 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":751 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -13253,7 +13323,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0); if (__pyx_t_1) { - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":752 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":752 * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape # <<<<<<<<<<<<<< @@ -13265,7 +13335,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":751 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":751 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -13274,7 +13344,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ */ } - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":754 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":754 * return d.subarray.shape * else: * return () # <<<<<<<<<<<<<< @@ -13288,7 +13358,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; } - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":750 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":750 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -13303,7 +13373,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":929 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":929 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -13315,7 +13385,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":930 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":930 * * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< @@ -13324,7 +13394,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":931 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":931 * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< @@ -13333,7 +13403,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base)); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":929 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":929 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -13345,7 +13415,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":933 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":933 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -13360,7 +13430,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":934 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":934 * * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< @@ -13369,7 +13439,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ __pyx_v_base = PyArray_BASE(__pyx_v_arr); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":935 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":935 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -13379,7 +13449,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = ((__pyx_v_base == NULL) != 0); if (__pyx_t_1) { - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":936 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":936 * base = PyArray_BASE(arr) * if base is NULL: * return None # <<<<<<<<<<<<<< @@ -13390,7 +13460,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":935 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":935 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -13399,7 +13469,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":937 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":937 * if base is NULL: * return None * return base # <<<<<<<<<<<<<< @@ -13411,7 +13481,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = ((PyObject *)__pyx_v_base); goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":933 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":933 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -13426,7 +13496,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":941 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":941 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -13450,7 +13520,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_array", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":942 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":942 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -13466,7 +13536,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":943 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":943 * cdef inline int import_array() except -1: * try: * __pyx_import_array() # <<<<<<<<<<<<<< @@ -13475,7 +13545,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { */ __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 943, __pyx_L3_error) - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":942 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":942 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -13489,7 +13559,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":944 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":944 * try: * __pyx_import_array() * except Exception: # <<<<<<<<<<<<<< @@ -13504,7 +13574,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":945 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":945 * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -13520,7 +13590,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":942 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":942 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -13535,7 +13605,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":941 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":941 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -13558,7 +13628,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":947 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":947 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -13582,7 +13652,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_umath", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":948 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":948 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -13598,7 +13668,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":949 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":949 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -13607,7 +13677,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { */ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 949, __pyx_L3_error) - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":948 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":948 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -13621,7 +13691,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":950 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":950 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -13636,7 +13706,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":951 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":951 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -13652,7 +13722,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":948 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":948 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -13667,7 +13737,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":947 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":947 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -13690,7 +13760,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":953 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":953 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -13714,7 +13784,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":954 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":954 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -13730,7 +13800,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":955 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":955 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -13739,7 +13809,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { */ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 955, __pyx_L3_error) - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":954 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":954 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -13753,7 +13823,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":956 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":956 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -13768,7 +13838,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":957 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":957 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -13784,7 +13854,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":954 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":954 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -13799,7 +13869,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":953 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":953 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -13822,7 +13892,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":967 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":967 * * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< @@ -13835,7 +13905,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_timedelta64_object", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":979 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":979 * bool * """ * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< @@ -13845,7 +13915,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":967 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":967 * * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< @@ -13859,7 +13929,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":982 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":982 * * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< @@ -13872,7 +13942,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_datetime64_object", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":994 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":994 * bool * """ * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< @@ -13882,7 +13952,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":982 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":982 * * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< @@ -13896,7 +13966,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":997 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":997 * * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -13907,7 +13977,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) { npy_datetime __pyx_r; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1004 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":1004 * also needed. That can be found using `get_datetime64_unit`. * """ * return (obj).obval # <<<<<<<<<<<<<< @@ -13917,7 +13987,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":997 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":997 * * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -13930,7 +14000,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1007 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":1007 * * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -13941,7 +14011,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) { npy_timedelta __pyx_r; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1011 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":1011 * returns the int64 value underlying scalar numpy timedelta64 object * """ * return (obj).obval # <<<<<<<<<<<<<< @@ -13951,7 +14021,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1007 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":1007 * * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -13964,7 +14034,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1014 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":1014 * * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< @@ -13975,7 +14045,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) { NPY_DATETIMEUNIT __pyx_r; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1018 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":1018 * returns the unit part of the dtype for a numpy datetime64 object. * """ * return (obj).obmeta.base # <<<<<<<<<<<<<< @@ -13983,7 +14053,7 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base); goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1014 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":1014 * * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< @@ -14346,7 +14416,7 @@ static std::vector > > __pyx_convert_vector_from_ return __pyx_r; } -/* "View.MemoryView":122 +/* "View.MemoryView":123 * cdef bint dtype_is_object * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< @@ -14398,13 +14468,13 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 122, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 123, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 122, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 123, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: @@ -14420,7 +14490,7 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 122, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 123, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -14436,14 +14506,14 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P } } __pyx_v_shape = ((PyObject*)values[0]); - __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 122, __pyx_L3_error) + __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 123, __pyx_L3_error) __pyx_v_format = values[2]; __pyx_v_mode = values[3]; if (values[4]) { - __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 123, __pyx_L3_error) + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 124, __pyx_L3_error) } else { - /* "View.MemoryView":123 + /* "View.MemoryView":124 * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<< @@ -14455,19 +14525,19 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 122, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 123, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 122, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 123, __pyx_L1_error) if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 122, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 123, __pyx_L1_error) } __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer); - /* "View.MemoryView":122 + /* "View.MemoryView":123 * cdef bint dtype_is_object * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< @@ -14509,7 +14579,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __Pyx_RefNannySetupContext("__cinit__", 0); __Pyx_INCREF(__pyx_v_format); - /* "View.MemoryView":129 + /* "View.MemoryView":130 * cdef PyObject **p * * self.ndim = len(shape) # <<<<<<<<<<<<<< @@ -14518,12 +14588,12 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ if (unlikely(__pyx_v_shape == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(2, 129, __pyx_L1_error) + __PYX_ERR(2, 130, __pyx_L1_error) } - __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(2, 129, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(2, 130, __pyx_L1_error) __pyx_v_self->ndim = ((int)__pyx_t_1); - /* "View.MemoryView":130 + /* "View.MemoryView":131 * * self.ndim = len(shape) * self.itemsize = itemsize # <<<<<<<<<<<<<< @@ -14532,7 +14602,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ __pyx_v_self->itemsize = __pyx_v_itemsize; - /* "View.MemoryView":132 + /* "View.MemoryView":133 * self.itemsize = itemsize * * if not self.ndim: # <<<<<<<<<<<<<< @@ -14542,20 +14612,20 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0); if (unlikely(__pyx_t_2)) { - /* "View.MemoryView":133 + /* "View.MemoryView":134 * * if not self.ndim: * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< * * if itemsize <= 0: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 133, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 133, __pyx_L1_error) + __PYX_ERR(2, 134, __pyx_L1_error) - /* "View.MemoryView":132 + /* "View.MemoryView":133 * self.itemsize = itemsize * * if not self.ndim: # <<<<<<<<<<<<<< @@ -14564,7 +14634,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ } - /* "View.MemoryView":135 + /* "View.MemoryView":136 * raise ValueError("Empty shape tuple for cython.array") * * if itemsize <= 0: # <<<<<<<<<<<<<< @@ -14574,20 +14644,20 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0); if (unlikely(__pyx_t_2)) { - /* "View.MemoryView":136 + /* "View.MemoryView":137 * * if itemsize <= 0: * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< * * if not isinstance(format, bytes): */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 136, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 136, __pyx_L1_error) + __PYX_ERR(2, 137, __pyx_L1_error) - /* "View.MemoryView":135 + /* "View.MemoryView":136 * raise ValueError("Empty shape tuple for cython.array") * * if itemsize <= 0: # <<<<<<<<<<<<<< @@ -14596,7 +14666,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ } - /* "View.MemoryView":138 + /* "View.MemoryView":139 * raise ValueError("itemsize <= 0 for cython.array") * * if not isinstance(format, bytes): # <<<<<<<<<<<<<< @@ -14607,14 +14677,14 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_4) { - /* "View.MemoryView":139 + /* "View.MemoryView":140 * * if not isinstance(format, bytes): * format = format.encode('ASCII') # <<<<<<<<<<<<<< * self._format = format # keep a reference to the byte string * self.format = self._format */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 139, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { @@ -14628,13 +14698,13 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ } __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 139, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":138 + /* "View.MemoryView":139 * raise ValueError("itemsize <= 0 for cython.array") * * if not isinstance(format, bytes): # <<<<<<<<<<<<<< @@ -14643,14 +14713,14 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ } - /* "View.MemoryView":140 + /* "View.MemoryView":141 * if not isinstance(format, bytes): * format = format.encode('ASCII') * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<< * self.format = self._format * */ - if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(2, 140, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(2, 141, __pyx_L1_error) __pyx_t_3 = __pyx_v_format; __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); @@ -14659,7 +14729,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_v_self->_format = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":141 + /* "View.MemoryView":142 * format = format.encode('ASCII') * self._format = format # keep a reference to the byte string * self.format = self._format # <<<<<<<<<<<<<< @@ -14668,12 +14738,12 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ if (unlikely(__pyx_v_self->_format == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(2, 141, __pyx_L1_error) + __PYX_ERR(2, 142, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(2, 141, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(2, 142, __pyx_L1_error) __pyx_v_self->format = __pyx_t_7; - /* "View.MemoryView":144 + /* "View.MemoryView":145 * * * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<< @@ -14682,7 +14752,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2))); - /* "View.MemoryView":145 + /* "View.MemoryView":146 * * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<< @@ -14691,7 +14761,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim); - /* "View.MemoryView":147 + /* "View.MemoryView":148 * self._strides = self._shape + self.ndim * * if not self._shape: # <<<<<<<<<<<<<< @@ -14701,20 +14771,20 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0); if (unlikely(__pyx_t_4)) { - /* "View.MemoryView":148 + /* "View.MemoryView":149 * * if not self._shape: * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< * * */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 148, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 148, __pyx_L1_error) + __PYX_ERR(2, 149, __pyx_L1_error) - /* "View.MemoryView":147 + /* "View.MemoryView":148 * self._strides = self._shape + self.ndim * * if not self._shape: # <<<<<<<<<<<<<< @@ -14723,7 +14793,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ } - /* "View.MemoryView":151 + /* "View.MemoryView":152 * * * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< @@ -14735,18 +14805,18 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ for (;;) { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(2, 151, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(2, 152, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 151, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 151, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_dim = __pyx_t_9; __pyx_v_idx = __pyx_t_8; __pyx_t_8 = (__pyx_t_8 + 1); - /* "View.MemoryView":152 + /* "View.MemoryView":153 * * for idx, dim in enumerate(shape): * if dim <= 0: # <<<<<<<<<<<<<< @@ -14756,18 +14826,18 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_t_4 = ((__pyx_v_dim <= 0) != 0); if (unlikely(__pyx_t_4)) { - /* "View.MemoryView":153 + /* "View.MemoryView":154 * for idx, dim in enumerate(shape): * if dim <= 0: * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<< * self._shape[idx] = dim * */ - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 153, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 153, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 153, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); @@ -14775,17 +14845,17 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6); __pyx_t_5 = 0; __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 153, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 153, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __PYX_ERR(2, 153, __pyx_L1_error) + __PYX_ERR(2, 154, __pyx_L1_error) - /* "View.MemoryView":152 + /* "View.MemoryView":153 * * for idx, dim in enumerate(shape): * if dim <= 0: # <<<<<<<<<<<<<< @@ -14794,7 +14864,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ } - /* "View.MemoryView":154 + /* "View.MemoryView":155 * if dim <= 0: * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) * self._shape[idx] = dim # <<<<<<<<<<<<<< @@ -14803,7 +14873,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim; - /* "View.MemoryView":151 + /* "View.MemoryView":152 * * * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< @@ -14813,17 +14883,17 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":157 + /* "View.MemoryView":158 * * cdef char order * if mode == 'fortran': # <<<<<<<<<<<<<< * order = b'F' * self.mode = u'fortran' */ - __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 157, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 158, __pyx_L1_error) if (__pyx_t_4) { - /* "View.MemoryView":158 + /* "View.MemoryView":159 * cdef char order * if mode == 'fortran': * order = b'F' # <<<<<<<<<<<<<< @@ -14832,7 +14902,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ __pyx_v_order = 'F'; - /* "View.MemoryView":159 + /* "View.MemoryView":160 * if mode == 'fortran': * order = b'F' * self.mode = u'fortran' # <<<<<<<<<<<<<< @@ -14845,7 +14915,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __Pyx_DECREF(__pyx_v_self->mode); __pyx_v_self->mode = __pyx_n_u_fortran; - /* "View.MemoryView":157 + /* "View.MemoryView":158 * * cdef char order * if mode == 'fortran': # <<<<<<<<<<<<<< @@ -14855,17 +14925,17 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ goto __pyx_L10; } - /* "View.MemoryView":160 + /* "View.MemoryView":161 * order = b'F' * self.mode = u'fortran' * elif mode == 'c': # <<<<<<<<<<<<<< * order = b'C' * self.mode = u'c' */ - __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 160, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 161, __pyx_L1_error) if (likely(__pyx_t_4)) { - /* "View.MemoryView":161 + /* "View.MemoryView":162 * self.mode = u'fortran' * elif mode == 'c': * order = b'C' # <<<<<<<<<<<<<< @@ -14874,7 +14944,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ __pyx_v_order = 'C'; - /* "View.MemoryView":162 + /* "View.MemoryView":163 * elif mode == 'c': * order = b'C' * self.mode = u'c' # <<<<<<<<<<<<<< @@ -14887,7 +14957,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __Pyx_DECREF(__pyx_v_self->mode); __pyx_v_self->mode = __pyx_n_u_c; - /* "View.MemoryView":160 + /* "View.MemoryView":161 * order = b'F' * self.mode = u'fortran' * elif mode == 'c': # <<<<<<<<<<<<<< @@ -14897,7 +14967,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ goto __pyx_L10; } - /* "View.MemoryView":164 + /* "View.MemoryView":165 * self.mode = u'c' * else: * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<< @@ -14905,18 +14975,18 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * self.len = fill_contig_strides_array(self._shape, self._strides, */ /*else*/ { - __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 164, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 164, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __PYX_ERR(2, 164, __pyx_L1_error) + __PYX_ERR(2, 165, __pyx_L1_error) } __pyx_L10:; - /* "View.MemoryView":166 + /* "View.MemoryView":167 * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) * * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<< @@ -14925,7 +14995,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order); - /* "View.MemoryView":169 + /* "View.MemoryView":170 * itemsize, self.ndim, order) * * self.free_data = allocate_buffer # <<<<<<<<<<<<<< @@ -14934,19 +15004,19 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ __pyx_v_self->free_data = __pyx_v_allocate_buffer; - /* "View.MemoryView":170 + /* "View.MemoryView":171 * * self.free_data = allocate_buffer * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<< * if allocate_buffer: * */ - __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 170, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 170, __pyx_L1_error) + __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 171, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 171, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_self->dtype_is_object = __pyx_t_4; - /* "View.MemoryView":171 + /* "View.MemoryView":172 * self.free_data = allocate_buffer * self.dtype_is_object = format == b'O' * if allocate_buffer: # <<<<<<<<<<<<<< @@ -14956,7 +15026,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_t_4 = (__pyx_v_allocate_buffer != 0); if (__pyx_t_4) { - /* "View.MemoryView":174 + /* "View.MemoryView":175 * * * self.data = malloc(self.len) # <<<<<<<<<<<<<< @@ -14965,7 +15035,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len)); - /* "View.MemoryView":175 + /* "View.MemoryView":176 * * self.data = malloc(self.len) * if not self.data: # <<<<<<<<<<<<<< @@ -14975,20 +15045,20 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0); if (unlikely(__pyx_t_4)) { - /* "View.MemoryView":176 + /* "View.MemoryView":177 * self.data = malloc(self.len) * if not self.data: * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< * * if self.dtype_is_object: */ - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 176, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __PYX_ERR(2, 176, __pyx_L1_error) + __PYX_ERR(2, 177, __pyx_L1_error) - /* "View.MemoryView":175 + /* "View.MemoryView":176 * * self.data = malloc(self.len) * if not self.data: # <<<<<<<<<<<<<< @@ -14997,7 +15067,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ } - /* "View.MemoryView":178 + /* "View.MemoryView":179 * raise MemoryError("unable to allocate array data.") * * if self.dtype_is_object: # <<<<<<<<<<<<<< @@ -15007,7 +15077,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0); if (__pyx_t_4) { - /* "View.MemoryView":179 + /* "View.MemoryView":180 * * if self.dtype_is_object: * p = self.data # <<<<<<<<<<<<<< @@ -15016,7 +15086,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ __pyx_v_p = ((PyObject **)__pyx_v_self->data); - /* "View.MemoryView":180 + /* "View.MemoryView":181 * if self.dtype_is_object: * p = self.data * for i in range(self.len / itemsize): # <<<<<<<<<<<<<< @@ -15025,18 +15095,18 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(2, 180, __pyx_L1_error) + __PYX_ERR(2, 181, __pyx_L1_error) } else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) { PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); - __PYX_ERR(2, 180, __pyx_L1_error) + __PYX_ERR(2, 181, __pyx_L1_error) } __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); __pyx_t_9 = __pyx_t_1; for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; - /* "View.MemoryView":181 + /* "View.MemoryView":182 * p = self.data * for i in range(self.len / itemsize): * p[i] = Py_None # <<<<<<<<<<<<<< @@ -15045,7 +15115,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ (__pyx_v_p[__pyx_v_i]) = Py_None; - /* "View.MemoryView":182 + /* "View.MemoryView":183 * for i in range(self.len / itemsize): * p[i] = Py_None * Py_INCREF(Py_None) # <<<<<<<<<<<<<< @@ -15055,7 +15125,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ Py_INCREF(Py_None); } - /* "View.MemoryView":178 + /* "View.MemoryView":179 * raise MemoryError("unable to allocate array data.") * * if self.dtype_is_object: # <<<<<<<<<<<<<< @@ -15064,7 +15134,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ } - /* "View.MemoryView":171 + /* "View.MemoryView":172 * self.free_data = allocate_buffer * self.dtype_is_object = format == b'O' * if allocate_buffer: # <<<<<<<<<<<<<< @@ -15073,7 +15143,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ } - /* "View.MemoryView":122 + /* "View.MemoryView":123 * cdef bint dtype_is_object * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< @@ -15097,7 +15167,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ return __pyx_r; } -/* "View.MemoryView":185 +/* "View.MemoryView":186 * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< @@ -15140,7 +15210,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); - /* "View.MemoryView":186 + /* "View.MemoryView":187 * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): * cdef int bufmode = -1 # <<<<<<<<<<<<<< @@ -15149,18 +15219,18 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru */ __pyx_v_bufmode = -1; - /* "View.MemoryView":187 + /* "View.MemoryView":188 * def __getbuffer__(self, Py_buffer *info, int flags): * cdef int bufmode = -1 * if self.mode == u"c": # <<<<<<<<<<<<<< * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * elif self.mode == u"fortran": */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 187, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 188, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":188 + /* "View.MemoryView":189 * cdef int bufmode = -1 * if self.mode == u"c": * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<< @@ -15169,7 +15239,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru */ __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); - /* "View.MemoryView":187 + /* "View.MemoryView":188 * def __getbuffer__(self, Py_buffer *info, int flags): * cdef int bufmode = -1 * if self.mode == u"c": # <<<<<<<<<<<<<< @@ -15179,18 +15249,18 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru goto __pyx_L3; } - /* "View.MemoryView":189 + /* "View.MemoryView":190 * if self.mode == u"c": * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * elif self.mode == u"fortran": # <<<<<<<<<<<<<< * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * if not (flags & bufmode): */ - __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 189, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 190, __pyx_L1_error) __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "View.MemoryView":190 + /* "View.MemoryView":191 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * elif self.mode == u"fortran": * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<< @@ -15199,7 +15269,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru */ __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); - /* "View.MemoryView":189 + /* "View.MemoryView":190 * if self.mode == u"c": * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * elif self.mode == u"fortran": # <<<<<<<<<<<<<< @@ -15209,7 +15279,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru } __pyx_L3:; - /* "View.MemoryView":191 + /* "View.MemoryView":192 * elif self.mode == u"fortran": * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * if not (flags & bufmode): # <<<<<<<<<<<<<< @@ -15219,20 +15289,20 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0); if (unlikely(__pyx_t_1)) { - /* "View.MemoryView":192 + /* "View.MemoryView":193 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * if not (flags & bufmode): * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< * info.buf = self.data * info.len = self.len */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 192, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 192, __pyx_L1_error) + __PYX_ERR(2, 193, __pyx_L1_error) - /* "View.MemoryView":191 + /* "View.MemoryView":192 * elif self.mode == u"fortran": * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * if not (flags & bufmode): # <<<<<<<<<<<<<< @@ -15241,7 +15311,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru */ } - /* "View.MemoryView":193 + /* "View.MemoryView":194 * if not (flags & bufmode): * raise ValueError("Can only create a buffer that is contiguous in memory.") * info.buf = self.data # <<<<<<<<<<<<<< @@ -15251,7 +15321,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_t_4 = __pyx_v_self->data; __pyx_v_info->buf = __pyx_t_4; - /* "View.MemoryView":194 + /* "View.MemoryView":195 * raise ValueError("Can only create a buffer that is contiguous in memory.") * info.buf = self.data * info.len = self.len # <<<<<<<<<<<<<< @@ -15261,7 +15331,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_t_5 = __pyx_v_self->len; __pyx_v_info->len = __pyx_t_5; - /* "View.MemoryView":195 + /* "View.MemoryView":196 * info.buf = self.data * info.len = self.len * info.ndim = self.ndim # <<<<<<<<<<<<<< @@ -15271,7 +15341,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_t_6 = __pyx_v_self->ndim; __pyx_v_info->ndim = __pyx_t_6; - /* "View.MemoryView":196 + /* "View.MemoryView":197 * info.len = self.len * info.ndim = self.ndim * info.shape = self._shape # <<<<<<<<<<<<<< @@ -15281,7 +15351,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_t_7 = __pyx_v_self->_shape; __pyx_v_info->shape = __pyx_t_7; - /* "View.MemoryView":197 + /* "View.MemoryView":198 * info.ndim = self.ndim * info.shape = self._shape * info.strides = self._strides # <<<<<<<<<<<<<< @@ -15291,7 +15361,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_t_7 = __pyx_v_self->_strides; __pyx_v_info->strides = __pyx_t_7; - /* "View.MemoryView":198 + /* "View.MemoryView":199 * info.shape = self._shape * info.strides = self._strides * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -15300,7 +15370,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru */ __pyx_v_info->suboffsets = NULL; - /* "View.MemoryView":199 + /* "View.MemoryView":200 * info.strides = self._strides * info.suboffsets = NULL * info.itemsize = self.itemsize # <<<<<<<<<<<<<< @@ -15310,7 +15380,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_t_5 = __pyx_v_self->itemsize; __pyx_v_info->itemsize = __pyx_t_5; - /* "View.MemoryView":200 + /* "View.MemoryView":201 * info.suboffsets = NULL * info.itemsize = self.itemsize * info.readonly = 0 # <<<<<<<<<<<<<< @@ -15319,7 +15389,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru */ __pyx_v_info->readonly = 0; - /* "View.MemoryView":202 + /* "View.MemoryView":203 * info.readonly = 0 * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< @@ -15329,7 +15399,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); if (__pyx_t_1) { - /* "View.MemoryView":203 + /* "View.MemoryView":204 * * if flags & PyBUF_FORMAT: * info.format = self.format # <<<<<<<<<<<<<< @@ -15339,7 +15409,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_t_4 = __pyx_v_self->format; __pyx_v_info->format = __pyx_t_4; - /* "View.MemoryView":202 + /* "View.MemoryView":203 * info.readonly = 0 * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< @@ -15349,7 +15419,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru goto __pyx_L5; } - /* "View.MemoryView":205 + /* "View.MemoryView":206 * info.format = self.format * else: * info.format = NULL # <<<<<<<<<<<<<< @@ -15361,7 +15431,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru } __pyx_L5:; - /* "View.MemoryView":207 + /* "View.MemoryView":208 * info.format = NULL * * info.obj = self # <<<<<<<<<<<<<< @@ -15374,7 +15444,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - /* "View.MemoryView":185 + /* "View.MemoryView":186 * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< @@ -15404,7 +15474,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru return __pyx_r; } -/* "View.MemoryView":211 +/* "View.MemoryView":212 * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") * * def __dealloc__(array self): # <<<<<<<<<<<<<< @@ -15428,7 +15498,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc int __pyx_t_1; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "View.MemoryView":212 + /* "View.MemoryView":213 * * def __dealloc__(array self): * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< @@ -15438,7 +15508,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0); if (__pyx_t_1) { - /* "View.MemoryView":213 + /* "View.MemoryView":214 * def __dealloc__(array self): * if self.callback_free_data != NULL: * self.callback_free_data(self.data) # <<<<<<<<<<<<<< @@ -15447,7 +15517,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc */ __pyx_v_self->callback_free_data(__pyx_v_self->data); - /* "View.MemoryView":212 + /* "View.MemoryView":213 * * def __dealloc__(array self): * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< @@ -15457,7 +15527,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc goto __pyx_L3; } - /* "View.MemoryView":214 + /* "View.MemoryView":215 * if self.callback_free_data != NULL: * self.callback_free_data(self.data) * elif self.free_data: # <<<<<<<<<<<<<< @@ -15467,7 +15537,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc __pyx_t_1 = (__pyx_v_self->free_data != 0); if (__pyx_t_1) { - /* "View.MemoryView":215 + /* "View.MemoryView":216 * self.callback_free_data(self.data) * elif self.free_data: * if self.dtype_is_object: # <<<<<<<<<<<<<< @@ -15477,7 +15547,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); if (__pyx_t_1) { - /* "View.MemoryView":216 + /* "View.MemoryView":217 * elif self.free_data: * if self.dtype_is_object: * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<< @@ -15486,7 +15556,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc */ __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0); - /* "View.MemoryView":215 + /* "View.MemoryView":216 * self.callback_free_data(self.data) * elif self.free_data: * if self.dtype_is_object: # <<<<<<<<<<<<<< @@ -15495,7 +15565,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc */ } - /* "View.MemoryView":218 + /* "View.MemoryView":219 * refcount_objects_in_slice(self.data, self._shape, * self._strides, self.ndim, False) * free(self.data) # <<<<<<<<<<<<<< @@ -15504,7 +15574,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc */ free(__pyx_v_self->data); - /* "View.MemoryView":214 + /* "View.MemoryView":215 * if self.callback_free_data != NULL: * self.callback_free_data(self.data) * elif self.free_data: # <<<<<<<<<<<<<< @@ -15514,7 +15584,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc } __pyx_L3:; - /* "View.MemoryView":219 + /* "View.MemoryView":220 * self._strides, self.ndim, False) * free(self.data) * PyObject_Free(self._shape) # <<<<<<<<<<<<<< @@ -15523,7 +15593,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc */ PyObject_Free(__pyx_v_self->_shape); - /* "View.MemoryView":211 + /* "View.MemoryView":212 * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") * * def __dealloc__(array self): # <<<<<<<<<<<<<< @@ -15535,7 +15605,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc __Pyx_RefNannyFinishContext(); } -/* "View.MemoryView":222 +/* "View.MemoryView":223 * * @property * def memview(self): # <<<<<<<<<<<<<< @@ -15565,7 +15635,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct _ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":223 + /* "View.MemoryView":224 * @property * def memview(self): * return self.get_memview() # <<<<<<<<<<<<<< @@ -15573,13 +15643,13 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct _ * @cname('get_memview') */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 223, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "View.MemoryView":222 + /* "View.MemoryView":223 * * @property * def memview(self): # <<<<<<<<<<<<<< @@ -15598,7 +15668,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct _ return __pyx_r; } -/* "View.MemoryView":226 +/* "View.MemoryView":227 * * @cname('get_memview') * cdef get_memview(self): # <<<<<<<<<<<<<< @@ -15618,7 +15688,7 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_memview", 0); - /* "View.MemoryView":227 + /* "View.MemoryView":228 * @cname('get_memview') * cdef get_memview(self): * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<< @@ -15627,7 +15697,7 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { */ __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE); - /* "View.MemoryView":228 + /* "View.MemoryView":229 * cdef get_memview(self): * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<< @@ -15635,11 +15705,11 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { * def __len__(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 228, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 228, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 228, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); @@ -15650,14 +15720,14 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 228, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":226 + /* "View.MemoryView":227 * * @cname('get_memview') * cdef get_memview(self): # <<<<<<<<<<<<<< @@ -15678,7 +15748,7 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { return __pyx_r; } -/* "View.MemoryView":230 +/* "View.MemoryView":231 * return memoryview(self, flags, self.dtype_is_object) * * def __len__(self): # <<<<<<<<<<<<<< @@ -15704,7 +15774,7 @@ static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(str __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); - /* "View.MemoryView":231 + /* "View.MemoryView":232 * * def __len__(self): * return self._shape[0] # <<<<<<<<<<<<<< @@ -15714,7 +15784,7 @@ static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(str __pyx_r = (__pyx_v_self->_shape[0]); goto __pyx_L0; - /* "View.MemoryView":230 + /* "View.MemoryView":231 * return memoryview(self, flags, self.dtype_is_object) * * def __len__(self): # <<<<<<<<<<<<<< @@ -15728,7 +15798,7 @@ static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(str return __pyx_r; } -/* "View.MemoryView":233 +/* "View.MemoryView":234 * return self._shape[0] * * def __getattr__(self, attr): # <<<<<<<<<<<<<< @@ -15759,7 +15829,7 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getattr__", 0); - /* "View.MemoryView":234 + /* "View.MemoryView":235 * * def __getattr__(self, attr): * return getattr(self.memview, attr) # <<<<<<<<<<<<<< @@ -15767,16 +15837,16 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__( * def __getitem__(self, item): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 234, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 234, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":233 + /* "View.MemoryView":234 * return self._shape[0] * * def __getattr__(self, attr): # <<<<<<<<<<<<<< @@ -15796,7 +15866,7 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__( return __pyx_r; } -/* "View.MemoryView":236 +/* "View.MemoryView":237 * return getattr(self.memview, attr) * * def __getitem__(self, item): # <<<<<<<<<<<<<< @@ -15827,7 +15897,7 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); - /* "View.MemoryView":237 + /* "View.MemoryView":238 * * def __getitem__(self, item): * return self.memview[item] # <<<<<<<<<<<<<< @@ -15835,16 +15905,16 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__ * def __setitem__(self, item, value): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 237, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 237, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":236 + /* "View.MemoryView":237 * return getattr(self.memview, attr) * * def __getitem__(self, item): # <<<<<<<<<<<<<< @@ -15864,7 +15934,7 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__ return __pyx_r; } -/* "View.MemoryView":239 +/* "View.MemoryView":240 * return self.memview[item] * * def __setitem__(self, item, value): # <<<<<<<<<<<<<< @@ -15894,19 +15964,19 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 0); - /* "View.MemoryView":240 + /* "View.MemoryView":241 * * def __setitem__(self, item, value): * self.memview[item] = value # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 240, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 240, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 241, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":239 + /* "View.MemoryView":240 * return self.memview[item] * * def __setitem__(self, item, value): # <<<<<<<<<<<<<< @@ -16039,7 +16109,7 @@ static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct return __pyx_r; } -/* "View.MemoryView":244 +/* "View.MemoryView":245 * * @cname("__pyx_array_new") * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< @@ -16061,7 +16131,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize int __pyx_clineno = 0; __Pyx_RefNannySetupContext("array_cwrapper", 0); - /* "View.MemoryView":248 + /* "View.MemoryView":249 * cdef array result * * if buf == NULL: # <<<<<<<<<<<<<< @@ -16071,20 +16141,20 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize __pyx_t_1 = ((__pyx_v_buf == NULL) != 0); if (__pyx_t_1) { - /* "View.MemoryView":249 + /* "View.MemoryView":250 * * if buf == NULL: * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<< * else: * result = array(shape, itemsize, format, mode.decode('ASCII'), */ - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 249, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 249, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 249, __pyx_L1_error) + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 249, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); @@ -16098,13 +16168,13 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 249, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); __pyx_t_4 = 0; - /* "View.MemoryView":248 + /* "View.MemoryView":249 * cdef array result * * if buf == NULL: # <<<<<<<<<<<<<< @@ -16114,7 +16184,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize goto __pyx_L3; } - /* "View.MemoryView":251 + /* "View.MemoryView":252 * result = array(shape, itemsize, format, mode.decode('ASCII')) * else: * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< @@ -16122,13 +16192,13 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize * result.data = buf */ /*else*/ { - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 251, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 251, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 251, __pyx_L1_error) + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 251, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); @@ -16143,32 +16213,32 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize __pyx_t_5 = 0; __pyx_t_3 = 0; - /* "View.MemoryView":252 + /* "View.MemoryView":253 * else: * result = array(shape, itemsize, format, mode.decode('ASCII'), * allocate_buffer=False) # <<<<<<<<<<<<<< * result.data = buf * */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 252, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 252, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 253, __pyx_L1_error) - /* "View.MemoryView":251 + /* "View.MemoryView":252 * result = array(shape, itemsize, format, mode.decode('ASCII')) * else: * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< * allocate_buffer=False) * result.data = buf */ - __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 251, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5); __pyx_t_5 = 0; - /* "View.MemoryView":253 + /* "View.MemoryView":254 * result = array(shape, itemsize, format, mode.decode('ASCII'), * allocate_buffer=False) * result.data = buf # <<<<<<<<<<<<<< @@ -16179,7 +16249,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize } __pyx_L3:; - /* "View.MemoryView":255 + /* "View.MemoryView":256 * result.data = buf * * return result # <<<<<<<<<<<<<< @@ -16191,7 +16261,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize __pyx_r = __pyx_v_result; goto __pyx_L0; - /* "View.MemoryView":244 + /* "View.MemoryView":245 * * @cname("__pyx_array_new") * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< @@ -16214,7 +16284,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize return __pyx_r; } -/* "View.MemoryView":281 +/* "View.MemoryView":282 * cdef class Enum(object): * cdef object name * def __init__(self, name): # <<<<<<<<<<<<<< @@ -16251,7 +16321,7 @@ static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_ar else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 281, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 282, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -16262,7 +16332,7 @@ static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_ar } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 281, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 282, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -16280,7 +16350,7 @@ static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struc __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); - /* "View.MemoryView":282 + /* "View.MemoryView":283 * cdef object name * def __init__(self, name): * self.name = name # <<<<<<<<<<<<<< @@ -16293,7 +16363,7 @@ static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struc __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = __pyx_v_name; - /* "View.MemoryView":281 + /* "View.MemoryView":282 * cdef class Enum(object): * cdef object name * def __init__(self, name): # <<<<<<<<<<<<<< @@ -16307,7 +16377,7 @@ static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struc return __pyx_r; } -/* "View.MemoryView":283 +/* "View.MemoryView":284 * def __init__(self, name): * self.name = name * def __repr__(self): # <<<<<<<<<<<<<< @@ -16333,7 +16403,7 @@ static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__", 0); - /* "View.MemoryView":284 + /* "View.MemoryView":285 * self.name = name * def __repr__(self): * return self.name # <<<<<<<<<<<<<< @@ -16345,7 +16415,7 @@ static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr_ __pyx_r = __pyx_v_self->name; goto __pyx_L0; - /* "View.MemoryView":283 + /* "View.MemoryView":284 * def __init__(self, name): * self.name = name * def __repr__(self): # <<<<<<<<<<<<<< @@ -16653,7 +16723,7 @@ static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_Me return __pyx_r; } -/* "View.MemoryView":298 +/* "View.MemoryView":299 * * @cname('__pyx_align_pointer') * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< @@ -16667,7 +16737,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) void *__pyx_r; int __pyx_t_1; - /* "View.MemoryView":300 + /* "View.MemoryView":301 * cdef void *align_pointer(void *memory, size_t alignment) nogil: * "Align pointer memory on a given boundary" * cdef Py_intptr_t aligned_p = memory # <<<<<<<<<<<<<< @@ -16676,7 +16746,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) */ __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory); - /* "View.MemoryView":304 + /* "View.MemoryView":305 * * with cython.cdivision(True): * offset = aligned_p % alignment # <<<<<<<<<<<<<< @@ -16685,7 +16755,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) */ __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); - /* "View.MemoryView":306 + /* "View.MemoryView":307 * offset = aligned_p % alignment * * if offset > 0: # <<<<<<<<<<<<<< @@ -16695,7 +16765,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) __pyx_t_1 = ((__pyx_v_offset > 0) != 0); if (__pyx_t_1) { - /* "View.MemoryView":307 + /* "View.MemoryView":308 * * if offset > 0: * aligned_p += alignment - offset # <<<<<<<<<<<<<< @@ -16704,7 +16774,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) */ __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset)); - /* "View.MemoryView":306 + /* "View.MemoryView":307 * offset = aligned_p % alignment * * if offset > 0: # <<<<<<<<<<<<<< @@ -16713,7 +16783,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) */ } - /* "View.MemoryView":309 + /* "View.MemoryView":310 * aligned_p += alignment - offset * * return aligned_p # <<<<<<<<<<<<<< @@ -16723,7 +16793,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) __pyx_r = ((void *)__pyx_v_aligned_p); goto __pyx_L0; - /* "View.MemoryView":298 + /* "View.MemoryView":299 * * @cname('__pyx_align_pointer') * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< @@ -16736,7 +16806,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) return __pyx_r; } -/* "View.MemoryView":345 +/* "View.MemoryView":346 * cdef __Pyx_TypeInfo *typeinfo * * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< @@ -16781,7 +16851,7 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 345, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 346, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -16791,7 +16861,7 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 345, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 346, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -16804,16 +16874,16 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar } } __pyx_v_obj = values[0]; - __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 345, __pyx_L3_error) + __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 346, __pyx_L3_error) if (values[2]) { - __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 345, __pyx_L3_error) + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 346, __pyx_L3_error) } else { __pyx_v_dtype_is_object = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 345, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 346, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -16838,7 +16908,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "View.MemoryView":346 + /* "View.MemoryView":347 * * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): * self.obj = obj # <<<<<<<<<<<<<< @@ -16851,7 +16921,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ __Pyx_DECREF(__pyx_v_self->obj); __pyx_v_self->obj = __pyx_v_obj; - /* "View.MemoryView":347 + /* "View.MemoryView":348 * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): * self.obj = obj * self.flags = flags # <<<<<<<<<<<<<< @@ -16860,7 +16930,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ */ __pyx_v_self->flags = __pyx_v_flags; - /* "View.MemoryView":348 + /* "View.MemoryView":349 * self.obj = obj * self.flags = flags * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< @@ -16880,16 +16950,16 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ __pyx_L4_bool_binop_done:; if (__pyx_t_1) { - /* "View.MemoryView":349 + /* "View.MemoryView":350 * self.flags = flags * if type(self) is memoryview or obj is not None: * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<< * if self.view.obj == NULL: * (<__pyx_buffer *> &self.view).obj = Py_None */ - __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 349, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 350, __pyx_L1_error) - /* "View.MemoryView":350 + /* "View.MemoryView":351 * if type(self) is memoryview or obj is not None: * __Pyx_GetBuffer(obj, &self.view, flags) * if self.view.obj == NULL: # <<<<<<<<<<<<<< @@ -16899,7 +16969,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0); if (__pyx_t_1) { - /* "View.MemoryView":351 + /* "View.MemoryView":352 * __Pyx_GetBuffer(obj, &self.view, flags) * if self.view.obj == NULL: * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<< @@ -16908,16 +16978,16 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ */ ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None; - /* "View.MemoryView":352 + /* "View.MemoryView":353 * if self.view.obj == NULL: * (<__pyx_buffer *> &self.view).obj = Py_None * Py_INCREF(Py_None) # <<<<<<<<<<<<<< * - * global __pyx_memoryview_thread_locks_used + * if not __PYX_CYTHON_ATOMICS_ENABLED(): */ Py_INCREF(Py_None); - /* "View.MemoryView":350 + /* "View.MemoryView":351 * if type(self) is memoryview or obj is not None: * __Pyx_GetBuffer(obj, &self.view, flags) * if self.view.obj == NULL: # <<<<<<<<<<<<<< @@ -16926,7 +16996,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ */ } - /* "View.MemoryView":348 + /* "View.MemoryView":349 * self.obj = obj * self.flags = flags * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< @@ -16936,100 +17006,119 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ } /* "View.MemoryView":355 + * Py_INCREF(Py_None) * - * global __pyx_memoryview_thread_locks_used - * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] - * __pyx_memoryview_thread_locks_used += 1 + * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<< + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: */ - __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0); + __pyx_t_1 = ((!(__PYX_CYTHON_ATOMICS_ENABLED() != 0)) != 0); if (__pyx_t_1) { - /* "View.MemoryView":356 - * global __pyx_memoryview_thread_locks_used - * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<< - * __pyx_memoryview_thread_locks_used += 1 - * if self.lock is NULL: - */ - __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); - /* "View.MemoryView":357 - * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] - * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<< - * if self.lock is NULL: - * self.lock = PyThread_allocate_lock() + * if not __PYX_CYTHON_ATOMICS_ENABLED(): + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 */ - __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1); + __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":355 - * - * global __pyx_memoryview_thread_locks_used - * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] - * __pyx_memoryview_thread_locks_used += 1 + /* "View.MemoryView":358 + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: */ - } + __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); - /* "View.MemoryView":358 - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] - * __pyx_memoryview_thread_locks_used += 1 - * if self.lock is NULL: # <<<<<<<<<<<<<< - * self.lock = PyThread_allocate_lock() + /* "View.MemoryView":359 + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<< * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() */ - __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); - if (__pyx_t_1) { + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1); - /* "View.MemoryView":359 - * __pyx_memoryview_thread_locks_used += 1 - * if self.lock is NULL: - * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<< - * if self.lock is NULL: - * raise MemoryError + /* "View.MemoryView":357 + * if not __PYX_CYTHON_ATOMICS_ENABLED(): + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 */ - __pyx_v_self->lock = PyThread_allocate_lock(); + } /* "View.MemoryView":360 - * if self.lock is NULL: - * self.lock = PyThread_allocate_lock() + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 * if self.lock is NULL: # <<<<<<<<<<<<<< - * raise MemoryError - * + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: */ __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); - if (unlikely(__pyx_t_1)) { + if (__pyx_t_1) { /* "View.MemoryView":361 - * self.lock = PyThread_allocate_lock() + * __pyx_memoryview_thread_locks_used += 1 * if self.lock is NULL: - * raise MemoryError # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<< + * if self.lock is NULL: + * raise MemoryError + */ + __pyx_v_self->lock = PyThread_allocate_lock(); + + /* "View.MemoryView":362 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":363 + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + * raise MemoryError # <<<<<<<<<<<<<< * * if flags & PyBUF_FORMAT: */ - PyErr_NoMemory(); __PYX_ERR(2, 361, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(2, 363, __pyx_L1_error) + + /* "View.MemoryView":362 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + } /* "View.MemoryView":360 - * if self.lock is NULL: - * self.lock = PyThread_allocate_lock() + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 * if self.lock is NULL: # <<<<<<<<<<<<<< - * raise MemoryError - * + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: */ } - /* "View.MemoryView":358 - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] - * __pyx_memoryview_thread_locks_used += 1 - * if self.lock is NULL: # <<<<<<<<<<<<<< - * self.lock = PyThread_allocate_lock() - * if self.lock is NULL: + /* "View.MemoryView":355 + * Py_INCREF(Py_None) + * + * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<< + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: */ } - /* "View.MemoryView":363 - * raise MemoryError + /* "View.MemoryView":365 + * raise MemoryError * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') @@ -17038,7 +17127,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); if (__pyx_t_1) { - /* "View.MemoryView":364 + /* "View.MemoryView":366 * * if flags & PyBUF_FORMAT: * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<< @@ -17049,24 +17138,24 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; - goto __pyx_L11_bool_binop_done; + goto __pyx_L12_bool_binop_done; } __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0); __pyx_t_1 = __pyx_t_2; - __pyx_L11_bool_binop_done:; + __pyx_L12_bool_binop_done:; __pyx_v_self->dtype_is_object = __pyx_t_1; - /* "View.MemoryView":363 - * raise MemoryError + /* "View.MemoryView":365 + * raise MemoryError * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') * else: */ - goto __pyx_L10; + goto __pyx_L11; } - /* "View.MemoryView":366 + /* "View.MemoryView":368 * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') * else: * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<< @@ -17076,9 +17165,9 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ /*else*/ { __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object; } - __pyx_L10:; + __pyx_L11:; - /* "View.MemoryView":368 + /* "View.MemoryView":370 * self.dtype_is_object = dtype_is_object * * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<< @@ -17087,7 +17176,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ */ __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int)))); - /* "View.MemoryView":370 + /* "View.MemoryView":372 * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) * self.typeinfo = NULL # <<<<<<<<<<<<<< @@ -17096,7 +17185,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ */ __pyx_v_self->typeinfo = NULL; - /* "View.MemoryView":345 + /* "View.MemoryView":346 * cdef __Pyx_TypeInfo *typeinfo * * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< @@ -17115,7 +17204,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ return __pyx_r; } -/* "View.MemoryView":372 +/* "View.MemoryView":374 * self.typeinfo = NULL * * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< @@ -17146,7 +17235,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal PyThread_type_lock __pyx_t_7; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "View.MemoryView":373 + /* "View.MemoryView":375 * * def __dealloc__(memoryview self): * if self.obj is not None: # <<<<<<<<<<<<<< @@ -17157,7 +17246,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":374 + /* "View.MemoryView":376 * def __dealloc__(memoryview self): * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<< @@ -17166,7 +17255,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal */ __Pyx_ReleaseBuffer((&__pyx_v_self->view)); - /* "View.MemoryView":373 + /* "View.MemoryView":375 * * def __dealloc__(memoryview self): * if self.obj is not None: # <<<<<<<<<<<<<< @@ -17176,7 +17265,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal goto __pyx_L3; } - /* "View.MemoryView":375 + /* "View.MemoryView":377 * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<< @@ -17186,7 +17275,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0); if (__pyx_t_2) { - /* "View.MemoryView":377 + /* "View.MemoryView":379 * elif (<__pyx_buffer *> &self.view).obj == Py_None: * * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<< @@ -17195,7 +17284,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal */ ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL; - /* "View.MemoryView":378 + /* "View.MemoryView":380 * * (<__pyx_buffer *> &self.view).obj = NULL * Py_DECREF(Py_None) # <<<<<<<<<<<<<< @@ -17204,7 +17293,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal */ Py_DECREF(Py_None); - /* "View.MemoryView":375 + /* "View.MemoryView":377 * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<< @@ -17214,7 +17303,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal } __pyx_L3:; - /* "View.MemoryView":382 + /* "View.MemoryView":384 * cdef int i * global __pyx_memoryview_thread_locks_used * if self.lock != NULL: # <<<<<<<<<<<<<< @@ -17224,7 +17313,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0); if (__pyx_t_2) { - /* "View.MemoryView":383 + /* "View.MemoryView":385 * global __pyx_memoryview_thread_locks_used * if self.lock != NULL: * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<< @@ -17236,7 +17325,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; - /* "View.MemoryView":384 + /* "View.MemoryView":386 * if self.lock != NULL: * for i in range(__pyx_memoryview_thread_locks_used): * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< @@ -17246,7 +17335,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0); if (__pyx_t_2) { - /* "View.MemoryView":385 + /* "View.MemoryView":387 * for i in range(__pyx_memoryview_thread_locks_used): * if __pyx_memoryview_thread_locks[i] is self.lock: * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<< @@ -17255,7 +17344,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal */ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1); - /* "View.MemoryView":386 + /* "View.MemoryView":388 * if __pyx_memoryview_thread_locks[i] is self.lock: * __pyx_memoryview_thread_locks_used -= 1 * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< @@ -17265,7 +17354,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0); if (__pyx_t_2) { - /* "View.MemoryView":388 + /* "View.MemoryView":390 * if i != __pyx_memoryview_thread_locks_used: * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<< @@ -17275,7 +17364,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]); - /* "View.MemoryView":387 + /* "View.MemoryView":389 * __pyx_memoryview_thread_locks_used -= 1 * if i != __pyx_memoryview_thread_locks_used: * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<< @@ -17285,7 +17374,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6; (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7; - /* "View.MemoryView":386 + /* "View.MemoryView":388 * if __pyx_memoryview_thread_locks[i] is self.lock: * __pyx_memoryview_thread_locks_used -= 1 * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< @@ -17294,7 +17383,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal */ } - /* "View.MemoryView":389 + /* "View.MemoryView":391 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) * break # <<<<<<<<<<<<<< @@ -17303,7 +17392,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal */ goto __pyx_L6_break; - /* "View.MemoryView":384 + /* "View.MemoryView":386 * if self.lock != NULL: * for i in range(__pyx_memoryview_thread_locks_used): * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< @@ -17314,7 +17403,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal } /*else*/ { - /* "View.MemoryView":391 + /* "View.MemoryView":393 * break * else: * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<< @@ -17325,7 +17414,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal } __pyx_L6_break:; - /* "View.MemoryView":382 + /* "View.MemoryView":384 * cdef int i * global __pyx_memoryview_thread_locks_used * if self.lock != NULL: # <<<<<<<<<<<<<< @@ -17334,7 +17423,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal */ } - /* "View.MemoryView":372 + /* "View.MemoryView":374 * self.typeinfo = NULL * * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< @@ -17346,7 +17435,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal __Pyx_RefNannyFinishContext(); } -/* "View.MemoryView":393 +/* "View.MemoryView":395 * PyThread_free_lock(self.lock) * * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< @@ -17372,7 +17461,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_item_pointer", 0); - /* "View.MemoryView":395 + /* "View.MemoryView":397 * cdef char *get_item_pointer(memoryview self, object index) except NULL: * cdef Py_ssize_t dim * cdef char *itemp = self.view.buf # <<<<<<<<<<<<<< @@ -17381,7 +17470,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py */ __pyx_v_itemp = ((char *)__pyx_v_self->view.buf); - /* "View.MemoryView":397 + /* "View.MemoryView":399 * cdef char *itemp = self.view.buf * * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< @@ -17393,26 +17482,26 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 397, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 397, __pyx_L1_error) + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 399, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 397, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 399, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 397, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 397, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 399, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 397, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -17422,7 +17511,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(2, 397, __pyx_L1_error) + else __PYX_ERR(2, 399, __pyx_L1_error) } break; } @@ -17433,18 +17522,18 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py __pyx_v_dim = __pyx_t_1; __pyx_t_1 = (__pyx_t_1 + 1); - /* "View.MemoryView":398 + /* "View.MemoryView":400 * * for dim, idx in enumerate(index): * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<< * * return itemp */ - __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 398, __pyx_L1_error) - __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(2, 398, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 400, __pyx_L1_error) + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(2, 400, __pyx_L1_error) __pyx_v_itemp = __pyx_t_7; - /* "View.MemoryView":397 + /* "View.MemoryView":399 * cdef char *itemp = self.view.buf * * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< @@ -17454,7 +17543,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":400 + /* "View.MemoryView":402 * itemp = pybuffer_index(&self.view, itemp, idx, dim) * * return itemp # <<<<<<<<<<<<<< @@ -17464,7 +17553,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py __pyx_r = __pyx_v_itemp; goto __pyx_L0; - /* "View.MemoryView":393 + /* "View.MemoryView":395 * PyThread_free_lock(self.lock) * * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< @@ -17484,7 +17573,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py return __pyx_r; } -/* "View.MemoryView":403 +/* "View.MemoryView":405 * * * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< @@ -17522,7 +17611,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); - /* "View.MemoryView":404 + /* "View.MemoryView":406 * * def __getitem__(memoryview self, object index): * if index is Ellipsis: # <<<<<<<<<<<<<< @@ -17533,7 +17622,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":405 + /* "View.MemoryView":407 * def __getitem__(memoryview self, object index): * if index is Ellipsis: * return self # <<<<<<<<<<<<<< @@ -17545,7 +17634,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "View.MemoryView":404 + /* "View.MemoryView":406 * * def __getitem__(memoryview self, object index): * if index is Ellipsis: # <<<<<<<<<<<<<< @@ -17554,14 +17643,14 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ */ } - /* "View.MemoryView":407 + /* "View.MemoryView":409 * return self * * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< * * cdef char *itemp */ - __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 407, __pyx_L1_error) + __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(__pyx_t_3 != Py_None)) { PyObject* sequence = __pyx_t_3; @@ -17569,7 +17658,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(2, 407, __pyx_L1_error) + __PYX_ERR(2, 409, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); @@ -17577,31 +17666,31 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else - __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 407, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 407, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 407, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 409, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_indices = __pyx_t_5; __pyx_t_5 = 0; - /* "View.MemoryView":410 + /* "View.MemoryView":412 * * cdef char *itemp * if have_slices: # <<<<<<<<<<<<<< * return memview_slice(self, indices) * else: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 410, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 412, __pyx_L1_error) if (__pyx_t_2) { - /* "View.MemoryView":411 + /* "View.MemoryView":413 * cdef char *itemp * if have_slices: * return memview_slice(self, indices) # <<<<<<<<<<<<<< @@ -17609,13 +17698,13 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ * itemp = self.get_item_pointer(indices) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 411, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "View.MemoryView":410 + /* "View.MemoryView":412 * * cdef char *itemp * if have_slices: # <<<<<<<<<<<<<< @@ -17624,7 +17713,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ */ } - /* "View.MemoryView":413 + /* "View.MemoryView":415 * return memview_slice(self, indices) * else: * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<< @@ -17632,10 +17721,10 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ * */ /*else*/ { - __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(2, 413, __pyx_L1_error) + __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(2, 415, __pyx_L1_error) __pyx_v_itemp = __pyx_t_6; - /* "View.MemoryView":414 + /* "View.MemoryView":416 * else: * itemp = self.get_item_pointer(indices) * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<< @@ -17643,14 +17732,14 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ * def __setitem__(memoryview self, object index, object value): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 414, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } - /* "View.MemoryView":403 + /* "View.MemoryView":405 * * * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< @@ -17673,7 +17762,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ return __pyx_r; } -/* "View.MemoryView":416 +/* "View.MemoryView":418 * return self.convert_item_to_object(itemp) * * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< @@ -17709,7 +17798,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit __Pyx_RefNannySetupContext("__setitem__", 0); __Pyx_INCREF(__pyx_v_index); - /* "View.MemoryView":417 + /* "View.MemoryView":419 * * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: # <<<<<<<<<<<<<< @@ -17719,20 +17808,20 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit __pyx_t_1 = (__pyx_v_self->view.readonly != 0); if (unlikely(__pyx_t_1)) { - /* "View.MemoryView":418 + /* "View.MemoryView":420 * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<< * * have_slices, index = _unellipsify(index, self.view.ndim) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 418, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(2, 418, __pyx_L1_error) + __PYX_ERR(2, 420, __pyx_L1_error) - /* "View.MemoryView":417 + /* "View.MemoryView":419 * * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: # <<<<<<<<<<<<<< @@ -17741,14 +17830,14 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit */ } - /* "View.MemoryView":420 + /* "View.MemoryView":422 * raise TypeError("Cannot assign to read-only memoryview") * * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< * * if have_slices: */ - __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 420, __pyx_L1_error) + __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(__pyx_t_2 != Py_None)) { PyObject* sequence = __pyx_t_2; @@ -17756,7 +17845,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(2, 420, __pyx_L1_error) + __PYX_ERR(2, 422, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); @@ -17764,67 +17853,67 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 420, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 420, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 420, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 422, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_3; __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4); __pyx_t_4 = 0; - /* "View.MemoryView":422 + /* "View.MemoryView":424 * have_slices, index = _unellipsify(index, self.view.ndim) * * if have_slices: # <<<<<<<<<<<<<< * obj = self.is_slice(value) * if obj: */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 422, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 424, __pyx_L1_error) if (__pyx_t_1) { - /* "View.MemoryView":423 + /* "View.MemoryView":425 * * if have_slices: * obj = self.is_slice(value) # <<<<<<<<<<<<<< * if obj: * self.setitem_slice_assignment(self[index], obj) */ - __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 423, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_obj = __pyx_t_2; __pyx_t_2 = 0; - /* "View.MemoryView":424 + /* "View.MemoryView":426 * if have_slices: * obj = self.is_slice(value) * if obj: # <<<<<<<<<<<<<< * self.setitem_slice_assignment(self[index], obj) * else: */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 424, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 426, __pyx_L1_error) if (__pyx_t_1) { - /* "View.MemoryView":425 + /* "View.MemoryView":427 * obj = self.is_slice(value) * if obj: * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<< * else: * self.setitem_slice_assign_scalar(self[index], value) */ - __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 425, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 425, __pyx_L1_error) + __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "View.MemoryView":424 + /* "View.MemoryView":426 * if have_slices: * obj = self.is_slice(value) * if obj: # <<<<<<<<<<<<<< @@ -17834,7 +17923,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit goto __pyx_L5; } - /* "View.MemoryView":427 + /* "View.MemoryView":429 * self.setitem_slice_assignment(self[index], obj) * else: * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<< @@ -17842,17 +17931,17 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit * self.setitem_indexed(index, value) */ /*else*/ { - __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 427, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(2, 427, __pyx_L1_error) - __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 427, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(2, 429, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L5:; - /* "View.MemoryView":422 + /* "View.MemoryView":424 * have_slices, index = _unellipsify(index, self.view.ndim) * * if have_slices: # <<<<<<<<<<<<<< @@ -17862,7 +17951,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit goto __pyx_L4; } - /* "View.MemoryView":429 + /* "View.MemoryView":431 * self.setitem_slice_assign_scalar(self[index], value) * else: * self.setitem_indexed(index, value) # <<<<<<<<<<<<<< @@ -17870,13 +17959,13 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit * cdef is_slice(self, obj): */ /*else*/ { - __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 429, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L4:; - /* "View.MemoryView":416 + /* "View.MemoryView":418 * return self.convert_item_to_object(itemp) * * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< @@ -17901,7 +17990,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit return __pyx_r; } -/* "View.MemoryView":431 +/* "View.MemoryView":433 * self.setitem_indexed(index, value) * * cdef is_slice(self, obj): # <<<<<<<<<<<<<< @@ -17927,7 +18016,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ __Pyx_RefNannySetupContext("is_slice", 0); __Pyx_INCREF(__pyx_v_obj); - /* "View.MemoryView":432 + /* "View.MemoryView":434 * * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< @@ -17938,7 +18027,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":433 + /* "View.MemoryView":435 * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): * try: # <<<<<<<<<<<<<< @@ -17954,34 +18043,34 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ __Pyx_XGOTREF(__pyx_t_5); /*try:*/ { - /* "View.MemoryView":434 + /* "View.MemoryView":436 * if not isinstance(obj, memoryview): * try: * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< * self.dtype_is_object) * except TypeError: */ - __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 434, __pyx_L4_error) + __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 436, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); - /* "View.MemoryView":435 + /* "View.MemoryView":437 * try: * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, * self.dtype_is_object) # <<<<<<<<<<<<<< * except TypeError: * return None */ - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 435, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 437, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); - /* "View.MemoryView":434 + /* "View.MemoryView":436 * if not isinstance(obj, memoryview): * try: * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< * self.dtype_is_object) * except TypeError: */ - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 434, __pyx_L4_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 436, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); @@ -17992,13 +18081,13 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7); __pyx_t_6 = 0; __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 434, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 436, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); __pyx_t_7 = 0; - /* "View.MemoryView":433 + /* "View.MemoryView":435 * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): * try: # <<<<<<<<<<<<<< @@ -18015,7 +18104,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "View.MemoryView":436 + /* "View.MemoryView":438 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, * self.dtype_is_object) * except TypeError: # <<<<<<<<<<<<<< @@ -18025,12 +18114,12 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_9) { __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(2, 436, __pyx_L6_except_error) + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(2, 438, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_6); - /* "View.MemoryView":437 + /* "View.MemoryView":439 * self.dtype_is_object) * except TypeError: * return None # <<<<<<<<<<<<<< @@ -18047,7 +18136,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ goto __pyx_L6_except_error; __pyx_L6_except_error:; - /* "View.MemoryView":433 + /* "View.MemoryView":435 * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): * try: # <<<<<<<<<<<<<< @@ -18068,7 +18157,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ __pyx_L9_try_end:; } - /* "View.MemoryView":432 + /* "View.MemoryView":434 * * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< @@ -18077,7 +18166,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ */ } - /* "View.MemoryView":439 + /* "View.MemoryView":441 * return None * * return obj # <<<<<<<<<<<<<< @@ -18089,7 +18178,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ __pyx_r = __pyx_v_obj; goto __pyx_L0; - /* "View.MemoryView":431 + /* "View.MemoryView":433 * self.setitem_indexed(index, value) * * cdef is_slice(self, obj): # <<<<<<<<<<<<<< @@ -18111,7 +18200,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ return __pyx_r; } -/* "View.MemoryView":441 +/* "View.MemoryView":443 * return obj * * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< @@ -18135,52 +18224,52 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setitem_slice_assignment", 0); - /* "View.MemoryView":445 + /* "View.MemoryView":447 * cdef __Pyx_memviewslice src_slice * * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< * get_slice_from_memview(dst, &dst_slice)[0], * src.ndim, dst.ndim, self.dtype_is_object) */ - if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 445, __pyx_L1_error) - __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 445, __pyx_L1_error) + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 447, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 447, __pyx_L1_error) - /* "View.MemoryView":446 + /* "View.MemoryView":448 * * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<< * src.ndim, dst.ndim, self.dtype_is_object) * */ - if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 446, __pyx_L1_error) - __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 446, __pyx_L1_error) + if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 448, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 448, __pyx_L1_error) - /* "View.MemoryView":447 + /* "View.MemoryView":449 * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], * get_slice_from_memview(dst, &dst_slice)[0], * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<< * * cdef setitem_slice_assign_scalar(self, memoryview dst, value): */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 447, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 447, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 449, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 447, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 447, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 449, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":445 + /* "View.MemoryView":447 * cdef __Pyx_memviewslice src_slice * * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< * get_slice_from_memview(dst, &dst_slice)[0], * src.ndim, dst.ndim, self.dtype_is_object) */ - __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 445, __pyx_L1_error) + __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 447, __pyx_L1_error) - /* "View.MemoryView":441 + /* "View.MemoryView":443 * return obj * * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< @@ -18201,7 +18290,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi return __pyx_r; } -/* "View.MemoryView":449 +/* "View.MemoryView":451 * src.ndim, dst.ndim, self.dtype_is_object) * * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< @@ -18234,7 +18323,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0); - /* "View.MemoryView":451 + /* "View.MemoryView":453 * cdef setitem_slice_assign_scalar(self, memoryview dst, value): * cdef int array[128] * cdef void *tmp = NULL # <<<<<<<<<<<<<< @@ -18243,17 +18332,17 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor */ __pyx_v_tmp = NULL; - /* "View.MemoryView":456 + /* "View.MemoryView":458 * cdef __Pyx_memviewslice *dst_slice * cdef __Pyx_memviewslice tmp_slice * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<< * * if self.view.itemsize > sizeof(array): */ - __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 456, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 458, __pyx_L1_error) __pyx_v_dst_slice = __pyx_t_1; - /* "View.MemoryView":458 + /* "View.MemoryView":460 * dst_slice = get_slice_from_memview(dst, &tmp_slice) * * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< @@ -18263,7 +18352,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0); if (__pyx_t_2) { - /* "View.MemoryView":459 + /* "View.MemoryView":461 * * if self.view.itemsize > sizeof(array): * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<< @@ -18272,7 +18361,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor */ __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize); - /* "View.MemoryView":460 + /* "View.MemoryView":462 * if self.view.itemsize > sizeof(array): * tmp = PyMem_Malloc(self.view.itemsize) * if tmp == NULL: # <<<<<<<<<<<<<< @@ -18282,16 +18371,16 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0); if (unlikely(__pyx_t_2)) { - /* "View.MemoryView":461 + /* "View.MemoryView":463 * tmp = PyMem_Malloc(self.view.itemsize) * if tmp == NULL: * raise MemoryError # <<<<<<<<<<<<<< * item = tmp * else: */ - PyErr_NoMemory(); __PYX_ERR(2, 461, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(2, 463, __pyx_L1_error) - /* "View.MemoryView":460 + /* "View.MemoryView":462 * if self.view.itemsize > sizeof(array): * tmp = PyMem_Malloc(self.view.itemsize) * if tmp == NULL: # <<<<<<<<<<<<<< @@ -18300,7 +18389,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor */ } - /* "View.MemoryView":462 + /* "View.MemoryView":464 * if tmp == NULL: * raise MemoryError * item = tmp # <<<<<<<<<<<<<< @@ -18309,7 +18398,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor */ __pyx_v_item = __pyx_v_tmp; - /* "View.MemoryView":458 + /* "View.MemoryView":460 * dst_slice = get_slice_from_memview(dst, &tmp_slice) * * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< @@ -18319,7 +18408,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor goto __pyx_L3; } - /* "View.MemoryView":464 + /* "View.MemoryView":466 * item = tmp * else: * item = array # <<<<<<<<<<<<<< @@ -18331,7 +18420,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor } __pyx_L3:; - /* "View.MemoryView":466 + /* "View.MemoryView":468 * item = array * * try: # <<<<<<<<<<<<<< @@ -18340,7 +18429,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor */ /*try:*/ { - /* "View.MemoryView":467 + /* "View.MemoryView":469 * * try: * if self.dtype_is_object: # <<<<<<<<<<<<<< @@ -18350,7 +18439,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0); if (__pyx_t_2) { - /* "View.MemoryView":468 + /* "View.MemoryView":470 * try: * if self.dtype_is_object: * ( item)[0] = value # <<<<<<<<<<<<<< @@ -18359,7 +18448,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor */ (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value); - /* "View.MemoryView":467 + /* "View.MemoryView":469 * * try: * if self.dtype_is_object: # <<<<<<<<<<<<<< @@ -18369,7 +18458,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor goto __pyx_L8; } - /* "View.MemoryView":470 + /* "View.MemoryView":472 * ( item)[0] = value * else: * self.assign_item_from_object( item, value) # <<<<<<<<<<<<<< @@ -18377,13 +18466,13 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor * */ /*else*/ { - __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 470, __pyx_L6_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 472, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L8:; - /* "View.MemoryView":474 + /* "View.MemoryView":476 * * * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< @@ -18393,18 +18482,18 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0); if (__pyx_t_2) { - /* "View.MemoryView":475 + /* "View.MemoryView":477 * * if self.view.suboffsets != NULL: * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<< * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, * item, self.dtype_is_object) */ - __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 475, __pyx_L6_error) + __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 477, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":474 + /* "View.MemoryView":476 * * * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< @@ -18413,7 +18502,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor */ } - /* "View.MemoryView":476 + /* "View.MemoryView":478 * if self.view.suboffsets != NULL: * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<< @@ -18423,7 +18512,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object); } - /* "View.MemoryView":479 + /* "View.MemoryView":481 * item, self.dtype_is_object) * finally: * PyMem_Free(tmp) # <<<<<<<<<<<<<< @@ -18470,7 +18559,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor __pyx_L7:; } - /* "View.MemoryView":449 + /* "View.MemoryView":451 * src.ndim, dst.ndim, self.dtype_is_object) * * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< @@ -18491,7 +18580,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor return __pyx_r; } -/* "View.MemoryView":481 +/* "View.MemoryView":483 * PyMem_Free(tmp) * * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< @@ -18510,28 +18599,28 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setitem_indexed", 0); - /* "View.MemoryView":482 + /* "View.MemoryView":484 * * cdef setitem_indexed(self, index, value): * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<< * self.assign_item_from_object(itemp, value) * */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(2, 482, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(2, 484, __pyx_L1_error) __pyx_v_itemp = __pyx_t_1; - /* "View.MemoryView":483 + /* "View.MemoryView":485 * cdef setitem_indexed(self, index, value): * cdef char *itemp = self.get_item_pointer(index) * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<< * * cdef convert_item_to_object(self, char *itemp): */ - __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 483, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":481 + /* "View.MemoryView":483 * PyMem_Free(tmp) * * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< @@ -18552,7 +18641,7 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_ return __pyx_r; } -/* "View.MemoryView":485 +/* "View.MemoryView":487 * self.assign_item_from_object(itemp, value) * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< @@ -18582,31 +18671,31 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview int __pyx_clineno = 0; __Pyx_RefNannySetupContext("convert_item_to_object", 0); - /* "View.MemoryView":488 + /* "View.MemoryView":490 * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" * import struct # <<<<<<<<<<<<<< * cdef bytes bytesitem * */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 488, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; - /* "View.MemoryView":491 + /* "View.MemoryView":493 * cdef bytes bytesitem * * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<< * try: * result = struct.unpack(self.view.format, bytesitem) */ - __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 491, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":492 + /* "View.MemoryView":494 * * bytesitem = itemp[:self.view.itemsize] * try: # <<<<<<<<<<<<<< @@ -18622,16 +18711,16 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { - /* "View.MemoryView":493 + /* "View.MemoryView":495 * bytesitem = itemp[:self.view.itemsize] * try: * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<< * except struct.error: * raise ValueError("Unable to convert item to object") */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 493, __pyx_L3_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 495, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 493, __pyx_L3_error) + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 495, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -18648,7 +18737,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 495, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -18657,14 +18746,14 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 495, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 493, __pyx_L3_error) + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 495, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -18675,7 +18764,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __Pyx_GIVEREF(__pyx_v_bytesitem); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem); __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 495, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -18683,7 +18772,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __pyx_v_result = __pyx_t_1; __pyx_t_1 = 0; - /* "View.MemoryView":492 + /* "View.MemoryView":494 * * bytesitem = itemp[:self.view.itemsize] * try: # <<<<<<<<<<<<<< @@ -18692,7 +18781,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview */ } - /* "View.MemoryView":497 + /* "View.MemoryView":499 * raise ValueError("Unable to convert item to object") * else: * if len(self.view.format) == 1: # <<<<<<<<<<<<<< @@ -18704,7 +18793,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __pyx_t_11 = ((__pyx_t_10 == 1) != 0); if (__pyx_t_11) { - /* "View.MemoryView":498 + /* "View.MemoryView":500 * else: * if len(self.view.format) == 1: * return result[0] # <<<<<<<<<<<<<< @@ -18712,13 +18801,13 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 498, __pyx_L5_except_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 500, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L6_except_return; - /* "View.MemoryView":497 + /* "View.MemoryView":499 * raise ValueError("Unable to convert item to object") * else: * if len(self.view.format) == 1: # <<<<<<<<<<<<<< @@ -18727,7 +18816,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview */ } - /* "View.MemoryView":499 + /* "View.MemoryView":501 * if len(self.view.format) == 1: * return result[0] * return result # <<<<<<<<<<<<<< @@ -18746,7 +18835,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "View.MemoryView":494 + /* "View.MemoryView":496 * try: * result = struct.unpack(self.view.format, bytesitem) * except struct.error: # <<<<<<<<<<<<<< @@ -18754,7 +18843,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview * else: */ __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 494, __pyx_L5_except_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 496, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -18762,28 +18851,28 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0; if (__pyx_t_8) { __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(2, 494, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(2, 496, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_1); - /* "View.MemoryView":495 + /* "View.MemoryView":497 * result = struct.unpack(self.view.format, bytesitem) * except struct.error: * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< * else: * if len(self.view.format) == 1: */ - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 495, __pyx_L5_except_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 497, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(2, 495, __pyx_L5_except_error) + __PYX_ERR(2, 497, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "View.MemoryView":492 + /* "View.MemoryView":494 * * bytesitem = itemp[:self.view.itemsize] * try: # <<<<<<<<<<<<<< @@ -18803,7 +18892,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview goto __pyx_L0; } - /* "View.MemoryView":485 + /* "View.MemoryView":487 * self.assign_item_from_object(itemp, value) * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< @@ -18829,7 +18918,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview return __pyx_r; } -/* "View.MemoryView":501 +/* "View.MemoryView":503 * return result * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< @@ -18863,19 +18952,19 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie int __pyx_clineno = 0; __Pyx_RefNannySetupContext("assign_item_from_object", 0); - /* "View.MemoryView":504 + /* "View.MemoryView":506 * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" * import struct # <<<<<<<<<<<<<< * cdef char c * cdef bytes bytesvalue */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 504, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; - /* "View.MemoryView":509 + /* "View.MemoryView":511 * cdef Py_ssize_t i * * if isinstance(value, tuple): # <<<<<<<<<<<<<< @@ -18886,37 +18975,37 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "View.MemoryView":510 + /* "View.MemoryView":512 * * if isinstance(value, tuple): * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<< * else: * bytesvalue = struct.pack(self.view.format, value) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 510, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 510, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 510, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 510, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 512, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "View.MemoryView":509 + /* "View.MemoryView":511 * cdef Py_ssize_t i * * if isinstance(value, tuple): # <<<<<<<<<<<<<< @@ -18926,7 +19015,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie goto __pyx_L3; } - /* "View.MemoryView":512 + /* "View.MemoryView":514 * bytesvalue = struct.pack(self.view.format, *value) * else: * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<< @@ -18934,9 +19023,9 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie * for i, c in enumerate(bytesvalue): */ /*else*/ { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 512, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 512, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_7 = 0; @@ -18953,7 +19042,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 514, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -18962,14 +19051,14 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 514, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 512, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -18980,18 +19069,18 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 512, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 514, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; } __pyx_L3:; - /* "View.MemoryView":514 + /* "View.MemoryView":516 * bytesvalue = struct.pack(self.view.format, value) * * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< @@ -19001,7 +19090,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie __pyx_t_9 = 0; if (unlikely(__pyx_v_bytesvalue == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); - __PYX_ERR(2, 514, __pyx_L1_error) + __PYX_ERR(2, 516, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_bytesvalue); __pyx_t_10 = __pyx_v_bytesvalue; @@ -19011,7 +19100,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie __pyx_t_11 = __pyx_t_14; __pyx_v_c = (__pyx_t_11[0]); - /* "View.MemoryView":515 + /* "View.MemoryView":517 * * for i, c in enumerate(bytesvalue): * itemp[i] = c # <<<<<<<<<<<<<< @@ -19020,7 +19109,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie */ __pyx_v_i = __pyx_t_9; - /* "View.MemoryView":514 + /* "View.MemoryView":516 * bytesvalue = struct.pack(self.view.format, value) * * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< @@ -19029,7 +19118,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie */ __pyx_t_9 = (__pyx_t_9 + 1); - /* "View.MemoryView":515 + /* "View.MemoryView":517 * * for i, c in enumerate(bytesvalue): * itemp[i] = c # <<<<<<<<<<<<<< @@ -19040,7 +19129,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "View.MemoryView":501 + /* "View.MemoryView":503 * return result * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< @@ -19068,7 +19157,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie return __pyx_r; } -/* "View.MemoryView":518 +/* "View.MemoryView":520 * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< @@ -19111,7 +19200,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); - /* "View.MemoryView":519 + /* "View.MemoryView":521 * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<< @@ -19129,20 +19218,20 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_L4_bool_binop_done:; if (unlikely(__pyx_t_1)) { - /* "View.MemoryView":520 + /* "View.MemoryView":522 * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<< * * if flags & PyBUF_ND: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 520, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 520, __pyx_L1_error) + __PYX_ERR(2, 522, __pyx_L1_error) - /* "View.MemoryView":519 + /* "View.MemoryView":521 * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<< @@ -19151,7 +19240,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu */ } - /* "View.MemoryView":522 + /* "View.MemoryView":524 * raise ValueError("Cannot create writable memory view from read-only memoryview") * * if flags & PyBUF_ND: # <<<<<<<<<<<<<< @@ -19161,7 +19250,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0); if (__pyx_t_1) { - /* "View.MemoryView":523 + /* "View.MemoryView":525 * * if flags & PyBUF_ND: * info.shape = self.view.shape # <<<<<<<<<<<<<< @@ -19171,7 +19260,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_4 = __pyx_v_self->view.shape; __pyx_v_info->shape = __pyx_t_4; - /* "View.MemoryView":522 + /* "View.MemoryView":524 * raise ValueError("Cannot create writable memory view from read-only memoryview") * * if flags & PyBUF_ND: # <<<<<<<<<<<<<< @@ -19181,7 +19270,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu goto __pyx_L6; } - /* "View.MemoryView":525 + /* "View.MemoryView":527 * info.shape = self.view.shape * else: * info.shape = NULL # <<<<<<<<<<<<<< @@ -19193,7 +19282,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu } __pyx_L6:; - /* "View.MemoryView":527 + /* "View.MemoryView":529 * info.shape = NULL * * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< @@ -19203,7 +19292,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); if (__pyx_t_1) { - /* "View.MemoryView":528 + /* "View.MemoryView":530 * * if flags & PyBUF_STRIDES: * info.strides = self.view.strides # <<<<<<<<<<<<<< @@ -19213,7 +19302,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_4 = __pyx_v_self->view.strides; __pyx_v_info->strides = __pyx_t_4; - /* "View.MemoryView":527 + /* "View.MemoryView":529 * info.shape = NULL * * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< @@ -19223,7 +19312,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu goto __pyx_L7; } - /* "View.MemoryView":530 + /* "View.MemoryView":532 * info.strides = self.view.strides * else: * info.strides = NULL # <<<<<<<<<<<<<< @@ -19235,7 +19324,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu } __pyx_L7:; - /* "View.MemoryView":532 + /* "View.MemoryView":534 * info.strides = NULL * * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< @@ -19245,7 +19334,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0); if (__pyx_t_1) { - /* "View.MemoryView":533 + /* "View.MemoryView":535 * * if flags & PyBUF_INDIRECT: * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<< @@ -19255,7 +19344,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_4 = __pyx_v_self->view.suboffsets; __pyx_v_info->suboffsets = __pyx_t_4; - /* "View.MemoryView":532 + /* "View.MemoryView":534 * info.strides = NULL * * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< @@ -19265,7 +19354,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu goto __pyx_L8; } - /* "View.MemoryView":535 + /* "View.MemoryView":537 * info.suboffsets = self.view.suboffsets * else: * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -19277,7 +19366,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu } __pyx_L8:; - /* "View.MemoryView":537 + /* "View.MemoryView":539 * info.suboffsets = NULL * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< @@ -19287,7 +19376,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); if (__pyx_t_1) { - /* "View.MemoryView":538 + /* "View.MemoryView":540 * * if flags & PyBUF_FORMAT: * info.format = self.view.format # <<<<<<<<<<<<<< @@ -19297,7 +19386,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_5 = __pyx_v_self->view.format; __pyx_v_info->format = __pyx_t_5; - /* "View.MemoryView":537 + /* "View.MemoryView":539 * info.suboffsets = NULL * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< @@ -19307,7 +19396,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu goto __pyx_L9; } - /* "View.MemoryView":540 + /* "View.MemoryView":542 * info.format = self.view.format * else: * info.format = NULL # <<<<<<<<<<<<<< @@ -19319,7 +19408,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu } __pyx_L9:; - /* "View.MemoryView":542 + /* "View.MemoryView":544 * info.format = NULL * * info.buf = self.view.buf # <<<<<<<<<<<<<< @@ -19329,7 +19418,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_6 = __pyx_v_self->view.buf; __pyx_v_info->buf = __pyx_t_6; - /* "View.MemoryView":543 + /* "View.MemoryView":545 * * info.buf = self.view.buf * info.ndim = self.view.ndim # <<<<<<<<<<<<<< @@ -19339,7 +19428,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_7 = __pyx_v_self->view.ndim; __pyx_v_info->ndim = __pyx_t_7; - /* "View.MemoryView":544 + /* "View.MemoryView":546 * info.buf = self.view.buf * info.ndim = self.view.ndim * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<< @@ -19349,7 +19438,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_8 = __pyx_v_self->view.itemsize; __pyx_v_info->itemsize = __pyx_t_8; - /* "View.MemoryView":545 + /* "View.MemoryView":547 * info.ndim = self.view.ndim * info.itemsize = self.view.itemsize * info.len = self.view.len # <<<<<<<<<<<<<< @@ -19359,7 +19448,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_8 = __pyx_v_self->view.len; __pyx_v_info->len = __pyx_t_8; - /* "View.MemoryView":546 + /* "View.MemoryView":548 * info.itemsize = self.view.itemsize * info.len = self.view.len * info.readonly = self.view.readonly # <<<<<<<<<<<<<< @@ -19369,7 +19458,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_1 = __pyx_v_self->view.readonly; __pyx_v_info->readonly = __pyx_t_1; - /* "View.MemoryView":547 + /* "View.MemoryView":549 * info.len = self.view.len * info.readonly = self.view.readonly * info.obj = self # <<<<<<<<<<<<<< @@ -19382,7 +19471,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - /* "View.MemoryView":518 + /* "View.MemoryView":520 * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< @@ -19412,7 +19501,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu return __pyx_r; } -/* "View.MemoryView":553 +/* "View.MemoryView":555 * * @property * def T(self): # <<<<<<<<<<<<<< @@ -19444,29 +19533,29 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct _ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":554 + /* "View.MemoryView":556 * @property * def T(self): * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<< * transpose_memslice(&result.from_slice) * return result */ - __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 554, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 554, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 556, __pyx_L1_error) __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":555 + /* "View.MemoryView":557 * def T(self): * cdef _memoryviewslice result = memoryview_copy(self) * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<< * return result * */ - __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 555, __pyx_L1_error) + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 557, __pyx_L1_error) - /* "View.MemoryView":556 + /* "View.MemoryView":558 * cdef _memoryviewslice result = memoryview_copy(self) * transpose_memslice(&result.from_slice) * return result # <<<<<<<<<<<<<< @@ -19478,7 +19567,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct _ __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; - /* "View.MemoryView":553 + /* "View.MemoryView":555 * * @property * def T(self): # <<<<<<<<<<<<<< @@ -19498,7 +19587,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct _ return __pyx_r; } -/* "View.MemoryView":559 +/* "View.MemoryView":561 * * @property * def base(self): # <<<<<<<<<<<<<< @@ -19524,7 +19613,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struc __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":560 + /* "View.MemoryView":562 * @property * def base(self): * return self.obj # <<<<<<<<<<<<<< @@ -19536,7 +19625,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struc __pyx_r = __pyx_v_self->obj; goto __pyx_L0; - /* "View.MemoryView":559 + /* "View.MemoryView":561 * * @property * def base(self): # <<<<<<<<<<<<<< @@ -19551,7 +19640,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struc return __pyx_r; } -/* "View.MemoryView":563 +/* "View.MemoryView":565 * * @property * def shape(self): # <<<<<<<<<<<<<< @@ -19586,7 +19675,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(stru int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":564 + /* "View.MemoryView":566 * @property * def shape(self): * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<< @@ -19594,25 +19683,25 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(stru * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 564, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { __pyx_t_2 = __pyx_t_4; __pyx_v_length = (__pyx_t_2[0]); - __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 564, __pyx_L1_error) + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 564, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 566, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 564, __pyx_L1_error) + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - /* "View.MemoryView":563 + /* "View.MemoryView":565 * * @property * def shape(self): # <<<<<<<<<<<<<< @@ -19632,7 +19721,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(stru return __pyx_r; } -/* "View.MemoryView":567 +/* "View.MemoryView":569 * * @property * def strides(self): # <<<<<<<<<<<<<< @@ -19668,7 +19757,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":568 + /* "View.MemoryView":570 * @property * def strides(self): * if self.view.strides == NULL: # <<<<<<<<<<<<<< @@ -19678,20 +19767,20 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0); if (unlikely(__pyx_t_1)) { - /* "View.MemoryView":570 + /* "View.MemoryView":572 * if self.view.strides == NULL: * * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 570, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(2, 570, __pyx_L1_error) + __PYX_ERR(2, 572, __pyx_L1_error) - /* "View.MemoryView":568 + /* "View.MemoryView":570 * @property * def strides(self): * if self.view.strides == NULL: # <<<<<<<<<<<<<< @@ -19700,7 +19789,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st */ } - /* "View.MemoryView":572 + /* "View.MemoryView":574 * raise ValueError("Buffer view does not expose strides") * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<< @@ -19708,25 +19797,25 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 572, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim); for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { __pyx_t_3 = __pyx_t_5; __pyx_v_stride = (__pyx_t_3[0]); - __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 572, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 572, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 574, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 572, __pyx_L1_error) + __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "View.MemoryView":567 + /* "View.MemoryView":569 * * @property * def strides(self): # <<<<<<<<<<<<<< @@ -19746,7 +19835,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st return __pyx_r; } -/* "View.MemoryView":575 +/* "View.MemoryView":577 * * @property * def suboffsets(self): # <<<<<<<<<<<<<< @@ -19782,7 +19871,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":576 + /* "View.MemoryView":578 * @property * def suboffsets(self): * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< @@ -19792,7 +19881,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0); if (__pyx_t_1) { - /* "View.MemoryView":577 + /* "View.MemoryView":579 * def suboffsets(self): * if self.view.suboffsets == NULL: * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< @@ -19800,16 +19889,16 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 577, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__14, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 577, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__14, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "View.MemoryView":576 + /* "View.MemoryView":578 * @property * def suboffsets(self): * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< @@ -19818,7 +19907,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ */ } - /* "View.MemoryView":579 + /* "View.MemoryView":581 * return (-1,) * self.view.ndim * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<< @@ -19826,25 +19915,25 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 579, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { __pyx_t_4 = __pyx_t_6; __pyx_v_suboffset = (__pyx_t_4[0]); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 579, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 581, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error) + __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":575 + /* "View.MemoryView":577 * * @property * def suboffsets(self): # <<<<<<<<<<<<<< @@ -19864,7 +19953,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ return __pyx_r; } -/* "View.MemoryView":582 +/* "View.MemoryView":584 * * @property * def ndim(self): # <<<<<<<<<<<<<< @@ -19894,7 +19983,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":583 + /* "View.MemoryView":585 * @property * def ndim(self): * return self.view.ndim # <<<<<<<<<<<<<< @@ -19902,13 +19991,13 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struc * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 583, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "View.MemoryView":582 + /* "View.MemoryView":584 * * @property * def ndim(self): # <<<<<<<<<<<<<< @@ -19927,7 +20016,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struc return __pyx_r; } -/* "View.MemoryView":586 +/* "View.MemoryView":588 * * @property * def itemsize(self): # <<<<<<<<<<<<<< @@ -19957,7 +20046,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":587 + /* "View.MemoryView":589 * @property * def itemsize(self): * return self.view.itemsize # <<<<<<<<<<<<<< @@ -19965,13 +20054,13 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(s * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 587, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "View.MemoryView":586 + /* "View.MemoryView":588 * * @property * def itemsize(self): # <<<<<<<<<<<<<< @@ -19990,7 +20079,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(s return __pyx_r; } -/* "View.MemoryView":590 +/* "View.MemoryView":592 * * @property * def nbytes(self): # <<<<<<<<<<<<<< @@ -20022,7 +20111,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(str int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":591 + /* "View.MemoryView":593 * @property * def nbytes(self): * return self.size * self.view.itemsize # <<<<<<<<<<<<<< @@ -20030,11 +20119,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(str * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 591, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 591, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 591, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -20042,7 +20131,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(str __pyx_t_3 = 0; goto __pyx_L0; - /* "View.MemoryView":590 + /* "View.MemoryView":592 * * @property * def nbytes(self): # <<<<<<<<<<<<<< @@ -20063,7 +20152,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(str return __pyx_r; } -/* "View.MemoryView":594 +/* "View.MemoryView":596 * * @property * def size(self): # <<<<<<<<<<<<<< @@ -20100,7 +20189,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":595 + /* "View.MemoryView":597 * @property * def size(self): * if self._size is None: # <<<<<<<<<<<<<< @@ -20111,7 +20200,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":596 + /* "View.MemoryView":598 * def size(self): * if self._size is None: * result = 1 # <<<<<<<<<<<<<< @@ -20121,7 +20210,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc __Pyx_INCREF(__pyx_int_1); __pyx_v_result = __pyx_int_1; - /* "View.MemoryView":598 + /* "View.MemoryView":600 * result = 1 * * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<< @@ -20131,25 +20220,25 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { __pyx_t_3 = __pyx_t_5; - __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 598, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); __pyx_t_6 = 0; - /* "View.MemoryView":599 + /* "View.MemoryView":601 * * for length in self.view.shape[:self.view.ndim]: * result *= length # <<<<<<<<<<<<<< * * self._size = result */ - __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 599, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); __pyx_t_6 = 0; } - /* "View.MemoryView":601 + /* "View.MemoryView":603 * result *= length * * self._size = result # <<<<<<<<<<<<<< @@ -20162,7 +20251,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc __Pyx_DECREF(__pyx_v_self->_size); __pyx_v_self->_size = __pyx_v_result; - /* "View.MemoryView":595 + /* "View.MemoryView":597 * @property * def size(self): * if self._size is None: # <<<<<<<<<<<<<< @@ -20171,7 +20260,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc */ } - /* "View.MemoryView":603 + /* "View.MemoryView":605 * self._size = result * * return self._size # <<<<<<<<<<<<<< @@ -20183,7 +20272,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc __pyx_r = __pyx_v_self->_size; goto __pyx_L0; - /* "View.MemoryView":594 + /* "View.MemoryView":596 * * @property * def size(self): # <<<<<<<<<<<<<< @@ -20204,7 +20293,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc return __pyx_r; } -/* "View.MemoryView":605 +/* "View.MemoryView":607 * return self._size * * def __len__(self): # <<<<<<<<<<<<<< @@ -20231,7 +20320,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 int __pyx_t_1; __Pyx_RefNannySetupContext("__len__", 0); - /* "View.MemoryView":606 + /* "View.MemoryView":608 * * def __len__(self): * if self.view.ndim >= 1: # <<<<<<<<<<<<<< @@ -20241,7 +20330,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0); if (__pyx_t_1) { - /* "View.MemoryView":607 + /* "View.MemoryView":609 * def __len__(self): * if self.view.ndim >= 1: * return self.view.shape[0] # <<<<<<<<<<<<<< @@ -20251,7 +20340,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 __pyx_r = (__pyx_v_self->view.shape[0]); goto __pyx_L0; - /* "View.MemoryView":606 + /* "View.MemoryView":608 * * def __len__(self): * if self.view.ndim >= 1: # <<<<<<<<<<<<<< @@ -20260,7 +20349,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 */ } - /* "View.MemoryView":609 + /* "View.MemoryView":611 * return self.view.shape[0] * * return 0 # <<<<<<<<<<<<<< @@ -20270,7 +20359,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 __pyx_r = 0; goto __pyx_L0; - /* "View.MemoryView":605 + /* "View.MemoryView":607 * return self._size * * def __len__(self): # <<<<<<<<<<<<<< @@ -20284,7 +20373,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 return __pyx_r; } -/* "View.MemoryView":611 +/* "View.MemoryView":613 * return 0 * * def __repr__(self): # <<<<<<<<<<<<<< @@ -20316,7 +20405,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); - /* "View.MemoryView":612 + /* "View.MemoryView":614 * * def __repr__(self): * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< @@ -20324,33 +20413,33 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12 * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 612, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":613 + /* "View.MemoryView":615 * def __repr__(self): * return "" % (self.base.__class__.__name__, * id(self)) # <<<<<<<<<<<<<< * * def __str__(self): */ - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 613, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "View.MemoryView":612 + /* "View.MemoryView":614 * * def __repr__(self): * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< * id(self)) * */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 612, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); @@ -20358,14 +20447,14 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 612, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":611 + /* "View.MemoryView":613 * return 0 * * def __repr__(self): # <<<<<<<<<<<<<< @@ -20386,7 +20475,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12 return __pyx_r; } -/* "View.MemoryView":615 +/* "View.MemoryView":617 * id(self)) * * def __str__(self): # <<<<<<<<<<<<<< @@ -20417,7 +20506,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 0); - /* "View.MemoryView":616 + /* "View.MemoryView":618 * * def __str__(self): * return "" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<< @@ -20425,27 +20514,27 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14 * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 616, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 616, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "View.MemoryView":615 + /* "View.MemoryView":617 * id(self)) * * def __str__(self): # <<<<<<<<<<<<<< @@ -20465,7 +20554,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14 return __pyx_r; } -/* "View.MemoryView":619 +/* "View.MemoryView":621 * * * def is_c_contig(self): # <<<<<<<<<<<<<< @@ -20498,17 +20587,17 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_c_contig", 0); - /* "View.MemoryView":622 + /* "View.MemoryView":624 * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< * return slice_is_contig(mslice[0], 'C', self.view.ndim) * */ - __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 622, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 624, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; - /* "View.MemoryView":623 + /* "View.MemoryView":625 * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<< @@ -20516,13 +20605,13 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16 * def is_f_contig(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 623, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":619 + /* "View.MemoryView":621 * * * def is_c_contig(self): # <<<<<<<<<<<<<< @@ -20541,7 +20630,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16 return __pyx_r; } -/* "View.MemoryView":625 +/* "View.MemoryView":627 * return slice_is_contig(mslice[0], 'C', self.view.ndim) * * def is_f_contig(self): # <<<<<<<<<<<<<< @@ -20574,17 +20663,17 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_f_contig", 0); - /* "View.MemoryView":628 + /* "View.MemoryView":630 * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< * return slice_is_contig(mslice[0], 'F', self.view.ndim) * */ - __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 628, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 630, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; - /* "View.MemoryView":629 + /* "View.MemoryView":631 * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<< @@ -20592,13 +20681,13 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18 * def copy(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 629, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":625 + /* "View.MemoryView":627 * return slice_is_contig(mslice[0], 'C', self.view.ndim) * * def is_f_contig(self): # <<<<<<<<<<<<<< @@ -20617,7 +20706,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18 return __pyx_r; } -/* "View.MemoryView":631 +/* "View.MemoryView":633 * return slice_is_contig(mslice[0], 'F', self.view.ndim) * * def copy(self): # <<<<<<<<<<<<<< @@ -20650,7 +20739,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 0); - /* "View.MemoryView":633 + /* "View.MemoryView":635 * def copy(self): * cdef __Pyx_memviewslice mslice * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<< @@ -20659,7 +20748,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 */ __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS)); - /* "View.MemoryView":635 + /* "View.MemoryView":637 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS * * slice_copy(self, &mslice) # <<<<<<<<<<<<<< @@ -20668,17 +20757,17 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 */ __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice)); - /* "View.MemoryView":636 + /* "View.MemoryView":638 * * slice_copy(self, &mslice) * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<< * self.view.itemsize, * flags|PyBUF_C_CONTIGUOUS, */ - __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 636, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 638, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; - /* "View.MemoryView":641 + /* "View.MemoryView":643 * self.dtype_is_object) * * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<< @@ -20686,13 +20775,13 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 * def copy_fortran(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 641, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":631 + /* "View.MemoryView":633 * return slice_is_contig(mslice[0], 'F', self.view.ndim) * * def copy(self): # <<<<<<<<<<<<<< @@ -20711,7 +20800,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 return __pyx_r; } -/* "View.MemoryView":643 +/* "View.MemoryView":645 * return memoryview_copy_from_slice(self, &mslice) * * def copy_fortran(self): # <<<<<<<<<<<<<< @@ -20745,7 +20834,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy_fortran", 0); - /* "View.MemoryView":645 + /* "View.MemoryView":647 * def copy_fortran(self): * cdef __Pyx_memviewslice src, dst * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<< @@ -20754,7 +20843,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22 */ __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS)); - /* "View.MemoryView":647 + /* "View.MemoryView":649 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS * * slice_copy(self, &src) # <<<<<<<<<<<<<< @@ -20763,17 +20852,17 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22 */ __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src)); - /* "View.MemoryView":648 + /* "View.MemoryView":650 * * slice_copy(self, &src) * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<< * self.view.itemsize, * flags|PyBUF_F_CONTIGUOUS, */ - __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 648, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 650, __pyx_L1_error) __pyx_v_dst = __pyx_t_1; - /* "View.MemoryView":653 + /* "View.MemoryView":655 * self.dtype_is_object) * * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<< @@ -20781,13 +20870,13 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22 * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 653, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":643 + /* "View.MemoryView":645 * return memoryview_copy_from_slice(self, &mslice) * * def copy_fortran(self): # <<<<<<<<<<<<<< @@ -20919,7 +21008,7 @@ static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED st return __pyx_r; } -/* "View.MemoryView":657 +/* "View.MemoryView":659 * * @cname('__pyx_memoryview_new') * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< @@ -20939,18 +21028,18 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in int __pyx_clineno = 0; __Pyx_RefNannySetupContext("memoryview_cwrapper", 0); - /* "View.MemoryView":658 + /* "View.MemoryView":660 * @cname('__pyx_memoryview_new') * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< * result.typeinfo = typeinfo * return result */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 658, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 658, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 658, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_o); __Pyx_GIVEREF(__pyx_v_o); @@ -20961,13 +21050,13 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 658, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":659 + /* "View.MemoryView":661 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): * cdef memoryview result = memoryview(o, flags, dtype_is_object) * result.typeinfo = typeinfo # <<<<<<<<<<<<<< @@ -20976,7 +21065,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in */ __pyx_v_result->typeinfo = __pyx_v_typeinfo; - /* "View.MemoryView":660 + /* "View.MemoryView":662 * cdef memoryview result = memoryview(o, flags, dtype_is_object) * result.typeinfo = typeinfo * return result # <<<<<<<<<<<<<< @@ -20988,7 +21077,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; - /* "View.MemoryView":657 + /* "View.MemoryView":659 * * @cname('__pyx_memoryview_new') * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< @@ -21010,7 +21099,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in return __pyx_r; } -/* "View.MemoryView":663 +/* "View.MemoryView":665 * * @cname('__pyx_memoryview_check') * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< @@ -21024,7 +21113,7 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { int __pyx_t_1; __Pyx_RefNannySetupContext("memoryview_check", 0); - /* "View.MemoryView":664 + /* "View.MemoryView":666 * @cname('__pyx_memoryview_check') * cdef inline bint memoryview_check(object o): * return isinstance(o, memoryview) # <<<<<<<<<<<<<< @@ -21035,7 +21124,7 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { __pyx_r = __pyx_t_1; goto __pyx_L0; - /* "View.MemoryView":663 + /* "View.MemoryView":665 * * @cname('__pyx_memoryview_check') * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< @@ -21049,7 +21138,7 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { return __pyx_r; } -/* "View.MemoryView":666 +/* "View.MemoryView":668 * return isinstance(o, memoryview) * * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< @@ -21083,7 +21172,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_unellipsify", 0); - /* "View.MemoryView":671 + /* "View.MemoryView":673 * full slices. * """ * if not isinstance(index, tuple): # <<<<<<<<<<<<<< @@ -21094,14 +21183,14 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":672 + /* "View.MemoryView":674 * """ * if not isinstance(index, tuple): * tup = (index,) # <<<<<<<<<<<<<< * else: * tup = index */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 672, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_index); __Pyx_GIVEREF(__pyx_v_index); @@ -21109,7 +21198,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_v_tup = __pyx_t_3; __pyx_t_3 = 0; - /* "View.MemoryView":671 + /* "View.MemoryView":673 * full slices. * """ * if not isinstance(index, tuple): # <<<<<<<<<<<<<< @@ -21119,7 +21208,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { goto __pyx_L3; } - /* "View.MemoryView":674 + /* "View.MemoryView":676 * tup = (index,) * else: * tup = index # <<<<<<<<<<<<<< @@ -21132,19 +21221,19 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { } __pyx_L3:; - /* "View.MemoryView":676 + /* "View.MemoryView":678 * tup = index * * result = [] # <<<<<<<<<<<<<< * have_slices = False * seen_ellipsis = False */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 676, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 678, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_result = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":677 + /* "View.MemoryView":679 * * result = [] * have_slices = False # <<<<<<<<<<<<<< @@ -21153,7 +21242,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { */ __pyx_v_have_slices = 0; - /* "View.MemoryView":678 + /* "View.MemoryView":680 * result = [] * have_slices = False * seen_ellipsis = False # <<<<<<<<<<<<<< @@ -21162,7 +21251,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { */ __pyx_v_seen_ellipsis = 0; - /* "View.MemoryView":679 + /* "View.MemoryView":681 * have_slices = False * seen_ellipsis = False * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< @@ -21175,26 +21264,26 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 679, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 679, __pyx_L1_error) + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 681, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 679, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 681, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 679, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 681, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -21204,7 +21293,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(2, 679, __pyx_L1_error) + else __PYX_ERR(2, 681, __pyx_L1_error) } break; } @@ -21214,13 +21303,13 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_7 = 0; __Pyx_INCREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3); - __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_7; __pyx_t_7 = 0; - /* "View.MemoryView":680 + /* "View.MemoryView":682 * seen_ellipsis = False * for idx, item in enumerate(tup): * if item is Ellipsis: # <<<<<<<<<<<<<< @@ -21231,7 +21320,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "View.MemoryView":681 + /* "View.MemoryView":683 * for idx, item in enumerate(tup): * if item is Ellipsis: * if not seen_ellipsis: # <<<<<<<<<<<<<< @@ -21241,15 +21330,15 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0); if (__pyx_t_1) { - /* "View.MemoryView":682 + /* "View.MemoryView":684 * if item is Ellipsis: * if not seen_ellipsis: * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< * seen_ellipsis = True * else: */ - __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 682, __pyx_L1_error) - __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 682, __pyx_L1_error) + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 684, __pyx_L1_error) + __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { @@ -21258,10 +21347,10 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__17); } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 682, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 684, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "View.MemoryView":683 + /* "View.MemoryView":685 * if not seen_ellipsis: * result.extend([slice(None)] * (ndim - len(tup) + 1)) * seen_ellipsis = True # <<<<<<<<<<<<<< @@ -21270,7 +21359,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { */ __pyx_v_seen_ellipsis = 1; - /* "View.MemoryView":681 + /* "View.MemoryView":683 * for idx, item in enumerate(tup): * if item is Ellipsis: * if not seen_ellipsis: # <<<<<<<<<<<<<< @@ -21280,7 +21369,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { goto __pyx_L7; } - /* "View.MemoryView":685 + /* "View.MemoryView":687 * seen_ellipsis = True * else: * result.append(slice(None)) # <<<<<<<<<<<<<< @@ -21288,11 +21377,11 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * else: */ /*else*/ { - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__17); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 685, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__17); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 687, __pyx_L1_error) } __pyx_L7:; - /* "View.MemoryView":686 + /* "View.MemoryView":688 * else: * result.append(slice(None)) * have_slices = True # <<<<<<<<<<<<<< @@ -21301,7 +21390,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { */ __pyx_v_have_slices = 1; - /* "View.MemoryView":680 + /* "View.MemoryView":682 * seen_ellipsis = False * for idx, item in enumerate(tup): * if item is Ellipsis: # <<<<<<<<<<<<<< @@ -21311,7 +21400,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { goto __pyx_L6; } - /* "View.MemoryView":688 + /* "View.MemoryView":690 * have_slices = True * else: * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< @@ -21331,23 +21420,23 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_L9_bool_binop_done:; if (unlikely(__pyx_t_1)) { - /* "View.MemoryView":689 + /* "View.MemoryView":691 * else: * if not isinstance(item, slice) and not PyIndex_Check(item): * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<< * * have_slices = have_slices or isinstance(item, slice) */ - __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 689, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 689, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_11, 0, 0, 0); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __PYX_ERR(2, 689, __pyx_L1_error) + __PYX_ERR(2, 691, __pyx_L1_error) - /* "View.MemoryView":688 + /* "View.MemoryView":690 * have_slices = True * else: * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< @@ -21356,7 +21445,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { */ } - /* "View.MemoryView":691 + /* "View.MemoryView":693 * raise TypeError("Cannot index with type '%s'" % type(item)) * * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<< @@ -21375,18 +21464,18 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_L11_bool_binop_done:; __pyx_v_have_slices = __pyx_t_1; - /* "View.MemoryView":692 + /* "View.MemoryView":694 * * have_slices = have_slices or isinstance(item, slice) * result.append(item) # <<<<<<<<<<<<<< * * nslices = ndim - len(result) */ - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 692, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 694, __pyx_L1_error) } __pyx_L6:; - /* "View.MemoryView":679 + /* "View.MemoryView":681 * have_slices = False * seen_ellipsis = False * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< @@ -21397,17 +21486,17 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":694 + /* "View.MemoryView":696 * result.append(item) * * nslices = ndim - len(result) # <<<<<<<<<<<<<< * if nslices: * result.extend([slice(None)] * nslices) */ - __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 694, __pyx_L1_error) + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 696, __pyx_L1_error) __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); - /* "View.MemoryView":695 + /* "View.MemoryView":697 * * nslices = ndim - len(result) * if nslices: # <<<<<<<<<<<<<< @@ -21417,14 +21506,14 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_1 = (__pyx_v_nslices != 0); if (__pyx_t_1) { - /* "View.MemoryView":696 + /* "View.MemoryView":698 * nslices = ndim - len(result) * if nslices: * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< * * return have_slices or nslices, tuple(result) */ - __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 696, __pyx_L1_error) + __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { @@ -21433,10 +21522,10 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__17); } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 696, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 698, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":695 + /* "View.MemoryView":697 * * nslices = ndim - len(result) * if nslices: # <<<<<<<<<<<<<< @@ -21445,7 +21534,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { */ } - /* "View.MemoryView":698 + /* "View.MemoryView":700 * result.extend([slice(None)] * nslices) * * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<< @@ -21455,20 +21544,20 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __Pyx_XDECREF(__pyx_r); if (!__pyx_v_have_slices) { } else { - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L14_bool_binop_done; } - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; __pyx_L14_bool_binop_done:; - __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error) + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 698, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); @@ -21480,7 +21569,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_11 = 0; goto __pyx_L0; - /* "View.MemoryView":666 + /* "View.MemoryView":668 * return isinstance(o, memoryview) * * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< @@ -21506,7 +21595,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { return __pyx_r; } -/* "View.MemoryView":700 +/* "View.MemoryView":702 * return have_slices or nslices, tuple(result) * * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< @@ -21528,7 +21617,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("assert_direct_dimensions", 0); - /* "View.MemoryView":701 + /* "View.MemoryView":703 * * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<< @@ -21540,7 +21629,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ __pyx_t_1 = __pyx_t_3; __pyx_v_suboffset = (__pyx_t_1[0]); - /* "View.MemoryView":702 + /* "View.MemoryView":704 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: # <<<<<<<<<<<<<< @@ -21550,20 +21639,20 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0); if (unlikely(__pyx_t_4)) { - /* "View.MemoryView":703 + /* "View.MemoryView":705 * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 703, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(2, 703, __pyx_L1_error) + __PYX_ERR(2, 705, __pyx_L1_error) - /* "View.MemoryView":702 + /* "View.MemoryView":704 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: # <<<<<<<<<<<<<< @@ -21573,7 +21662,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ } } - /* "View.MemoryView":700 + /* "View.MemoryView":702 * return have_slices or nslices, tuple(result) * * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< @@ -21594,7 +21683,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ return __pyx_r; } -/* "View.MemoryView":710 +/* "View.MemoryView":712 * * @cname('__pyx_memview_slice') * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< @@ -21638,7 +21727,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("memview_slice", 0); - /* "View.MemoryView":711 + /* "View.MemoryView":713 * @cname('__pyx_memview_slice') * cdef memoryview memview_slice(memoryview memview, object indices): * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<< @@ -21648,7 +21737,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_v_new_ndim = 0; __pyx_v_suboffset_dim = -1; - /* "View.MemoryView":718 + /* "View.MemoryView":720 * * * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<< @@ -21657,7 +21746,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)))); - /* "View.MemoryView":722 + /* "View.MemoryView":724 * cdef _memoryviewslice memviewsliceobj * * assert memview.view.ndim > 0 # <<<<<<<<<<<<<< @@ -21668,12 +21757,12 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(2, 722, __pyx_L1_error) + __PYX_ERR(2, 724, __pyx_L1_error) } } #endif - /* "View.MemoryView":724 + /* "View.MemoryView":726 * assert memview.view.ndim > 0 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< @@ -21684,20 +21773,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":725 + /* "View.MemoryView":727 * * if isinstance(memview, _memoryviewslice): * memviewsliceobj = memview # <<<<<<<<<<<<<< * p_src = &memviewsliceobj.from_slice * else: */ - if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 725, __pyx_L1_error) + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 727, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":726 + /* "View.MemoryView":728 * if isinstance(memview, _memoryviewslice): * memviewsliceobj = memview * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<< @@ -21706,7 +21795,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice); - /* "View.MemoryView":724 + /* "View.MemoryView":726 * assert memview.view.ndim > 0 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< @@ -21716,7 +21805,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ goto __pyx_L3; } - /* "View.MemoryView":728 + /* "View.MemoryView":730 * p_src = &memviewsliceobj.from_slice * else: * slice_copy(memview, &src) # <<<<<<<<<<<<<< @@ -21726,7 +21815,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ /*else*/ { __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src)); - /* "View.MemoryView":729 + /* "View.MemoryView":731 * else: * slice_copy(memview, &src) * p_src = &src # <<<<<<<<<<<<<< @@ -21737,7 +21826,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ } __pyx_L3:; - /* "View.MemoryView":735 + /* "View.MemoryView":737 * * * dst.memview = p_src.memview # <<<<<<<<<<<<<< @@ -21747,7 +21836,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_t_4 = __pyx_v_p_src->memview; __pyx_v_dst.memview = __pyx_t_4; - /* "View.MemoryView":736 + /* "View.MemoryView":738 * * dst.memview = p_src.memview * dst.data = p_src.data # <<<<<<<<<<<<<< @@ -21757,7 +21846,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_t_5 = __pyx_v_p_src->data; __pyx_v_dst.data = __pyx_t_5; - /* "View.MemoryView":741 + /* "View.MemoryView":743 * * * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<< @@ -21766,7 +21855,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ __pyx_v_p_dst = (&__pyx_v_dst); - /* "View.MemoryView":742 + /* "View.MemoryView":744 * * cdef __Pyx_memviewslice *p_dst = &dst * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<< @@ -21775,7 +21864,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim); - /* "View.MemoryView":746 + /* "View.MemoryView":748 * cdef bint have_start, have_stop, have_step * * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< @@ -21787,26 +21876,26 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 748, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 748, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 748, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } @@ -21816,7 +21905,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(2, 746, __pyx_L1_error) + else __PYX_ERR(2, 748, __pyx_L1_error) } break; } @@ -21827,7 +21916,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_v_dim = __pyx_t_6; __pyx_t_6 = (__pyx_t_6 + 1); - /* "View.MemoryView":747 + /* "View.MemoryView":749 * * for dim, index in enumerate(indices): * if PyIndex_Check(index): # <<<<<<<<<<<<<< @@ -21837,25 +21926,25 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0); if (__pyx_t_2) { - /* "View.MemoryView":751 + /* "View.MemoryView":753 * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<< * 0, 0, 0, # have_{start,stop,step} * False) */ - __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 751, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 753, __pyx_L1_error) - /* "View.MemoryView":748 + /* "View.MemoryView":750 * for dim, index in enumerate(indices): * if PyIndex_Check(index): * slice_memviewslice( # <<<<<<<<<<<<<< * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 748, __pyx_L1_error) + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 750, __pyx_L1_error) - /* "View.MemoryView":747 + /* "View.MemoryView":749 * * for dim, index in enumerate(indices): * if PyIndex_Check(index): # <<<<<<<<<<<<<< @@ -21865,7 +21954,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ goto __pyx_L6; } - /* "View.MemoryView":754 + /* "View.MemoryView":756 * 0, 0, 0, # have_{start,stop,step} * False) * elif index is None: # <<<<<<<<<<<<<< @@ -21876,7 +21965,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "View.MemoryView":755 + /* "View.MemoryView":757 * False) * elif index is None: * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<< @@ -21885,7 +21974,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1; - /* "View.MemoryView":756 + /* "View.MemoryView":758 * elif index is None: * p_dst.shape[new_ndim] = 1 * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<< @@ -21894,7 +21983,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0; - /* "View.MemoryView":757 + /* "View.MemoryView":759 * p_dst.shape[new_ndim] = 1 * p_dst.strides[new_ndim] = 0 * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<< @@ -21903,7 +21992,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L; - /* "View.MemoryView":758 + /* "View.MemoryView":760 * p_dst.strides[new_ndim] = 0 * p_dst.suboffsets[new_ndim] = -1 * new_ndim += 1 # <<<<<<<<<<<<<< @@ -21912,7 +22001,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); - /* "View.MemoryView":754 + /* "View.MemoryView":756 * 0, 0, 0, # have_{start,stop,step} * False) * elif index is None: # <<<<<<<<<<<<<< @@ -21922,7 +22011,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ goto __pyx_L6; } - /* "View.MemoryView":760 + /* "View.MemoryView":762 * new_ndim += 1 * else: * start = index.start or 0 # <<<<<<<<<<<<<< @@ -21930,13 +22019,13 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * step = index.step or 0 */ /*else*/ { - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 760, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 762, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 760, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 762, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 760, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 762, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_bool_binop_done; @@ -21945,20 +22034,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_L7_bool_binop_done:; __pyx_v_start = __pyx_t_10; - /* "View.MemoryView":761 + /* "View.MemoryView":763 * else: * start = index.start or 0 * stop = index.stop or 0 # <<<<<<<<<<<<<< * step = index.step or 0 * */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 761, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 761, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 763, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 761, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 763, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_bool_binop_done; @@ -21967,20 +22056,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_L9_bool_binop_done:; __pyx_v_stop = __pyx_t_10; - /* "View.MemoryView":762 + /* "View.MemoryView":764 * start = index.start or 0 * stop = index.stop or 0 * step = index.step or 0 # <<<<<<<<<<<<<< * * have_start = index.start is not None */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 762, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 762, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 764, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 762, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 764, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L11_bool_binop_done; @@ -21989,55 +22078,55 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_L11_bool_binop_done:; __pyx_v_step = __pyx_t_10; - /* "View.MemoryView":764 + /* "View.MemoryView":766 * step = index.step or 0 * * have_start = index.start is not None # <<<<<<<<<<<<<< * have_stop = index.stop is not None * have_step = index.step is not None */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 764, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_have_start = __pyx_t_1; - /* "View.MemoryView":765 + /* "View.MemoryView":767 * * have_start = index.start is not None * have_stop = index.stop is not None # <<<<<<<<<<<<<< * have_step = index.step is not None * */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 765, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_have_stop = __pyx_t_1; - /* "View.MemoryView":766 + /* "View.MemoryView":768 * have_start = index.start is not None * have_stop = index.stop is not None * have_step = index.step is not None # <<<<<<<<<<<<<< * * slice_memviewslice( */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 766, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_have_step = __pyx_t_1; - /* "View.MemoryView":768 + /* "View.MemoryView":770 * have_step = index.step is not None * * slice_memviewslice( # <<<<<<<<<<<<<< * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 768, __pyx_L1_error) + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 770, __pyx_L1_error) - /* "View.MemoryView":774 + /* "View.MemoryView":776 * have_start, have_stop, have_step, * True) * new_ndim += 1 # <<<<<<<<<<<<<< @@ -22048,7 +22137,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ } __pyx_L6:; - /* "View.MemoryView":746 + /* "View.MemoryView":748 * cdef bint have_start, have_stop, have_step * * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< @@ -22058,7 +22147,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":776 + /* "View.MemoryView":778 * new_ndim += 1 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< @@ -22069,7 +22158,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":777 + /* "View.MemoryView":779 * * if isinstance(memview, _memoryviewslice): * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< @@ -22078,39 +22167,39 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ __Pyx_XDECREF(((PyObject *)__pyx_r)); - /* "View.MemoryView":778 + /* "View.MemoryView":780 * if isinstance(memview, _memoryviewslice): * return memoryview_fromslice(dst, new_ndim, * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<< * memviewsliceobj.to_dtype_func, * memview.dtype_is_object) */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 778, __pyx_L1_error) } + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 780, __pyx_L1_error) } - /* "View.MemoryView":779 + /* "View.MemoryView":781 * return memoryview_fromslice(dst, new_ndim, * memviewsliceobj.to_object_func, * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<< * memview.dtype_is_object) * else: */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 779, __pyx_L1_error) } + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 781, __pyx_L1_error) } - /* "View.MemoryView":777 + /* "View.MemoryView":779 * * if isinstance(memview, _memoryviewslice): * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< * memviewsliceobj.to_object_func, * memviewsliceobj.to_dtype_func, */ - __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 777, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 777, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 779, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "View.MemoryView":776 + /* "View.MemoryView":778 * new_ndim += 1 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< @@ -22119,7 +22208,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ } - /* "View.MemoryView":782 + /* "View.MemoryView":784 * memview.dtype_is_object) * else: * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< @@ -22129,30 +22218,30 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ /*else*/ { __Pyx_XDECREF(((PyObject *)__pyx_r)); - /* "View.MemoryView":783 + /* "View.MemoryView":785 * else: * return memoryview_fromslice(dst, new_ndim, NULL, NULL, * memview.dtype_is_object) # <<<<<<<<<<<<<< * * */ - __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 782, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "View.MemoryView":782 + /* "View.MemoryView":784 * memview.dtype_is_object) * else: * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< * memview.dtype_is_object) * */ - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 782, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 784, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; } - /* "View.MemoryView":710 + /* "View.MemoryView":712 * * @cname('__pyx_memview_slice') * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< @@ -22174,7 +22263,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ return __pyx_r; } -/* "View.MemoryView":807 +/* "View.MemoryView":809 * * @cname('__pyx_memoryview_slice_memviewslice') * cdef int slice_memviewslice( # <<<<<<<<<<<<<< @@ -22193,7 +22282,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, const char *__pyx_filename = NULL; int __pyx_clineno = 0; - /* "View.MemoryView":827 + /* "View.MemoryView":829 * cdef bint negative_step * * if not is_slice: # <<<<<<<<<<<<<< @@ -22203,7 +22292,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0); if (__pyx_t_1) { - /* "View.MemoryView":829 + /* "View.MemoryView":831 * if not is_slice: * * if start < 0: # <<<<<<<<<<<<<< @@ -22213,7 +22302,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_1 = ((__pyx_v_start < 0) != 0); if (__pyx_t_1) { - /* "View.MemoryView":830 + /* "View.MemoryView":832 * * if start < 0: * start += shape # <<<<<<<<<<<<<< @@ -22222,7 +22311,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_start = (__pyx_v_start + __pyx_v_shape); - /* "View.MemoryView":829 + /* "View.MemoryView":831 * if not is_slice: * * if start < 0: # <<<<<<<<<<<<<< @@ -22231,7 +22320,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":831 + /* "View.MemoryView":833 * if start < 0: * start += shape * if not 0 <= start < shape: # <<<<<<<<<<<<<< @@ -22245,16 +22334,16 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":832 + /* "View.MemoryView":834 * start += shape * if not 0 <= start < shape: * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<< * else: * */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 832, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 834, __pyx_L1_error) - /* "View.MemoryView":831 + /* "View.MemoryView":833 * if start < 0: * start += shape * if not 0 <= start < shape: # <<<<<<<<<<<<<< @@ -22263,7 +22352,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":827 + /* "View.MemoryView":829 * cdef bint negative_step * * if not is_slice: # <<<<<<<<<<<<<< @@ -22273,7 +22362,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L3; } - /* "View.MemoryView":835 + /* "View.MemoryView":837 * else: * * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<< @@ -22292,7 +22381,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_L6_bool_binop_done:; __pyx_v_negative_step = __pyx_t_2; - /* "View.MemoryView":837 + /* "View.MemoryView":839 * negative_step = have_step != 0 and step < 0 * * if have_step and step == 0: # <<<<<<<<<<<<<< @@ -22310,16 +22399,16 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_L9_bool_binop_done:; if (__pyx_t_2) { - /* "View.MemoryView":838 + /* "View.MemoryView":840 * * if have_step and step == 0: * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<< * * */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 838, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 840, __pyx_L1_error) - /* "View.MemoryView":837 + /* "View.MemoryView":839 * negative_step = have_step != 0 and step < 0 * * if have_step and step == 0: # <<<<<<<<<<<<<< @@ -22328,7 +22417,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":841 + /* "View.MemoryView":843 * * * if have_start: # <<<<<<<<<<<<<< @@ -22338,7 +22427,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = (__pyx_v_have_start != 0); if (__pyx_t_2) { - /* "View.MemoryView":842 + /* "View.MemoryView":844 * * if have_start: * if start < 0: # <<<<<<<<<<<<<< @@ -22348,7 +22437,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_start < 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":843 + /* "View.MemoryView":845 * if have_start: * if start < 0: * start += shape # <<<<<<<<<<<<<< @@ -22357,7 +22446,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_start = (__pyx_v_start + __pyx_v_shape); - /* "View.MemoryView":844 + /* "View.MemoryView":846 * if start < 0: * start += shape * if start < 0: # <<<<<<<<<<<<<< @@ -22367,7 +22456,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_start < 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":845 + /* "View.MemoryView":847 * start += shape * if start < 0: * start = 0 # <<<<<<<<<<<<<< @@ -22376,7 +22465,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_start = 0; - /* "View.MemoryView":844 + /* "View.MemoryView":846 * if start < 0: * start += shape * if start < 0: # <<<<<<<<<<<<<< @@ -22385,7 +22474,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":842 + /* "View.MemoryView":844 * * if have_start: * if start < 0: # <<<<<<<<<<<<<< @@ -22395,7 +22484,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L12; } - /* "View.MemoryView":846 + /* "View.MemoryView":848 * if start < 0: * start = 0 * elif start >= shape: # <<<<<<<<<<<<<< @@ -22405,7 +22494,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0); if (__pyx_t_2) { - /* "View.MemoryView":847 + /* "View.MemoryView":849 * start = 0 * elif start >= shape: * if negative_step: # <<<<<<<<<<<<<< @@ -22415,7 +22504,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = (__pyx_v_negative_step != 0); if (__pyx_t_2) { - /* "View.MemoryView":848 + /* "View.MemoryView":850 * elif start >= shape: * if negative_step: * start = shape - 1 # <<<<<<<<<<<<<< @@ -22424,7 +22513,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_start = (__pyx_v_shape - 1); - /* "View.MemoryView":847 + /* "View.MemoryView":849 * start = 0 * elif start >= shape: * if negative_step: # <<<<<<<<<<<<<< @@ -22434,7 +22523,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L14; } - /* "View.MemoryView":850 + /* "View.MemoryView":852 * start = shape - 1 * else: * start = shape # <<<<<<<<<<<<<< @@ -22446,7 +22535,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } __pyx_L14:; - /* "View.MemoryView":846 + /* "View.MemoryView":848 * if start < 0: * start = 0 * elif start >= shape: # <<<<<<<<<<<<<< @@ -22456,7 +22545,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } __pyx_L12:; - /* "View.MemoryView":841 + /* "View.MemoryView":843 * * * if have_start: # <<<<<<<<<<<<<< @@ -22466,7 +22555,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L11; } - /* "View.MemoryView":852 + /* "View.MemoryView":854 * start = shape * else: * if negative_step: # <<<<<<<<<<<<<< @@ -22477,7 +22566,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = (__pyx_v_negative_step != 0); if (__pyx_t_2) { - /* "View.MemoryView":853 + /* "View.MemoryView":855 * else: * if negative_step: * start = shape - 1 # <<<<<<<<<<<<<< @@ -22486,7 +22575,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_start = (__pyx_v_shape - 1); - /* "View.MemoryView":852 + /* "View.MemoryView":854 * start = shape * else: * if negative_step: # <<<<<<<<<<<<<< @@ -22496,7 +22585,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L15; } - /* "View.MemoryView":855 + /* "View.MemoryView":857 * start = shape - 1 * else: * start = 0 # <<<<<<<<<<<<<< @@ -22510,7 +22599,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } __pyx_L11:; - /* "View.MemoryView":857 + /* "View.MemoryView":859 * start = 0 * * if have_stop: # <<<<<<<<<<<<<< @@ -22520,7 +22609,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = (__pyx_v_have_stop != 0); if (__pyx_t_2) { - /* "View.MemoryView":858 + /* "View.MemoryView":860 * * if have_stop: * if stop < 0: # <<<<<<<<<<<<<< @@ -22530,7 +22619,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_stop < 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":859 + /* "View.MemoryView":861 * if have_stop: * if stop < 0: * stop += shape # <<<<<<<<<<<<<< @@ -22539,7 +22628,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape); - /* "View.MemoryView":860 + /* "View.MemoryView":862 * if stop < 0: * stop += shape * if stop < 0: # <<<<<<<<<<<<<< @@ -22549,7 +22638,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_stop < 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":861 + /* "View.MemoryView":863 * stop += shape * if stop < 0: * stop = 0 # <<<<<<<<<<<<<< @@ -22558,7 +22647,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_stop = 0; - /* "View.MemoryView":860 + /* "View.MemoryView":862 * if stop < 0: * stop += shape * if stop < 0: # <<<<<<<<<<<<<< @@ -22567,7 +22656,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":858 + /* "View.MemoryView":860 * * if have_stop: * if stop < 0: # <<<<<<<<<<<<<< @@ -22577,7 +22666,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L17; } - /* "View.MemoryView":862 + /* "View.MemoryView":864 * if stop < 0: * stop = 0 * elif stop > shape: # <<<<<<<<<<<<<< @@ -22587,7 +22676,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0); if (__pyx_t_2) { - /* "View.MemoryView":863 + /* "View.MemoryView":865 * stop = 0 * elif stop > shape: * stop = shape # <<<<<<<<<<<<<< @@ -22596,7 +22685,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_stop = __pyx_v_shape; - /* "View.MemoryView":862 + /* "View.MemoryView":864 * if stop < 0: * stop = 0 * elif stop > shape: # <<<<<<<<<<<<<< @@ -22606,7 +22695,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } __pyx_L17:; - /* "View.MemoryView":857 + /* "View.MemoryView":859 * start = 0 * * if have_stop: # <<<<<<<<<<<<<< @@ -22616,7 +22705,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L16; } - /* "View.MemoryView":865 + /* "View.MemoryView":867 * stop = shape * else: * if negative_step: # <<<<<<<<<<<<<< @@ -22627,7 +22716,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = (__pyx_v_negative_step != 0); if (__pyx_t_2) { - /* "View.MemoryView":866 + /* "View.MemoryView":868 * else: * if negative_step: * stop = -1 # <<<<<<<<<<<<<< @@ -22636,7 +22725,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_stop = -1L; - /* "View.MemoryView":865 + /* "View.MemoryView":867 * stop = shape * else: * if negative_step: # <<<<<<<<<<<<<< @@ -22646,7 +22735,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L19; } - /* "View.MemoryView":868 + /* "View.MemoryView":870 * stop = -1 * else: * stop = shape # <<<<<<<<<<<<<< @@ -22660,7 +22749,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } __pyx_L16:; - /* "View.MemoryView":870 + /* "View.MemoryView":872 * stop = shape * * if not have_step: # <<<<<<<<<<<<<< @@ -22670,7 +22759,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":871 + /* "View.MemoryView":873 * * if not have_step: * step = 1 # <<<<<<<<<<<<<< @@ -22679,7 +22768,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_step = 1; - /* "View.MemoryView":870 + /* "View.MemoryView":872 * stop = shape * * if not have_step: # <<<<<<<<<<<<<< @@ -22688,7 +22777,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":875 + /* "View.MemoryView":877 * * with cython.cdivision(True): * new_shape = (stop - start) // step # <<<<<<<<<<<<<< @@ -22697,7 +22786,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step); - /* "View.MemoryView":877 + /* "View.MemoryView":879 * new_shape = (stop - start) // step * * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< @@ -22707,7 +22796,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":878 + /* "View.MemoryView":880 * * if (stop - start) - step * new_shape: * new_shape += 1 # <<<<<<<<<<<<<< @@ -22716,7 +22805,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_new_shape = (__pyx_v_new_shape + 1); - /* "View.MemoryView":877 + /* "View.MemoryView":879 * new_shape = (stop - start) // step * * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< @@ -22725,7 +22814,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":880 + /* "View.MemoryView":882 * new_shape += 1 * * if new_shape < 0: # <<<<<<<<<<<<<< @@ -22735,7 +22824,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":881 + /* "View.MemoryView":883 * * if new_shape < 0: * new_shape = 0 # <<<<<<<<<<<<<< @@ -22744,7 +22833,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_new_shape = 0; - /* "View.MemoryView":880 + /* "View.MemoryView":882 * new_shape += 1 * * if new_shape < 0: # <<<<<<<<<<<<<< @@ -22753,7 +22842,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":884 + /* "View.MemoryView":886 * * * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<< @@ -22762,7 +22851,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step); - /* "View.MemoryView":885 + /* "View.MemoryView":887 * * dst.strides[new_ndim] = stride * step * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<< @@ -22771,7 +22860,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape; - /* "View.MemoryView":886 + /* "View.MemoryView":888 * dst.strides[new_ndim] = stride * step * dst.shape[new_ndim] = new_shape * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<< @@ -22782,7 +22871,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } __pyx_L3:; - /* "View.MemoryView":889 + /* "View.MemoryView":891 * * * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< @@ -22792,7 +22881,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":890 + /* "View.MemoryView":892 * * if suboffset_dim[0] < 0: * dst.data += start * stride # <<<<<<<<<<<<<< @@ -22801,7 +22890,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride)); - /* "View.MemoryView":889 + /* "View.MemoryView":891 * * * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< @@ -22811,7 +22900,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L23; } - /* "View.MemoryView":892 + /* "View.MemoryView":894 * dst.data += start * stride * else: * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<< @@ -22824,7 +22913,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } __pyx_L23:; - /* "View.MemoryView":894 + /* "View.MemoryView":896 * dst.suboffsets[suboffset_dim[0]] += start * stride * * if suboffset >= 0: # <<<<<<<<<<<<<< @@ -22834,7 +22923,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":895 + /* "View.MemoryView":897 * * if suboffset >= 0: * if not is_slice: # <<<<<<<<<<<<<< @@ -22844,7 +22933,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":896 + /* "View.MemoryView":898 * if suboffset >= 0: * if not is_slice: * if new_ndim == 0: # <<<<<<<<<<<<<< @@ -22854,7 +22943,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":897 + /* "View.MemoryView":899 * if not is_slice: * if new_ndim == 0: * dst.data = ( dst.data)[0] + suboffset # <<<<<<<<<<<<<< @@ -22863,7 +22952,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset); - /* "View.MemoryView":896 + /* "View.MemoryView":898 * if suboffset >= 0: * if not is_slice: * if new_ndim == 0: # <<<<<<<<<<<<<< @@ -22873,7 +22962,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L26; } - /* "View.MemoryView":899 + /* "View.MemoryView":901 * dst.data = ( dst.data)[0] + suboffset * else: * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<< @@ -22882,18 +22971,18 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ /*else*/ { - /* "View.MemoryView":900 + /* "View.MemoryView":902 * else: * _err_dim(IndexError, "All dimensions preceding dimension %d " * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<< * else: * suboffset_dim[0] = new_ndim */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 899, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 901, __pyx_L1_error) } __pyx_L26:; - /* "View.MemoryView":895 + /* "View.MemoryView":897 * * if suboffset >= 0: * if not is_slice: # <<<<<<<<<<<<<< @@ -22903,7 +22992,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L25; } - /* "View.MemoryView":902 + /* "View.MemoryView":904 * "must be indexed and not sliced", dim) * else: * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<< @@ -22915,7 +23004,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } __pyx_L25:; - /* "View.MemoryView":894 + /* "View.MemoryView":896 * dst.suboffsets[suboffset_dim[0]] += start * stride * * if suboffset >= 0: # <<<<<<<<<<<<<< @@ -22924,7 +23013,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":904 + /* "View.MemoryView":906 * suboffset_dim[0] = new_ndim * * return 0 # <<<<<<<<<<<<<< @@ -22934,7 +23023,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_r = 0; goto __pyx_L0; - /* "View.MemoryView":807 + /* "View.MemoryView":809 * * @cname('__pyx_memoryview_slice_memviewslice') * cdef int slice_memviewslice( # <<<<<<<<<<<<<< @@ -22958,7 +23047,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, return __pyx_r; } -/* "View.MemoryView":910 +/* "View.MemoryView":912 * * @cname('__pyx_pybuffer_index') * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< @@ -22983,7 +23072,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pybuffer_index", 0); - /* "View.MemoryView":912 + /* "View.MemoryView":914 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, * Py_ssize_t dim) except NULL: * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<< @@ -22992,7 +23081,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ __pyx_v_suboffset = -1L; - /* "View.MemoryView":913 + /* "View.MemoryView":915 * Py_ssize_t dim) except NULL: * cdef Py_ssize_t shape, stride, suboffset = -1 * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<< @@ -23002,7 +23091,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P __pyx_t_1 = __pyx_v_view->itemsize; __pyx_v_itemsize = __pyx_t_1; - /* "View.MemoryView":916 + /* "View.MemoryView":918 * cdef char *resultp * * if view.ndim == 0: # <<<<<<<<<<<<<< @@ -23012,7 +23101,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":917 + /* "View.MemoryView":919 * * if view.ndim == 0: * shape = view.len / itemsize # <<<<<<<<<<<<<< @@ -23021,15 +23110,15 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(2, 917, __pyx_L1_error) + __PYX_ERR(2, 919, __pyx_L1_error) } else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) { PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); - __PYX_ERR(2, 917, __pyx_L1_error) + __PYX_ERR(2, 919, __pyx_L1_error) } __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); - /* "View.MemoryView":918 + /* "View.MemoryView":920 * if view.ndim == 0: * shape = view.len / itemsize * stride = itemsize # <<<<<<<<<<<<<< @@ -23038,7 +23127,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ __pyx_v_stride = __pyx_v_itemsize; - /* "View.MemoryView":916 + /* "View.MemoryView":918 * cdef char *resultp * * if view.ndim == 0: # <<<<<<<<<<<<<< @@ -23048,7 +23137,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P goto __pyx_L3; } - /* "View.MemoryView":920 + /* "View.MemoryView":922 * stride = itemsize * else: * shape = view.shape[dim] # <<<<<<<<<<<<<< @@ -23058,7 +23147,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P /*else*/ { __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]); - /* "View.MemoryView":921 + /* "View.MemoryView":923 * else: * shape = view.shape[dim] * stride = view.strides[dim] # <<<<<<<<<<<<<< @@ -23067,7 +23156,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]); - /* "View.MemoryView":922 + /* "View.MemoryView":924 * shape = view.shape[dim] * stride = view.strides[dim] * if view.suboffsets != NULL: # <<<<<<<<<<<<<< @@ -23077,7 +23166,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0); if (__pyx_t_2) { - /* "View.MemoryView":923 + /* "View.MemoryView":925 * stride = view.strides[dim] * if view.suboffsets != NULL: * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<< @@ -23086,7 +23175,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]); - /* "View.MemoryView":922 + /* "View.MemoryView":924 * shape = view.shape[dim] * stride = view.strides[dim] * if view.suboffsets != NULL: # <<<<<<<<<<<<<< @@ -23097,7 +23186,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P } __pyx_L3:; - /* "View.MemoryView":925 + /* "View.MemoryView":927 * suboffset = view.suboffsets[dim] * * if index < 0: # <<<<<<<<<<<<<< @@ -23107,7 +23196,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P __pyx_t_2 = ((__pyx_v_index < 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":926 + /* "View.MemoryView":928 * * if index < 0: * index += view.shape[dim] # <<<<<<<<<<<<<< @@ -23116,7 +23205,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim])); - /* "View.MemoryView":927 + /* "View.MemoryView":929 * if index < 0: * index += view.shape[dim] * if index < 0: # <<<<<<<<<<<<<< @@ -23126,26 +23215,26 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P __pyx_t_2 = ((__pyx_v_index < 0) != 0); if (unlikely(__pyx_t_2)) { - /* "View.MemoryView":928 + /* "View.MemoryView":930 * index += view.shape[dim] * if index < 0: * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< * * if index >= shape: */ - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 928, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 928, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 928, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 928, __pyx_L1_error) + __PYX_ERR(2, 930, __pyx_L1_error) - /* "View.MemoryView":927 + /* "View.MemoryView":929 * if index < 0: * index += view.shape[dim] * if index < 0: # <<<<<<<<<<<<<< @@ -23154,7 +23243,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ } - /* "View.MemoryView":925 + /* "View.MemoryView":927 * suboffset = view.suboffsets[dim] * * if index < 0: # <<<<<<<<<<<<<< @@ -23163,7 +23252,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ } - /* "View.MemoryView":930 + /* "View.MemoryView":932 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) * * if index >= shape: # <<<<<<<<<<<<<< @@ -23173,26 +23262,26 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0); if (unlikely(__pyx_t_2)) { - /* "View.MemoryView":931 + /* "View.MemoryView":933 * * if index >= shape: * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< * * resultp = bufp + index * stride */ - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 931, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 933, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 931, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 933, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 931, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 933, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 931, __pyx_L1_error) + __PYX_ERR(2, 933, __pyx_L1_error) - /* "View.MemoryView":930 + /* "View.MemoryView":932 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) * * if index >= shape: # <<<<<<<<<<<<<< @@ -23201,7 +23290,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ } - /* "View.MemoryView":933 + /* "View.MemoryView":935 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) * * resultp = bufp + index * stride # <<<<<<<<<<<<<< @@ -23210,7 +23299,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride)); - /* "View.MemoryView":934 + /* "View.MemoryView":936 * * resultp = bufp + index * stride * if suboffset >= 0: # <<<<<<<<<<<<<< @@ -23220,7 +23309,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":935 + /* "View.MemoryView":937 * resultp = bufp + index * stride * if suboffset >= 0: * resultp = ( resultp)[0] + suboffset # <<<<<<<<<<<<<< @@ -23229,7 +23318,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset); - /* "View.MemoryView":934 + /* "View.MemoryView":936 * * resultp = bufp + index * stride * if suboffset >= 0: # <<<<<<<<<<<<<< @@ -23238,7 +23327,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ } - /* "View.MemoryView":937 + /* "View.MemoryView":939 * resultp = ( resultp)[0] + suboffset * * return resultp # <<<<<<<<<<<<<< @@ -23248,7 +23337,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P __pyx_r = __pyx_v_resultp; goto __pyx_L0; - /* "View.MemoryView":910 + /* "View.MemoryView":912 * * @cname('__pyx_pybuffer_index') * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< @@ -23267,7 +23356,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P return __pyx_r; } -/* "View.MemoryView":943 +/* "View.MemoryView":945 * * @cname('__pyx_memslice_transpose') * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< @@ -23295,7 +23384,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { const char *__pyx_filename = NULL; int __pyx_clineno = 0; - /* "View.MemoryView":944 + /* "View.MemoryView":946 * @cname('__pyx_memslice_transpose') * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<< @@ -23305,7 +23394,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { __pyx_t_1 = __pyx_v_memslice->memview->view.ndim; __pyx_v_ndim = __pyx_t_1; - /* "View.MemoryView":946 + /* "View.MemoryView":948 * cdef int ndim = memslice.memview.view.ndim * * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<< @@ -23315,7 +23404,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { __pyx_t_2 = __pyx_v_memslice->shape; __pyx_v_shape = __pyx_t_2; - /* "View.MemoryView":947 + /* "View.MemoryView":949 * * cdef Py_ssize_t *shape = memslice.shape * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<< @@ -23325,7 +23414,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { __pyx_t_2 = __pyx_v_memslice->strides; __pyx_v_strides = __pyx_t_2; - /* "View.MemoryView":951 + /* "View.MemoryView":953 * * cdef int i, j * for i in range(ndim / 2): # <<<<<<<<<<<<<< @@ -23337,7 +23426,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "View.MemoryView":952 + /* "View.MemoryView":954 * cdef int i, j * for i in range(ndim / 2): * j = ndim - 1 - i # <<<<<<<<<<<<<< @@ -23346,7 +23435,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { */ __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i); - /* "View.MemoryView":953 + /* "View.MemoryView":955 * for i in range(ndim / 2): * j = ndim - 1 - i * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<< @@ -23358,7 +23447,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5; (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6; - /* "View.MemoryView":954 + /* "View.MemoryView":956 * j = ndim - 1 - i * strides[i], strides[j] = strides[j], strides[i] * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<< @@ -23370,7 +23459,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6; (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5; - /* "View.MemoryView":956 + /* "View.MemoryView":958 * shape[i], shape[j] = shape[j], shape[i] * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< @@ -23388,16 +23477,16 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { __pyx_L6_bool_binop_done:; if (__pyx_t_7) { - /* "View.MemoryView":957 + /* "View.MemoryView":959 * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<< * * return 1 */ - __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 957, __pyx_L1_error) + __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 959, __pyx_L1_error) - /* "View.MemoryView":956 + /* "View.MemoryView":958 * shape[i], shape[j] = shape[j], shape[i] * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< @@ -23407,7 +23496,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { } } - /* "View.MemoryView":959 + /* "View.MemoryView":961 * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") * * return 1 # <<<<<<<<<<<<<< @@ -23417,7 +23506,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { __pyx_r = 1; goto __pyx_L0; - /* "View.MemoryView":943 + /* "View.MemoryView":945 * * @cname('__pyx_memslice_transpose') * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< @@ -23441,7 +23530,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { return __pyx_r; } -/* "View.MemoryView":976 +/* "View.MemoryView":978 * cdef int (*to_dtype_func)(char *, object) except 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -23464,7 +23553,7 @@ static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewsl __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "View.MemoryView":977 + /* "View.MemoryView":979 * * def __dealloc__(self): * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<< @@ -23473,7 +23562,7 @@ static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewsl */ __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1); - /* "View.MemoryView":976 + /* "View.MemoryView":978 * cdef int (*to_dtype_func)(char *, object) except 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -23485,7 +23574,7 @@ static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewsl __Pyx_RefNannyFinishContext(); } -/* "View.MemoryView":979 +/* "View.MemoryView":981 * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< @@ -23503,7 +23592,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor int __pyx_clineno = 0; __Pyx_RefNannySetupContext("convert_item_to_object", 0); - /* "View.MemoryView":980 + /* "View.MemoryView":982 * * cdef convert_item_to_object(self, char *itemp): * if self.to_object_func != NULL: # <<<<<<<<<<<<<< @@ -23513,7 +23602,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0); if (__pyx_t_1) { - /* "View.MemoryView":981 + /* "View.MemoryView":983 * cdef convert_item_to_object(self, char *itemp): * if self.to_object_func != NULL: * return self.to_object_func(itemp) # <<<<<<<<<<<<<< @@ -23521,13 +23610,13 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor * return memoryview.convert_item_to_object(self, itemp) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 981, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":980 + /* "View.MemoryView":982 * * cdef convert_item_to_object(self, char *itemp): * if self.to_object_func != NULL: # <<<<<<<<<<<<<< @@ -23536,7 +23625,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor */ } - /* "View.MemoryView":983 + /* "View.MemoryView":985 * return self.to_object_func(itemp) * else: * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<< @@ -23545,14 +23634,14 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 983, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } - /* "View.MemoryView":979 + /* "View.MemoryView":981 * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< @@ -23571,7 +23660,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor return __pyx_r; } -/* "View.MemoryView":985 +/* "View.MemoryView":987 * return memoryview.convert_item_to_object(self, itemp) * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< @@ -23590,7 +23679,7 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo int __pyx_clineno = 0; __Pyx_RefNannySetupContext("assign_item_from_object", 0); - /* "View.MemoryView":986 + /* "View.MemoryView":988 * * cdef assign_item_from_object(self, char *itemp, object value): * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< @@ -23600,16 +23689,16 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0); if (__pyx_t_1) { - /* "View.MemoryView":987 + /* "View.MemoryView":989 * cdef assign_item_from_object(self, char *itemp, object value): * if self.to_dtype_func != NULL: * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<< * else: * memoryview.assign_item_from_object(self, itemp, value) */ - __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 987, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 989, __pyx_L1_error) - /* "View.MemoryView":986 + /* "View.MemoryView":988 * * cdef assign_item_from_object(self, char *itemp, object value): * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< @@ -23619,7 +23708,7 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo goto __pyx_L3; } - /* "View.MemoryView":989 + /* "View.MemoryView":991 * self.to_dtype_func(itemp, value) * else: * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<< @@ -23627,13 +23716,13 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo * @property */ /*else*/ { - __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 989, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 991, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L3:; - /* "View.MemoryView":985 + /* "View.MemoryView":987 * return memoryview.convert_item_to_object(self, itemp) * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< @@ -23654,7 +23743,7 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo return __pyx_r; } -/* "View.MemoryView":992 +/* "View.MemoryView":994 * * @property * def base(self): # <<<<<<<<<<<<<< @@ -23680,7 +23769,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":993 + /* "View.MemoryView":995 * @property * def base(self): * return self.from_object # <<<<<<<<<<<<<< @@ -23692,7 +23781,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__ __pyx_r = __pyx_v_self->from_object; goto __pyx_L0; - /* "View.MemoryView":992 + /* "View.MemoryView":994 * * @property * def base(self): # <<<<<<<<<<<<<< @@ -23820,7 +23909,7 @@ static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUS return __pyx_r; } -/* "View.MemoryView":999 +/* "View.MemoryView":1001 * * @cname('__pyx_memoryview_fromslice') * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< @@ -23848,7 +23937,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl int __pyx_clineno = 0; __Pyx_RefNannySetupContext("memoryview_fromslice", 0); - /* "View.MemoryView":1007 + /* "View.MemoryView":1009 * cdef _memoryviewslice result * * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< @@ -23858,7 +23947,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0); if (__pyx_t_1) { - /* "View.MemoryView":1008 + /* "View.MemoryView":1010 * * if memviewslice.memview == Py_None: * return None # <<<<<<<<<<<<<< @@ -23869,7 +23958,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "View.MemoryView":1007 + /* "View.MemoryView":1009 * cdef _memoryviewslice result * * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< @@ -23878,16 +23967,16 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ } - /* "View.MemoryView":1013 + /* "View.MemoryView":1015 * * * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<< * * result.from_slice = memviewslice */ - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1013, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1015, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1013, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1015, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -23898,13 +23987,13 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1013, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1015, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":1015 + /* "View.MemoryView":1017 * result = _memoryviewslice(None, 0, dtype_is_object) * * result.from_slice = memviewslice # <<<<<<<<<<<<<< @@ -23913,7 +24002,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->from_slice = __pyx_v_memviewslice; - /* "View.MemoryView":1016 + /* "View.MemoryView":1018 * * result.from_slice = memviewslice * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<< @@ -23922,14 +24011,14 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1); - /* "View.MemoryView":1018 + /* "View.MemoryView":1020 * __PYX_INC_MEMVIEW(&memviewslice, 1) * * result.from_object = ( memviewslice.memview).base # <<<<<<<<<<<<<< * result.typeinfo = memviewslice.memview.typeinfo * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1018, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1020, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_result->from_object); @@ -23937,7 +24026,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_v_result->from_object = __pyx_t_2; __pyx_t_2 = 0; - /* "View.MemoryView":1019 + /* "View.MemoryView":1021 * * result.from_object = ( memviewslice.memview).base * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<< @@ -23947,7 +24036,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo; __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4; - /* "View.MemoryView":1021 + /* "View.MemoryView":1023 * result.typeinfo = memviewslice.memview.typeinfo * * result.view = memviewslice.memview.view # <<<<<<<<<<<<<< @@ -23957,7 +24046,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_5 = __pyx_v_memviewslice.memview->view; __pyx_v_result->__pyx_base.view = __pyx_t_5; - /* "View.MemoryView":1022 + /* "View.MemoryView":1024 * * result.view = memviewslice.memview.view * result.view.buf = memviewslice.data # <<<<<<<<<<<<<< @@ -23966,7 +24055,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data); - /* "View.MemoryView":1023 + /* "View.MemoryView":1025 * result.view = memviewslice.memview.view * result.view.buf = memviewslice.data * result.view.ndim = ndim # <<<<<<<<<<<<<< @@ -23975,7 +24064,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim; - /* "View.MemoryView":1024 + /* "View.MemoryView":1026 * result.view.buf = memviewslice.data * result.view.ndim = ndim * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<< @@ -23984,7 +24073,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None; - /* "View.MemoryView":1025 + /* "View.MemoryView":1027 * result.view.ndim = ndim * (<__pyx_buffer *> &result.view).obj = Py_None * Py_INCREF(Py_None) # <<<<<<<<<<<<<< @@ -23993,7 +24082,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ Py_INCREF(Py_None); - /* "View.MemoryView":1027 + /* "View.MemoryView":1029 * Py_INCREF(Py_None) * * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<< @@ -24003,7 +24092,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0); if (__pyx_t_1) { - /* "View.MemoryView":1028 + /* "View.MemoryView":1030 * * if (memviewslice.memview).flags & PyBUF_WRITABLE: * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<< @@ -24012,7 +24101,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS; - /* "View.MemoryView":1027 + /* "View.MemoryView":1029 * Py_INCREF(Py_None) * * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<< @@ -24022,7 +24111,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl goto __pyx_L4; } - /* "View.MemoryView":1030 + /* "View.MemoryView":1032 * result.flags = PyBUF_RECORDS * else: * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<< @@ -24034,7 +24123,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl } __pyx_L4:; - /* "View.MemoryView":1032 + /* "View.MemoryView":1034 * result.flags = PyBUF_RECORDS_RO * * result.view.shape = result.from_slice.shape # <<<<<<<<<<<<<< @@ -24043,7 +24132,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape); - /* "View.MemoryView":1033 + /* "View.MemoryView":1035 * * result.view.shape = result.from_slice.shape * result.view.strides = result.from_slice.strides # <<<<<<<<<<<<<< @@ -24052,7 +24141,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides); - /* "View.MemoryView":1036 + /* "View.MemoryView":1038 * * * result.view.suboffsets = NULL # <<<<<<<<<<<<<< @@ -24061,7 +24150,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->__pyx_base.view.suboffsets = NULL; - /* "View.MemoryView":1037 + /* "View.MemoryView":1039 * * result.view.suboffsets = NULL * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<< @@ -24073,7 +24162,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_6 = __pyx_t_8; __pyx_v_suboffset = (__pyx_t_6[0]); - /* "View.MemoryView":1038 + /* "View.MemoryView":1040 * result.view.suboffsets = NULL * for suboffset in result.from_slice.suboffsets[:ndim]: * if suboffset >= 0: # <<<<<<<<<<<<<< @@ -24083,7 +24172,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0); if (__pyx_t_1) { - /* "View.MemoryView":1039 + /* "View.MemoryView":1041 * for suboffset in result.from_slice.suboffsets[:ndim]: * if suboffset >= 0: * result.view.suboffsets = result.from_slice.suboffsets # <<<<<<<<<<<<<< @@ -24092,7 +24181,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets); - /* "View.MemoryView":1040 + /* "View.MemoryView":1042 * if suboffset >= 0: * result.view.suboffsets = result.from_slice.suboffsets * break # <<<<<<<<<<<<<< @@ -24101,7 +24190,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ goto __pyx_L6_break; - /* "View.MemoryView":1038 + /* "View.MemoryView":1040 * result.view.suboffsets = NULL * for suboffset in result.from_slice.suboffsets[:ndim]: * if suboffset >= 0: # <<<<<<<<<<<<<< @@ -24112,7 +24201,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl } __pyx_L6_break:; - /* "View.MemoryView":1042 + /* "View.MemoryView":1044 * break * * result.view.len = result.view.itemsize # <<<<<<<<<<<<<< @@ -24122,7 +24211,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize; __pyx_v_result->__pyx_base.view.len = __pyx_t_9; - /* "View.MemoryView":1043 + /* "View.MemoryView":1045 * * result.view.len = result.view.itemsize * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<< @@ -24132,29 +24221,29 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim); for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { __pyx_t_6 = __pyx_t_8; - __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1043, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1045, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":1044 + /* "View.MemoryView":1046 * result.view.len = result.view.itemsize * for length in result.view.shape[:ndim]: * result.view.len *= length # <<<<<<<<<<<<<< * * result.to_object_func = to_object_func */ - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1044, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1046, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1044, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1046, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1044, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1046, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result->__pyx_base.view.len = __pyx_t_9; } - /* "View.MemoryView":1046 + /* "View.MemoryView":1048 * result.view.len *= length * * result.to_object_func = to_object_func # <<<<<<<<<<<<<< @@ -24163,7 +24252,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->to_object_func = __pyx_v_to_object_func; - /* "View.MemoryView":1047 + /* "View.MemoryView":1049 * * result.to_object_func = to_object_func * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<< @@ -24172,7 +24261,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func; - /* "View.MemoryView":1049 + /* "View.MemoryView":1051 * result.to_dtype_func = to_dtype_func * * return result # <<<<<<<<<<<<<< @@ -24184,7 +24273,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; - /* "View.MemoryView":999 + /* "View.MemoryView":1001 * * @cname('__pyx_memoryview_fromslice') * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< @@ -24206,7 +24295,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl return __pyx_r; } -/* "View.MemoryView":1052 +/* "View.MemoryView":1054 * * @cname('__pyx_memoryview_get_slice_from_memoryview') * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< @@ -24226,7 +24315,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_slice_from_memview", 0); - /* "View.MemoryView":1055 + /* "View.MemoryView":1057 * __Pyx_memviewslice *mslice) except NULL: * cdef _memoryviewslice obj * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< @@ -24237,20 +24326,20 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":1056 + /* "View.MemoryView":1058 * cdef _memoryviewslice obj * if isinstance(memview, _memoryviewslice): * obj = memview # <<<<<<<<<<<<<< * return &obj.from_slice * else: */ - if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1056, __pyx_L1_error) + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1058, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":1057 + /* "View.MemoryView":1059 * if isinstance(memview, _memoryviewslice): * obj = memview * return &obj.from_slice # <<<<<<<<<<<<<< @@ -24260,7 +24349,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p __pyx_r = (&__pyx_v_obj->from_slice); goto __pyx_L0; - /* "View.MemoryView":1055 + /* "View.MemoryView":1057 * __Pyx_memviewslice *mslice) except NULL: * cdef _memoryviewslice obj * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< @@ -24269,7 +24358,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p */ } - /* "View.MemoryView":1059 + /* "View.MemoryView":1061 * return &obj.from_slice * else: * slice_copy(memview, mslice) # <<<<<<<<<<<<<< @@ -24279,7 +24368,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p /*else*/ { __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice); - /* "View.MemoryView":1060 + /* "View.MemoryView":1062 * else: * slice_copy(memview, mslice) * return mslice # <<<<<<<<<<<<<< @@ -24290,7 +24379,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p goto __pyx_L0; } - /* "View.MemoryView":1052 + /* "View.MemoryView":1054 * * @cname('__pyx_memoryview_get_slice_from_memoryview') * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< @@ -24309,7 +24398,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p return __pyx_r; } -/* "View.MemoryView":1063 +/* "View.MemoryView":1065 * * @cname('__pyx_memoryview_slice_copy') * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< @@ -24330,7 +24419,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem Py_ssize_t __pyx_t_5; __Pyx_RefNannySetupContext("slice_copy", 0); - /* "View.MemoryView":1067 + /* "View.MemoryView":1069 * cdef (Py_ssize_t*) shape, strides, suboffsets * * shape = memview.view.shape # <<<<<<<<<<<<<< @@ -24340,7 +24429,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem __pyx_t_1 = __pyx_v_memview->view.shape; __pyx_v_shape = __pyx_t_1; - /* "View.MemoryView":1068 + /* "View.MemoryView":1070 * * shape = memview.view.shape * strides = memview.view.strides # <<<<<<<<<<<<<< @@ -24350,7 +24439,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem __pyx_t_1 = __pyx_v_memview->view.strides; __pyx_v_strides = __pyx_t_1; - /* "View.MemoryView":1069 + /* "View.MemoryView":1071 * shape = memview.view.shape * strides = memview.view.strides * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<< @@ -24360,7 +24449,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem __pyx_t_1 = __pyx_v_memview->view.suboffsets; __pyx_v_suboffsets = __pyx_t_1; - /* "View.MemoryView":1071 + /* "View.MemoryView":1073 * suboffsets = memview.view.suboffsets * * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<< @@ -24369,7 +24458,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem */ __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview); - /* "View.MemoryView":1072 + /* "View.MemoryView":1074 * * dst.memview = <__pyx_memoryview *> memview * dst.data = memview.view.buf # <<<<<<<<<<<<<< @@ -24378,7 +24467,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem */ __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf); - /* "View.MemoryView":1074 + /* "View.MemoryView":1076 * dst.data = memview.view.buf * * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<< @@ -24390,7 +24479,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_dim = __pyx_t_4; - /* "View.MemoryView":1075 + /* "View.MemoryView":1077 * * for dim in range(memview.view.ndim): * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<< @@ -24399,7 +24488,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem */ (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]); - /* "View.MemoryView":1076 + /* "View.MemoryView":1078 * for dim in range(memview.view.ndim): * dst.shape[dim] = shape[dim] * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<< @@ -24408,7 +24497,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem */ (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]); - /* "View.MemoryView":1077 + /* "View.MemoryView":1079 * dst.shape[dim] = shape[dim] * dst.strides[dim] = strides[dim] * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<< @@ -24423,7 +24512,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5; } - /* "View.MemoryView":1063 + /* "View.MemoryView":1065 * * @cname('__pyx_memoryview_slice_copy') * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< @@ -24435,7 +24524,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem __Pyx_RefNannyFinishContext(); } -/* "View.MemoryView":1080 +/* "View.MemoryView":1082 * * @cname('__pyx_memoryview_copy_object') * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< @@ -24453,7 +24542,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("memoryview_copy", 0); - /* "View.MemoryView":1083 + /* "View.MemoryView":1085 * "Create a new memoryview object" * cdef __Pyx_memviewslice memviewslice * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<< @@ -24462,7 +24551,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx */ __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice)); - /* "View.MemoryView":1084 + /* "View.MemoryView":1086 * cdef __Pyx_memviewslice memviewslice * slice_copy(memview, &memviewslice) * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<< @@ -24470,13 +24559,13 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx * @cname('__pyx_memoryview_copy_object_from_slice') */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1084, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1086, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "View.MemoryView":1080 + /* "View.MemoryView":1082 * * @cname('__pyx_memoryview_copy_object') * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< @@ -24495,7 +24584,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx return __pyx_r; } -/* "View.MemoryView":1087 +/* "View.MemoryView":1089 * * @cname('__pyx_memoryview_copy_object_from_slice') * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< @@ -24518,7 +24607,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview int __pyx_clineno = 0; __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0); - /* "View.MemoryView":1094 + /* "View.MemoryView":1096 * cdef int (*to_dtype_func)(char *, object) except 0 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< @@ -24529,7 +24618,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":1095 + /* "View.MemoryView":1097 * * if isinstance(memview, _memoryviewslice): * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<< @@ -24539,7 +24628,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func; __pyx_v_to_object_func = __pyx_t_3; - /* "View.MemoryView":1096 + /* "View.MemoryView":1098 * if isinstance(memview, _memoryviewslice): * to_object_func = (<_memoryviewslice> memview).to_object_func * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<< @@ -24549,7 +24638,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func; __pyx_v_to_dtype_func = __pyx_t_4; - /* "View.MemoryView":1094 + /* "View.MemoryView":1096 * cdef int (*to_dtype_func)(char *, object) except 0 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< @@ -24559,7 +24648,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview goto __pyx_L3; } - /* "View.MemoryView":1098 + /* "View.MemoryView":1100 * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func * else: * to_object_func = NULL # <<<<<<<<<<<<<< @@ -24569,7 +24658,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview /*else*/ { __pyx_v_to_object_func = NULL; - /* "View.MemoryView":1099 + /* "View.MemoryView":1101 * else: * to_object_func = NULL * to_dtype_func = NULL # <<<<<<<<<<<<<< @@ -24580,7 +24669,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview } __pyx_L3:; - /* "View.MemoryView":1101 + /* "View.MemoryView":1103 * to_dtype_func = NULL * * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<< @@ -24589,20 +24678,20 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview */ __Pyx_XDECREF(__pyx_r); - /* "View.MemoryView":1103 + /* "View.MemoryView":1105 * return memoryview_fromslice(memviewslice[0], memview.view.ndim, * to_object_func, to_dtype_func, * memview.dtype_is_object) # <<<<<<<<<<<<<< * * */ - __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1101, __pyx_L1_error) + __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - /* "View.MemoryView":1087 + /* "View.MemoryView":1089 * * @cname('__pyx_memoryview_copy_object_from_slice') * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< @@ -24621,7 +24710,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview return __pyx_r; } -/* "View.MemoryView":1109 +/* "View.MemoryView":1111 * * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< @@ -24633,7 +24722,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { Py_ssize_t __pyx_r; int __pyx_t_1; - /* "View.MemoryView":1110 + /* "View.MemoryView":1112 * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: * if arg < 0: # <<<<<<<<<<<<<< @@ -24643,7 +24732,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { __pyx_t_1 = ((__pyx_v_arg < 0) != 0); if (__pyx_t_1) { - /* "View.MemoryView":1111 + /* "View.MemoryView":1113 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: * if arg < 0: * return -arg # <<<<<<<<<<<<<< @@ -24653,7 +24742,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { __pyx_r = (-__pyx_v_arg); goto __pyx_L0; - /* "View.MemoryView":1110 + /* "View.MemoryView":1112 * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: * if arg < 0: # <<<<<<<<<<<<<< @@ -24662,7 +24751,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { */ } - /* "View.MemoryView":1113 + /* "View.MemoryView":1115 * return -arg * else: * return arg # <<<<<<<<<<<<<< @@ -24674,7 +24763,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { goto __pyx_L0; } - /* "View.MemoryView":1109 + /* "View.MemoryView":1111 * * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< @@ -24687,7 +24776,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { return __pyx_r; } -/* "View.MemoryView":1116 +/* "View.MemoryView":1118 * * @cname('__pyx_get_best_slice_order') * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< @@ -24705,7 +24794,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ int __pyx_t_3; int __pyx_t_4; - /* "View.MemoryView":1121 + /* "View.MemoryView":1123 * """ * cdef int i * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<< @@ -24714,7 +24803,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ */ __pyx_v_c_stride = 0; - /* "View.MemoryView":1122 + /* "View.MemoryView":1124 * cdef int i * cdef Py_ssize_t c_stride = 0 * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<< @@ -24723,7 +24812,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ */ __pyx_v_f_stride = 0; - /* "View.MemoryView":1124 + /* "View.MemoryView":1126 * cdef Py_ssize_t f_stride = 0 * * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< @@ -24733,7 +24822,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { __pyx_v_i = __pyx_t_1; - /* "View.MemoryView":1125 + /* "View.MemoryView":1127 * * for i in range(ndim - 1, -1, -1): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< @@ -24743,7 +24832,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1126 + /* "View.MemoryView":1128 * for i in range(ndim - 1, -1, -1): * if mslice.shape[i] > 1: * c_stride = mslice.strides[i] # <<<<<<<<<<<<<< @@ -24752,7 +24841,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ */ __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]); - /* "View.MemoryView":1127 + /* "View.MemoryView":1129 * if mslice.shape[i] > 1: * c_stride = mslice.strides[i] * break # <<<<<<<<<<<<<< @@ -24761,7 +24850,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ */ goto __pyx_L4_break; - /* "View.MemoryView":1125 + /* "View.MemoryView":1127 * * for i in range(ndim - 1, -1, -1): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< @@ -24772,7 +24861,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ } __pyx_L4_break:; - /* "View.MemoryView":1129 + /* "View.MemoryView":1131 * break * * for i in range(ndim): # <<<<<<<<<<<<<< @@ -24784,7 +24873,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "View.MemoryView":1130 + /* "View.MemoryView":1132 * * for i in range(ndim): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< @@ -24794,7 +24883,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1131 + /* "View.MemoryView":1133 * for i in range(ndim): * if mslice.shape[i] > 1: * f_stride = mslice.strides[i] # <<<<<<<<<<<<<< @@ -24803,7 +24892,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ */ __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]); - /* "View.MemoryView":1132 + /* "View.MemoryView":1134 * if mslice.shape[i] > 1: * f_stride = mslice.strides[i] * break # <<<<<<<<<<<<<< @@ -24812,7 +24901,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ */ goto __pyx_L7_break; - /* "View.MemoryView":1130 + /* "View.MemoryView":1132 * * for i in range(ndim): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< @@ -24823,7 +24912,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ } __pyx_L7_break:; - /* "View.MemoryView":1134 + /* "View.MemoryView":1136 * break * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< @@ -24833,7 +24922,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1135 + /* "View.MemoryView":1137 * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): * return 'C' # <<<<<<<<<<<<<< @@ -24843,7 +24932,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ __pyx_r = 'C'; goto __pyx_L0; - /* "View.MemoryView":1134 + /* "View.MemoryView":1136 * break * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< @@ -24852,7 +24941,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ */ } - /* "View.MemoryView":1137 + /* "View.MemoryView":1139 * return 'C' * else: * return 'F' # <<<<<<<<<<<<<< @@ -24864,7 +24953,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ goto __pyx_L0; } - /* "View.MemoryView":1116 + /* "View.MemoryView":1118 * * @cname('__pyx_get_best_slice_order') * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< @@ -24877,7 +24966,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ return __pyx_r; } -/* "View.MemoryView":1140 +/* "View.MemoryView":1142 * * @cython.cdivision(True) * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< @@ -24898,7 +24987,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v Py_ssize_t __pyx_t_5; Py_ssize_t __pyx_t_6; - /* "View.MemoryView":1147 + /* "View.MemoryView":1149 * * cdef Py_ssize_t i * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<< @@ -24907,7 +24996,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ __pyx_v_src_extent = (__pyx_v_src_shape[0]); - /* "View.MemoryView":1148 + /* "View.MemoryView":1150 * cdef Py_ssize_t i * cdef Py_ssize_t src_extent = src_shape[0] * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<< @@ -24916,7 +25005,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ __pyx_v_dst_extent = (__pyx_v_dst_shape[0]); - /* "View.MemoryView":1149 + /* "View.MemoryView":1151 * cdef Py_ssize_t src_extent = src_shape[0] * cdef Py_ssize_t dst_extent = dst_shape[0] * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<< @@ -24925,7 +25014,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ __pyx_v_src_stride = (__pyx_v_src_strides[0]); - /* "View.MemoryView":1150 + /* "View.MemoryView":1152 * cdef Py_ssize_t dst_extent = dst_shape[0] * cdef Py_ssize_t src_stride = src_strides[0] * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<< @@ -24934,7 +25023,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ __pyx_v_dst_stride = (__pyx_v_dst_strides[0]); - /* "View.MemoryView":1152 + /* "View.MemoryView":1154 * cdef Py_ssize_t dst_stride = dst_strides[0] * * if ndim == 1: # <<<<<<<<<<<<<< @@ -24944,7 +25033,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); if (__pyx_t_1) { - /* "View.MemoryView":1153 + /* "View.MemoryView":1155 * * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< @@ -24964,7 +25053,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v goto __pyx_L5_bool_binop_done; } - /* "View.MemoryView":1154 + /* "View.MemoryView":1156 * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and * src_stride == itemsize == dst_stride): # <<<<<<<<<<<<<< @@ -24979,7 +25068,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v __pyx_t_1 = __pyx_t_3; __pyx_L5_bool_binop_done:; - /* "View.MemoryView":1153 + /* "View.MemoryView":1155 * * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< @@ -24988,7 +25077,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ if (__pyx_t_1) { - /* "View.MemoryView":1155 + /* "View.MemoryView":1157 * if (src_stride > 0 and dst_stride > 0 and * src_stride == itemsize == dst_stride): * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<< @@ -24997,7 +25086,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent))); - /* "View.MemoryView":1153 + /* "View.MemoryView":1155 * * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< @@ -25007,7 +25096,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v goto __pyx_L4; } - /* "View.MemoryView":1157 + /* "View.MemoryView":1159 * memcpy(dst_data, src_data, itemsize * dst_extent) * else: * for i in range(dst_extent): # <<<<<<<<<<<<<< @@ -25020,7 +25109,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "View.MemoryView":1158 + /* "View.MemoryView":1160 * else: * for i in range(dst_extent): * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<< @@ -25029,7 +25118,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize)); - /* "View.MemoryView":1159 + /* "View.MemoryView":1161 * for i in range(dst_extent): * memcpy(dst_data, src_data, itemsize) * src_data += src_stride # <<<<<<<<<<<<<< @@ -25038,7 +25127,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); - /* "View.MemoryView":1160 + /* "View.MemoryView":1162 * memcpy(dst_data, src_data, itemsize) * src_data += src_stride * dst_data += dst_stride # <<<<<<<<<<<<<< @@ -25050,7 +25139,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v } __pyx_L4:; - /* "View.MemoryView":1152 + /* "View.MemoryView":1154 * cdef Py_ssize_t dst_stride = dst_strides[0] * * if ndim == 1: # <<<<<<<<<<<<<< @@ -25060,7 +25149,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v goto __pyx_L3; } - /* "View.MemoryView":1162 + /* "View.MemoryView":1164 * dst_data += dst_stride * else: * for i in range(dst_extent): # <<<<<<<<<<<<<< @@ -25073,7 +25162,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "View.MemoryView":1163 + /* "View.MemoryView":1165 * else: * for i in range(dst_extent): * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<< @@ -25082,7 +25171,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize); - /* "View.MemoryView":1167 + /* "View.MemoryView":1169 * src_shape + 1, dst_shape + 1, * ndim - 1, itemsize) * src_data += src_stride # <<<<<<<<<<<<<< @@ -25091,7 +25180,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); - /* "View.MemoryView":1168 + /* "View.MemoryView":1170 * ndim - 1, itemsize) * src_data += src_stride * dst_data += dst_stride # <<<<<<<<<<<<<< @@ -25103,7 +25192,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v } __pyx_L3:; - /* "View.MemoryView":1140 + /* "View.MemoryView":1142 * * @cython.cdivision(True) * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< @@ -25114,7 +25203,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v /* function exit code */ } -/* "View.MemoryView":1170 +/* "View.MemoryView":1172 * dst_data += dst_stride * * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< @@ -25124,7 +25213,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) { - /* "View.MemoryView":1173 + /* "View.MemoryView":1175 * __Pyx_memviewslice *dst, * int ndim, size_t itemsize) nogil: * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<< @@ -25133,7 +25222,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi */ _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize); - /* "View.MemoryView":1170 + /* "View.MemoryView":1172 * dst_data += dst_stride * * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< @@ -25144,7 +25233,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi /* function exit code */ } -/* "View.MemoryView":1177 +/* "View.MemoryView":1179 * * @cname('__pyx_memoryview_slice_get_size') * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< @@ -25161,7 +25250,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr Py_ssize_t *__pyx_t_3; Py_ssize_t *__pyx_t_4; - /* "View.MemoryView":1179 + /* "View.MemoryView":1181 * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: * "Return the size of the memory occupied by the slice in number of bytes" * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<< @@ -25171,7 +25260,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr __pyx_t_1 = __pyx_v_src->memview->view.itemsize; __pyx_v_size = __pyx_t_1; - /* "View.MemoryView":1181 + /* "View.MemoryView":1183 * cdef Py_ssize_t shape, size = src.memview.view.itemsize * * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<< @@ -25183,7 +25272,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr __pyx_t_2 = __pyx_t_4; __pyx_v_shape = (__pyx_t_2[0]); - /* "View.MemoryView":1182 + /* "View.MemoryView":1184 * * for shape in src.shape[:ndim]: * size *= shape # <<<<<<<<<<<<<< @@ -25193,7 +25282,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr __pyx_v_size = (__pyx_v_size * __pyx_v_shape); } - /* "View.MemoryView":1184 + /* "View.MemoryView":1186 * size *= shape * * return size # <<<<<<<<<<<<<< @@ -25203,7 +25292,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr __pyx_r = __pyx_v_size; goto __pyx_L0; - /* "View.MemoryView":1177 + /* "View.MemoryView":1179 * * @cname('__pyx_memoryview_slice_get_size') * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< @@ -25216,7 +25305,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr return __pyx_r; } -/* "View.MemoryView":1187 +/* "View.MemoryView":1189 * * @cname('__pyx_fill_contig_strides_array') * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< @@ -25232,7 +25321,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ int __pyx_t_3; int __pyx_t_4; - /* "View.MemoryView":1196 + /* "View.MemoryView":1198 * cdef int idx * * if order == 'F': # <<<<<<<<<<<<<< @@ -25242,7 +25331,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ __pyx_t_1 = ((__pyx_v_order == 'F') != 0); if (__pyx_t_1) { - /* "View.MemoryView":1197 + /* "View.MemoryView":1199 * * if order == 'F': * for idx in range(ndim): # <<<<<<<<<<<<<< @@ -25254,7 +25343,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_idx = __pyx_t_4; - /* "View.MemoryView":1198 + /* "View.MemoryView":1200 * if order == 'F': * for idx in range(ndim): * strides[idx] = stride # <<<<<<<<<<<<<< @@ -25263,7 +25352,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ */ (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; - /* "View.MemoryView":1199 + /* "View.MemoryView":1201 * for idx in range(ndim): * strides[idx] = stride * stride *= shape[idx] # <<<<<<<<<<<<<< @@ -25273,7 +25362,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); } - /* "View.MemoryView":1196 + /* "View.MemoryView":1198 * cdef int idx * * if order == 'F': # <<<<<<<<<<<<<< @@ -25283,7 +25372,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ goto __pyx_L3; } - /* "View.MemoryView":1201 + /* "View.MemoryView":1203 * stride *= shape[idx] * else: * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< @@ -25294,7 +25383,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) { __pyx_v_idx = __pyx_t_2; - /* "View.MemoryView":1202 + /* "View.MemoryView":1204 * else: * for idx in range(ndim - 1, -1, -1): * strides[idx] = stride # <<<<<<<<<<<<<< @@ -25303,7 +25392,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ */ (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; - /* "View.MemoryView":1203 + /* "View.MemoryView":1205 * for idx in range(ndim - 1, -1, -1): * strides[idx] = stride * stride *= shape[idx] # <<<<<<<<<<<<<< @@ -25315,7 +25404,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ } __pyx_L3:; - /* "View.MemoryView":1205 + /* "View.MemoryView":1207 * stride *= shape[idx] * * return stride # <<<<<<<<<<<<<< @@ -25325,7 +25414,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ __pyx_r = __pyx_v_stride; goto __pyx_L0; - /* "View.MemoryView":1187 + /* "View.MemoryView":1189 * * @cname('__pyx_fill_contig_strides_array') * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< @@ -25338,7 +25427,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ return __pyx_r; } -/* "View.MemoryView":1208 +/* "View.MemoryView":1210 * * @cname('__pyx_memoryview_copy_data_to_temp') * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< @@ -25362,7 +25451,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, const char *__pyx_filename = NULL; int __pyx_clineno = 0; - /* "View.MemoryView":1219 + /* "View.MemoryView":1221 * cdef void *result * * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< @@ -25372,7 +25461,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_t_1 = __pyx_v_src->memview->view.itemsize; __pyx_v_itemsize = __pyx_t_1; - /* "View.MemoryView":1220 + /* "View.MemoryView":1222 * * cdef size_t itemsize = src.memview.view.itemsize * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<< @@ -25381,7 +25470,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, */ __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim); - /* "View.MemoryView":1222 + /* "View.MemoryView":1224 * cdef size_t size = slice_get_size(src, ndim) * * result = malloc(size) # <<<<<<<<<<<<<< @@ -25390,7 +25479,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, */ __pyx_v_result = malloc(__pyx_v_size); - /* "View.MemoryView":1223 + /* "View.MemoryView":1225 * * result = malloc(size) * if not result: # <<<<<<<<<<<<<< @@ -25400,16 +25489,16 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1224 + /* "View.MemoryView":1226 * result = malloc(size) * if not result: * _err(MemoryError, NULL) # <<<<<<<<<<<<<< * * */ - __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 1224, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 1226, __pyx_L1_error) - /* "View.MemoryView":1223 + /* "View.MemoryView":1225 * * result = malloc(size) * if not result: # <<<<<<<<<<<<<< @@ -25418,7 +25507,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, */ } - /* "View.MemoryView":1227 + /* "View.MemoryView":1229 * * * tmpslice.data = result # <<<<<<<<<<<<<< @@ -25427,7 +25516,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, */ __pyx_v_tmpslice->data = ((char *)__pyx_v_result); - /* "View.MemoryView":1228 + /* "View.MemoryView":1230 * * tmpslice.data = result * tmpslice.memview = src.memview # <<<<<<<<<<<<<< @@ -25437,7 +25526,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_t_4 = __pyx_v_src->memview; __pyx_v_tmpslice->memview = __pyx_t_4; - /* "View.MemoryView":1229 + /* "View.MemoryView":1231 * tmpslice.data = result * tmpslice.memview = src.memview * for i in range(ndim): # <<<<<<<<<<<<<< @@ -25449,7 +25538,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "View.MemoryView":1230 + /* "View.MemoryView":1232 * tmpslice.memview = src.memview * for i in range(ndim): * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<< @@ -25458,7 +25547,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, */ (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]); - /* "View.MemoryView":1231 + /* "View.MemoryView":1233 * for i in range(ndim): * tmpslice.shape[i] = src.shape[i] * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< @@ -25468,7 +25557,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L; } - /* "View.MemoryView":1233 + /* "View.MemoryView":1235 * tmpslice.suboffsets[i] = -1 * * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<< @@ -25477,7 +25566,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, */ (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order)); - /* "View.MemoryView":1237 + /* "View.MemoryView":1239 * * * for i in range(ndim): # <<<<<<<<<<<<<< @@ -25489,7 +25578,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "View.MemoryView":1238 + /* "View.MemoryView":1240 * * for i in range(ndim): * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< @@ -25499,7 +25588,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1239 + /* "View.MemoryView":1241 * for i in range(ndim): * if tmpslice.shape[i] == 1: * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<< @@ -25508,7 +25597,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, */ (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0; - /* "View.MemoryView":1238 + /* "View.MemoryView":1240 * * for i in range(ndim): * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< @@ -25518,7 +25607,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, } } - /* "View.MemoryView":1241 + /* "View.MemoryView":1243 * tmpslice.strides[i] = 0 * * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< @@ -25528,7 +25617,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1242 + /* "View.MemoryView":1244 * * if slice_is_contig(src[0], order, ndim): * memcpy(result, src.data, size) # <<<<<<<<<<<<<< @@ -25537,7 +25626,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, */ (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size)); - /* "View.MemoryView":1241 + /* "View.MemoryView":1243 * tmpslice.strides[i] = 0 * * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< @@ -25547,7 +25636,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, goto __pyx_L9; } - /* "View.MemoryView":1244 + /* "View.MemoryView":1246 * memcpy(result, src.data, size) * else: * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<< @@ -25559,7 +25648,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, } __pyx_L9:; - /* "View.MemoryView":1246 + /* "View.MemoryView":1248 * copy_strided_to_strided(src, tmpslice, ndim, itemsize) * * return result # <<<<<<<<<<<<<< @@ -25569,7 +25658,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_r = __pyx_v_result; goto __pyx_L0; - /* "View.MemoryView":1208 + /* "View.MemoryView":1210 * * @cname('__pyx_memoryview_copy_data_to_temp') * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< @@ -25593,7 +25682,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, return __pyx_r; } -/* "View.MemoryView":1251 +/* "View.MemoryView":1253 * * @cname('__pyx_memoryview_err_extents') * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< @@ -25616,20 +25705,20 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent #endif __Pyx_RefNannySetupContext("_err_extents", 0); - /* "View.MemoryView":1254 + /* "View.MemoryView":1256 * Py_ssize_t extent2) except -1 with gil: * raise ValueError("got differing extents in dimension %d (got %d and %d)" % * (i, extent1, extent2)) # <<<<<<<<<<<<<< * * @cname('__pyx_memoryview_err_dim') */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1254, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1254, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1254, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1254, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); @@ -25641,24 +25730,24 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent __pyx_t_2 = 0; __pyx_t_3 = 0; - /* "View.MemoryView":1253 + /* "View.MemoryView":1255 * cdef int _err_extents(int i, Py_ssize_t extent1, * Py_ssize_t extent2) except -1 with gil: * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<< * (i, extent1, extent2)) * */ - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1253, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1253, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(2, 1253, __pyx_L1_error) + __PYX_ERR(2, 1255, __pyx_L1_error) - /* "View.MemoryView":1251 + /* "View.MemoryView":1253 * * @cname('__pyx_memoryview_err_extents') * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< @@ -25681,7 +25770,7 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent return __pyx_r; } -/* "View.MemoryView":1257 +/* "View.MemoryView":1259 * * @cname('__pyx_memoryview_err_dim') * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< @@ -25705,18 +25794,18 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, __Pyx_RefNannySetupContext("_err_dim", 0); __Pyx_INCREF(__pyx_v_error); - /* "View.MemoryView":1258 + /* "View.MemoryView":1260 * @cname('__pyx_memoryview_err_dim') * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<< * * @cname('__pyx_memoryview_err') */ - __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1258, __pyx_L1_error) + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1258, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1258, __pyx_L1_error) + __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1260, __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; @@ -25734,14 +25823,14 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1258, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(2, 1258, __pyx_L1_error) + __PYX_ERR(2, 1260, __pyx_L1_error) - /* "View.MemoryView":1257 + /* "View.MemoryView":1259 * * @cname('__pyx_memoryview_err_dim') * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< @@ -25765,7 +25854,7 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, return __pyx_r; } -/* "View.MemoryView":1261 +/* "View.MemoryView":1263 * * @cname('__pyx_memoryview_err') * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< @@ -25790,7 +25879,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { __Pyx_RefNannySetupContext("_err", 0); __Pyx_INCREF(__pyx_v_error); - /* "View.MemoryView":1262 + /* "View.MemoryView":1264 * @cname('__pyx_memoryview_err') * cdef int _err(object error, char *msg) except -1 with gil: * if msg != NULL: # <<<<<<<<<<<<<< @@ -25800,14 +25889,14 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { __pyx_t_1 = ((__pyx_v_msg != NULL) != 0); if (unlikely(__pyx_t_1)) { - /* "View.MemoryView":1263 + /* "View.MemoryView":1265 * cdef int _err(object error, char *msg) except -1 with gil: * if msg != NULL: * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<< * else: * raise error */ - __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1263, __pyx_L1_error) + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_error); __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; @@ -25823,14 +25912,14 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1263, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(2, 1263, __pyx_L1_error) + __PYX_ERR(2, 1265, __pyx_L1_error) - /* "View.MemoryView":1262 + /* "View.MemoryView":1264 * @cname('__pyx_memoryview_err') * cdef int _err(object error, char *msg) except -1 with gil: * if msg != NULL: # <<<<<<<<<<<<<< @@ -25839,7 +25928,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { */ } - /* "View.MemoryView":1265 + /* "View.MemoryView":1267 * raise error(msg.decode('ascii')) * else: * raise error # <<<<<<<<<<<<<< @@ -25848,10 +25937,10 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { */ /*else*/ { __Pyx_Raise(__pyx_v_error, 0, 0, 0); - __PYX_ERR(2, 1265, __pyx_L1_error) + __PYX_ERR(2, 1267, __pyx_L1_error) } - /* "View.MemoryView":1261 + /* "View.MemoryView":1263 * * @cname('__pyx_memoryview_err') * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< @@ -25875,7 +25964,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { return __pyx_r; } -/* "View.MemoryView":1268 +/* "View.MemoryView":1270 * * @cname('__pyx_memoryview_copy_contents') * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< @@ -25905,7 +25994,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; - /* "View.MemoryView":1276 + /* "View.MemoryView":1278 * Check for overlapping memory and verify the shapes. * """ * cdef void *tmpdata = NULL # <<<<<<<<<<<<<< @@ -25914,7 +26003,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_tmpdata = NULL; - /* "View.MemoryView":1277 + /* "View.MemoryView":1279 * """ * cdef void *tmpdata = NULL * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< @@ -25924,7 +26013,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_1 = __pyx_v_src.memview->view.itemsize; __pyx_v_itemsize = __pyx_t_1; - /* "View.MemoryView":1279 + /* "View.MemoryView":1281 * cdef size_t itemsize = src.memview.view.itemsize * cdef int i * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<< @@ -25933,7 +26022,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim); - /* "View.MemoryView":1280 + /* "View.MemoryView":1282 * cdef int i * cdef char order = get_best_order(&src, src_ndim) * cdef bint broadcasting = False # <<<<<<<<<<<<<< @@ -25942,7 +26031,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_broadcasting = 0; - /* "View.MemoryView":1281 + /* "View.MemoryView":1283 * cdef char order = get_best_order(&src, src_ndim) * cdef bint broadcasting = False * cdef bint direct_copy = False # <<<<<<<<<<<<<< @@ -25951,7 +26040,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_direct_copy = 0; - /* "View.MemoryView":1284 + /* "View.MemoryView":1286 * cdef __Pyx_memviewslice tmp * * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< @@ -25961,7 +26050,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1285 + /* "View.MemoryView":1287 * * if src_ndim < dst_ndim: * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<< @@ -25970,7 +26059,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim); - /* "View.MemoryView":1284 + /* "View.MemoryView":1286 * cdef __Pyx_memviewslice tmp * * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< @@ -25980,7 +26069,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ goto __pyx_L3; } - /* "View.MemoryView":1286 + /* "View.MemoryView":1288 * if src_ndim < dst_ndim: * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< @@ -25990,7 +26079,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1287 + /* "View.MemoryView":1289 * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<< @@ -25999,7 +26088,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim); - /* "View.MemoryView":1286 + /* "View.MemoryView":1288 * if src_ndim < dst_ndim: * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< @@ -26009,7 +26098,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ } __pyx_L3:; - /* "View.MemoryView":1289 + /* "View.MemoryView":1291 * broadcast_leading(&dst, dst_ndim, src_ndim) * * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<< @@ -26025,7 +26114,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ } __pyx_v_ndim = __pyx_t_5; - /* "View.MemoryView":1291 + /* "View.MemoryView":1293 * cdef int ndim = max(src_ndim, dst_ndim) * * for i in range(ndim): # <<<<<<<<<<<<<< @@ -26037,7 +26126,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "View.MemoryView":1292 + /* "View.MemoryView":1294 * * for i in range(ndim): * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< @@ -26047,7 +26136,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1293 + /* "View.MemoryView":1295 * for i in range(ndim): * if src.shape[i] != dst.shape[i]: * if src.shape[i] == 1: # <<<<<<<<<<<<<< @@ -26057,7 +26146,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1294 + /* "View.MemoryView":1296 * if src.shape[i] != dst.shape[i]: * if src.shape[i] == 1: * broadcasting = True # <<<<<<<<<<<<<< @@ -26066,7 +26155,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_broadcasting = 1; - /* "View.MemoryView":1295 + /* "View.MemoryView":1297 * if src.shape[i] == 1: * broadcasting = True * src.strides[i] = 0 # <<<<<<<<<<<<<< @@ -26075,7 +26164,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ (__pyx_v_src.strides[__pyx_v_i]) = 0; - /* "View.MemoryView":1293 + /* "View.MemoryView":1295 * for i in range(ndim): * if src.shape[i] != dst.shape[i]: * if src.shape[i] == 1: # <<<<<<<<<<<<<< @@ -26085,7 +26174,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ goto __pyx_L7; } - /* "View.MemoryView":1297 + /* "View.MemoryView":1299 * src.strides[i] = 0 * else: * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<< @@ -26093,11 +26182,11 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * if src.suboffsets[i] >= 0: */ /*else*/ { - __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1297, __pyx_L1_error) + __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1299, __pyx_L1_error) } __pyx_L7:; - /* "View.MemoryView":1292 + /* "View.MemoryView":1294 * * for i in range(ndim): * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< @@ -26106,7 +26195,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ } - /* "View.MemoryView":1299 + /* "View.MemoryView":1301 * _err_extents(i, dst.shape[i], src.shape[i]) * * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< @@ -26116,16 +26205,16 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1300 + /* "View.MemoryView":1302 * * if src.suboffsets[i] >= 0: * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<< * * if slices_overlap(&src, &dst, ndim, itemsize): */ - __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1300, __pyx_L1_error) + __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1302, __pyx_L1_error) - /* "View.MemoryView":1299 + /* "View.MemoryView":1301 * _err_extents(i, dst.shape[i], src.shape[i]) * * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< @@ -26135,7 +26224,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ } } - /* "View.MemoryView":1302 + /* "View.MemoryView":1304 * _err_dim(ValueError, "Dimension %d is not direct", i) * * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< @@ -26145,7 +26234,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1304 + /* "View.MemoryView":1306 * if slices_overlap(&src, &dst, ndim, itemsize): * * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< @@ -26155,7 +26244,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1305 + /* "View.MemoryView":1307 * * if not slice_is_contig(src, order, ndim): * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<< @@ -26164,7 +26253,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim); - /* "View.MemoryView":1304 + /* "View.MemoryView":1306 * if slices_overlap(&src, &dst, ndim, itemsize): * * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< @@ -26173,17 +26262,17 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ } - /* "View.MemoryView":1307 + /* "View.MemoryView":1309 * order = get_best_order(&dst, ndim) * * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<< * src = tmp * */ - __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(2, 1307, __pyx_L1_error) + __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(2, 1309, __pyx_L1_error) __pyx_v_tmpdata = __pyx_t_7; - /* "View.MemoryView":1308 + /* "View.MemoryView":1310 * * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) * src = tmp # <<<<<<<<<<<<<< @@ -26192,7 +26281,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_src = __pyx_v_tmp; - /* "View.MemoryView":1302 + /* "View.MemoryView":1304 * _err_dim(ValueError, "Dimension %d is not direct", i) * * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< @@ -26201,7 +26290,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ } - /* "View.MemoryView":1310 + /* "View.MemoryView":1312 * src = tmp * * if not broadcasting: # <<<<<<<<<<<<<< @@ -26211,7 +26300,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1313 + /* "View.MemoryView":1315 * * * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< @@ -26221,7 +26310,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1314 + /* "View.MemoryView":1316 * * if slice_is_contig(src, 'C', ndim): * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<< @@ -26230,7 +26319,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim); - /* "View.MemoryView":1313 + /* "View.MemoryView":1315 * * * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< @@ -26240,7 +26329,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ goto __pyx_L12; } - /* "View.MemoryView":1315 + /* "View.MemoryView":1317 * if slice_is_contig(src, 'C', ndim): * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< @@ -26250,7 +26339,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1316 + /* "View.MemoryView":1318 * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<< @@ -26259,7 +26348,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim); - /* "View.MemoryView":1315 + /* "View.MemoryView":1317 * if slice_is_contig(src, 'C', ndim): * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< @@ -26269,7 +26358,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ } __pyx_L12:; - /* "View.MemoryView":1318 + /* "View.MemoryView":1320 * direct_copy = slice_is_contig(dst, 'F', ndim) * * if direct_copy: # <<<<<<<<<<<<<< @@ -26279,7 +26368,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = (__pyx_v_direct_copy != 0); if (__pyx_t_2) { - /* "View.MemoryView":1320 + /* "View.MemoryView":1322 * if direct_copy: * * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< @@ -26288,7 +26377,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); - /* "View.MemoryView":1321 + /* "View.MemoryView":1323 * * refcount_copying(&dst, dtype_is_object, ndim, False) * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<< @@ -26297,7 +26386,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim))); - /* "View.MemoryView":1322 + /* "View.MemoryView":1324 * refcount_copying(&dst, dtype_is_object, ndim, False) * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< @@ -26306,7 +26395,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); - /* "View.MemoryView":1323 + /* "View.MemoryView":1325 * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) * refcount_copying(&dst, dtype_is_object, ndim, True) * free(tmpdata) # <<<<<<<<<<<<<< @@ -26315,7 +26404,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ free(__pyx_v_tmpdata); - /* "View.MemoryView":1324 + /* "View.MemoryView":1326 * refcount_copying(&dst, dtype_is_object, ndim, True) * free(tmpdata) * return 0 # <<<<<<<<<<<<<< @@ -26325,7 +26414,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_r = 0; goto __pyx_L0; - /* "View.MemoryView":1318 + /* "View.MemoryView":1320 * direct_copy = slice_is_contig(dst, 'F', ndim) * * if direct_copy: # <<<<<<<<<<<<<< @@ -26334,7 +26423,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ } - /* "View.MemoryView":1310 + /* "View.MemoryView":1312 * src = tmp * * if not broadcasting: # <<<<<<<<<<<<<< @@ -26343,7 +26432,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ } - /* "View.MemoryView":1326 + /* "View.MemoryView":1328 * return 0 * * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< @@ -26357,25 +26446,25 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_8 = (__pyx_t_2 != 0); if (__pyx_t_8) { - /* "View.MemoryView":1329 + /* "View.MemoryView":1331 * * * transpose_memslice(&src) # <<<<<<<<<<<<<< * transpose_memslice(&dst) * */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1329, __pyx_L1_error) + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1331, __pyx_L1_error) - /* "View.MemoryView":1330 + /* "View.MemoryView":1332 * * transpose_memslice(&src) * transpose_memslice(&dst) # <<<<<<<<<<<<<< * * refcount_copying(&dst, dtype_is_object, ndim, False) */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1330, __pyx_L1_error) + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1332, __pyx_L1_error) - /* "View.MemoryView":1326 + /* "View.MemoryView":1328 * return 0 * * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< @@ -26384,7 +26473,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ } - /* "View.MemoryView":1332 + /* "View.MemoryView":1334 * transpose_memslice(&dst) * * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< @@ -26393,7 +26482,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); - /* "View.MemoryView":1333 + /* "View.MemoryView":1335 * * refcount_copying(&dst, dtype_is_object, ndim, False) * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<< @@ -26402,7 +26491,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize); - /* "View.MemoryView":1334 + /* "View.MemoryView":1336 * refcount_copying(&dst, dtype_is_object, ndim, False) * copy_strided_to_strided(&src, &dst, ndim, itemsize) * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< @@ -26411,7 +26500,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); - /* "View.MemoryView":1336 + /* "View.MemoryView":1338 * refcount_copying(&dst, dtype_is_object, ndim, True) * * free(tmpdata) # <<<<<<<<<<<<<< @@ -26420,7 +26509,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ free(__pyx_v_tmpdata); - /* "View.MemoryView":1337 + /* "View.MemoryView":1339 * * free(tmpdata) * return 0 # <<<<<<<<<<<<<< @@ -26430,7 +26519,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_r = 0; goto __pyx_L0; - /* "View.MemoryView":1268 + /* "View.MemoryView":1270 * * @cname('__pyx_memoryview_copy_contents') * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< @@ -26454,7 +26543,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ return __pyx_r; } -/* "View.MemoryView":1340 +/* "View.MemoryView":1342 * * @cname('__pyx_memoryview_broadcast_leading') * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< @@ -26469,7 +26558,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic int __pyx_t_2; int __pyx_t_3; - /* "View.MemoryView":1344 + /* "View.MemoryView":1346 * int ndim_other) nogil: * cdef int i * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<< @@ -26478,7 +26567,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic */ __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim); - /* "View.MemoryView":1346 + /* "View.MemoryView":1348 * cdef int offset = ndim_other - ndim * * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< @@ -26488,7 +26577,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { __pyx_v_i = __pyx_t_1; - /* "View.MemoryView":1347 + /* "View.MemoryView":1349 * * for i in range(ndim - 1, -1, -1): * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<< @@ -26497,7 +26586,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic */ (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]); - /* "View.MemoryView":1348 + /* "View.MemoryView":1350 * for i in range(ndim - 1, -1, -1): * mslice.shape[i + offset] = mslice.shape[i] * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<< @@ -26506,7 +26595,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic */ (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]); - /* "View.MemoryView":1349 + /* "View.MemoryView":1351 * mslice.shape[i + offset] = mslice.shape[i] * mslice.strides[i + offset] = mslice.strides[i] * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<< @@ -26516,7 +26605,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]); } - /* "View.MemoryView":1351 + /* "View.MemoryView":1353 * mslice.suboffsets[i + offset] = mslice.suboffsets[i] * * for i in range(offset): # <<<<<<<<<<<<<< @@ -26528,7 +26617,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "View.MemoryView":1352 + /* "View.MemoryView":1354 * * for i in range(offset): * mslice.shape[i] = 1 # <<<<<<<<<<<<<< @@ -26537,7 +26626,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic */ (__pyx_v_mslice->shape[__pyx_v_i]) = 1; - /* "View.MemoryView":1353 + /* "View.MemoryView":1355 * for i in range(offset): * mslice.shape[i] = 1 * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<< @@ -26546,7 +26635,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic */ (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]); - /* "View.MemoryView":1354 + /* "View.MemoryView":1356 * mslice.shape[i] = 1 * mslice.strides[i] = mslice.strides[0] * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< @@ -26556,7 +26645,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L; } - /* "View.MemoryView":1340 + /* "View.MemoryView":1342 * * @cname('__pyx_memoryview_broadcast_leading') * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< @@ -26567,7 +26656,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic /* function exit code */ } -/* "View.MemoryView":1362 +/* "View.MemoryView":1364 * * @cname('__pyx_memoryview_refcount_copying') * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< @@ -26578,7 +26667,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) { int __pyx_t_1; - /* "View.MemoryView":1366 + /* "View.MemoryView":1368 * * * if dtype_is_object: # <<<<<<<<<<<<<< @@ -26588,7 +26677,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i __pyx_t_1 = (__pyx_v_dtype_is_object != 0); if (__pyx_t_1) { - /* "View.MemoryView":1367 + /* "View.MemoryView":1369 * * if dtype_is_object: * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<< @@ -26597,7 +26686,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i */ __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc); - /* "View.MemoryView":1366 + /* "View.MemoryView":1368 * * * if dtype_is_object: # <<<<<<<<<<<<<< @@ -26606,7 +26695,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i */ } - /* "View.MemoryView":1362 + /* "View.MemoryView":1364 * * @cname('__pyx_memoryview_refcount_copying') * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< @@ -26617,7 +26706,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i /* function exit code */ } -/* "View.MemoryView":1371 +/* "View.MemoryView":1373 * * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< @@ -26632,7 +26721,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da #endif __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); - /* "View.MemoryView":1374 + /* "View.MemoryView":1376 * Py_ssize_t *strides, int ndim, * bint inc) with gil: * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<< @@ -26641,7 +26730,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da */ __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc); - /* "View.MemoryView":1371 + /* "View.MemoryView":1373 * * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< @@ -26656,7 +26745,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da #endif } -/* "View.MemoryView":1377 +/* "View.MemoryView":1379 * * @cname('__pyx_memoryview_refcount_objects_in_slice') * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< @@ -26673,7 +26762,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss int __pyx_t_4; __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0); - /* "View.MemoryView":1381 + /* "View.MemoryView":1383 * cdef Py_ssize_t i * * for i in range(shape[0]): # <<<<<<<<<<<<<< @@ -26685,7 +26774,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "View.MemoryView":1382 + /* "View.MemoryView":1384 * * for i in range(shape[0]): * if ndim == 1: # <<<<<<<<<<<<<< @@ -26695,7 +26784,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss __pyx_t_4 = ((__pyx_v_ndim == 1) != 0); if (__pyx_t_4) { - /* "View.MemoryView":1383 + /* "View.MemoryView":1385 * for i in range(shape[0]): * if ndim == 1: * if inc: # <<<<<<<<<<<<<< @@ -26705,7 +26794,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss __pyx_t_4 = (__pyx_v_inc != 0); if (__pyx_t_4) { - /* "View.MemoryView":1384 + /* "View.MemoryView":1386 * if ndim == 1: * if inc: * Py_INCREF(( data)[0]) # <<<<<<<<<<<<<< @@ -26714,7 +26803,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss */ Py_INCREF((((PyObject **)__pyx_v_data)[0])); - /* "View.MemoryView":1383 + /* "View.MemoryView":1385 * for i in range(shape[0]): * if ndim == 1: * if inc: # <<<<<<<<<<<<<< @@ -26724,7 +26813,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss goto __pyx_L6; } - /* "View.MemoryView":1386 + /* "View.MemoryView":1388 * Py_INCREF(( data)[0]) * else: * Py_DECREF(( data)[0]) # <<<<<<<<<<<<<< @@ -26736,7 +26825,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss } __pyx_L6:; - /* "View.MemoryView":1382 + /* "View.MemoryView":1384 * * for i in range(shape[0]): * if ndim == 1: # <<<<<<<<<<<<<< @@ -26746,7 +26835,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss goto __pyx_L5; } - /* "View.MemoryView":1388 + /* "View.MemoryView":1390 * Py_DECREF(( data)[0]) * else: * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< @@ -26755,7 +26844,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss */ /*else*/ { - /* "View.MemoryView":1389 + /* "View.MemoryView":1391 * else: * refcount_objects_in_slice(data, shape + 1, strides + 1, * ndim - 1, inc) # <<<<<<<<<<<<<< @@ -26766,7 +26855,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss } __pyx_L5:; - /* "View.MemoryView":1391 + /* "View.MemoryView":1393 * ndim - 1, inc) * * data += strides[0] # <<<<<<<<<<<<<< @@ -26776,7 +26865,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0])); } - /* "View.MemoryView":1377 + /* "View.MemoryView":1379 * * @cname('__pyx_memoryview_refcount_objects_in_slice') * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< @@ -26788,7 +26877,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss __Pyx_RefNannyFinishContext(); } -/* "View.MemoryView":1397 +/* "View.MemoryView":1399 * * @cname('__pyx_memoryview_slice_assign_scalar') * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< @@ -26798,7 +26887,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) { - /* "View.MemoryView":1400 + /* "View.MemoryView":1402 * size_t itemsize, void *item, * bint dtype_is_object) nogil: * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< @@ -26807,7 +26896,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst */ __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0); - /* "View.MemoryView":1401 + /* "View.MemoryView":1403 * bint dtype_is_object) nogil: * refcount_copying(dst, dtype_is_object, ndim, False) * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<< @@ -26816,7 +26905,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst */ __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item); - /* "View.MemoryView":1403 + /* "View.MemoryView":1405 * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, * itemsize, item) * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< @@ -26825,7 +26914,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst */ __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1); - /* "View.MemoryView":1397 + /* "View.MemoryView":1399 * * @cname('__pyx_memoryview_slice_assign_scalar') * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< @@ -26836,7 +26925,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst /* function exit code */ } -/* "View.MemoryView":1407 +/* "View.MemoryView":1409 * * @cname('__pyx_memoryview__slice_assign_scalar') * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< @@ -26853,7 +26942,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; - /* "View.MemoryView":1411 + /* "View.MemoryView":1413 * size_t itemsize, void *item) nogil: * cdef Py_ssize_t i * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<< @@ -26862,7 +26951,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t */ __pyx_v_stride = (__pyx_v_strides[0]); - /* "View.MemoryView":1412 + /* "View.MemoryView":1414 * cdef Py_ssize_t i * cdef Py_ssize_t stride = strides[0] * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<< @@ -26871,7 +26960,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t */ __pyx_v_extent = (__pyx_v_shape[0]); - /* "View.MemoryView":1414 + /* "View.MemoryView":1416 * cdef Py_ssize_t extent = shape[0] * * if ndim == 1: # <<<<<<<<<<<<<< @@ -26881,7 +26970,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); if (__pyx_t_1) { - /* "View.MemoryView":1415 + /* "View.MemoryView":1417 * * if ndim == 1: * for i in range(extent): # <<<<<<<<<<<<<< @@ -26893,7 +26982,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "View.MemoryView":1416 + /* "View.MemoryView":1418 * if ndim == 1: * for i in range(extent): * memcpy(data, item, itemsize) # <<<<<<<<<<<<<< @@ -26902,7 +26991,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t */ (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize)); - /* "View.MemoryView":1417 + /* "View.MemoryView":1419 * for i in range(extent): * memcpy(data, item, itemsize) * data += stride # <<<<<<<<<<<<<< @@ -26912,7 +27001,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t __pyx_v_data = (__pyx_v_data + __pyx_v_stride); } - /* "View.MemoryView":1414 + /* "View.MemoryView":1416 * cdef Py_ssize_t extent = shape[0] * * if ndim == 1: # <<<<<<<<<<<<<< @@ -26922,7 +27011,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t goto __pyx_L3; } - /* "View.MemoryView":1419 + /* "View.MemoryView":1421 * data += stride * else: * for i in range(extent): # <<<<<<<<<<<<<< @@ -26935,7 +27024,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "View.MemoryView":1420 + /* "View.MemoryView":1422 * else: * for i in range(extent): * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< @@ -26944,7 +27033,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t */ __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item); - /* "View.MemoryView":1422 + /* "View.MemoryView":1424 * _slice_assign_scalar(data, shape + 1, strides + 1, * ndim - 1, itemsize, item) * data += stride # <<<<<<<<<<<<<< @@ -26956,7 +27045,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t } __pyx_L3:; - /* "View.MemoryView":1407 + /* "View.MemoryView":1409 * * @cname('__pyx_memoryview__slice_assign_scalar') * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< @@ -27054,12 +27143,12 @@ static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSE PyObject *__pyx_v___pyx_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; + PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -27068,114 +27157,118 @@ static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSE /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result - * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<< + * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) */ - __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0); - if (__pyx_t_1) { + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__21, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { /* "(tree fragment)":5 * cdef object __pyx_result - * if __pyx_checksum != 0xb068931: + * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< - * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) * __pyx_result = Enum.__new__(__pyx_type) */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_2); - __pyx_v___pyx_PickleError = __pyx_t_2; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError); + __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v___pyx_PickleError = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "(tree fragment)":6 - * if __pyx_checksum != 0xb068931: + * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< * __pyx_result = Enum.__new__(__pyx_type) * if __pyx_state is not None: */ - __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_INCREF(__pyx_v___pyx_PickleError); - __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); + __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); + __Pyx_DECREF_SET(__pyx_t_1, function); } } - __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(2, 6, __pyx_L1_error) /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result - * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<< + * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) */ } /* "(tree fragment)":7 * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); + __Pyx_DECREF_SET(__pyx_t_1, function); } } - __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v___pyx_result = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v___pyx_type); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v___pyx_result = __pyx_t_4; + __pyx_t_4 = 0; /* "(tree fragment)":8 - * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) * __pyx_result = Enum.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) * return __pyx_result */ - __pyx_t_1 = (__pyx_v___pyx_state != Py_None); - __pyx_t_6 = (__pyx_t_1 != 0); - if (__pyx_t_6) { + __pyx_t_3 = (__pyx_v___pyx_state != Py_None); + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { /* "(tree fragment)":9 * __pyx_result = Enum.__new__(__pyx_type) @@ -27185,12 +27278,12 @@ static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSE * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error) - __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "(tree fragment)":8 - * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) * __pyx_result = Enum.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) @@ -27218,10 +27311,10 @@ static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSE /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -28153,7 +28246,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1}, {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0}, {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, - {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0}, + {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0}, {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0}, @@ -28262,13 +28355,13 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 44, __pyx_L1_error) __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 945, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 133, __pyx_L1_error) - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 148, __pyx_L1_error) - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 151, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 134, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 149, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 152, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 2, __pyx_L1_error) - __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 404, __pyx_L1_error) - __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 613, __pyx_L1_error) - __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 832, __pyx_L1_error) + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 406, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 615, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 834, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -28278,7 +28371,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":945 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":945 * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -28289,7 +28382,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":951 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":951 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -28300,58 +28393,58 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "View.MemoryView":133 + /* "View.MemoryView":134 * * if not self.ndim: * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< * * if itemsize <= 0: */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(2, 133, __pyx_L1_error) + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(2, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "View.MemoryView":136 + /* "View.MemoryView":137 * * if itemsize <= 0: * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< * * if not isinstance(format, bytes): */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(2, 136, __pyx_L1_error) + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(2, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "View.MemoryView":148 + /* "View.MemoryView":149 * * if not self._shape: * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< * * */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 148, __pyx_L1_error) + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - /* "View.MemoryView":176 + /* "View.MemoryView":177 * self.data = malloc(self.len) * if not self.data: * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< * * if self.dtype_is_object: */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 176, __pyx_L1_error) + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - /* "View.MemoryView":192 + /* "View.MemoryView":193 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * if not (flags & bufmode): * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< * info.buf = self.data * info.len = self.len */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 192, __pyx_L1_error) + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); @@ -28374,58 +28467,58 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); - /* "View.MemoryView":418 + /* "View.MemoryView":420 * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<< * * have_slices, index = _unellipsify(index, self.view.ndim) */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 418, __pyx_L1_error) + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); - /* "View.MemoryView":495 + /* "View.MemoryView":497 * result = struct.unpack(self.view.format, bytesitem) * except struct.error: * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< * else: * if len(self.view.format) == 1: */ - __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 495, __pyx_L1_error) + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); - /* "View.MemoryView":520 + /* "View.MemoryView":522 * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<< * * if flags & PyBUF_ND: */ - __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 520, __pyx_L1_error) + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); - /* "View.MemoryView":570 + /* "View.MemoryView":572 * if self.view.strides == NULL: * * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 570, __pyx_L1_error) + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); - /* "View.MemoryView":577 + /* "View.MemoryView":579 * def suboffsets(self): * if self.view.suboffsets == NULL: * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ - __pyx_tuple__14 = PyTuple_New(1); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 577, __pyx_L1_error) + __pyx_tuple__14 = PyTuple_New(1); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); @@ -28451,25 +28544,25 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); - /* "View.MemoryView":682 + /* "View.MemoryView":684 * if item is Ellipsis: * if not seen_ellipsis: * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< * seen_ellipsis = True * else: */ - __pyx_slice__17 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__17)) __PYX_ERR(2, 682, __pyx_L1_error) + __pyx_slice__17 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__17)) __PYX_ERR(2, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__17); __Pyx_GIVEREF(__pyx_slice__17); - /* "View.MemoryView":703 + /* "View.MemoryView":705 * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< * * */ - __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 703, __pyx_L1_error) + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 705, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); @@ -28491,71 +28584,74 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); + __pyx_tuple__21 = PyTuple_Pack(3, __pyx_int_184977713, __pyx_int_136983863, __pyx_int_112105877); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); - /* "View.MemoryView":286 + /* "View.MemoryView":287 * return self.name * * cdef generic = Enum("") # <<<<<<<<<<<<<< * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(2, 286, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__21); - __Pyx_GIVEREF(__pyx_tuple__21); + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); - /* "View.MemoryView":287 + /* "View.MemoryView":288 * * cdef generic = Enum("") * cdef strided = Enum("") # default # <<<<<<<<<<<<<< * cdef indirect = Enum("") * */ - __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); - /* "View.MemoryView":288 + /* "View.MemoryView":289 * cdef generic = Enum("") * cdef strided = Enum("") # default * cdef indirect = Enum("") # <<<<<<<<<<<<<< * * */ - __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(2, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); - /* "View.MemoryView":291 + /* "View.MemoryView":292 * * * cdef contiguous = Enum("") # <<<<<<<<<<<<<< * cdef indirect_contiguous = Enum("") * */ - __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(2, 291, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); - /* "View.MemoryView":292 + /* "View.MemoryView":293 * * cdef contiguous = Enum("") * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< * * */ - __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 292, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); /* "(tree fragment)":1 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ - __pyx_tuple__26 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); - __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(2, 1, __pyx_L1_error) + __pyx_tuple__27 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -28574,6 +28670,8 @@ if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_112105877 = PyInt_FromLong(112105877L); if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_136983863 = PyInt_FromLong(136983863L); if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; @@ -28627,21 +28725,21 @@ static int __Pyx_modinit_type_init_code(void) { /*--- Type init code ---*/ __pyx_vtabptr_array = &__pyx_vtable_array; __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview; - if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 106, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type___pyx_array.tp_print = 0; #endif - if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 106, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 106, __pyx_L1_error) __pyx_array_type = &__pyx_type___pyx_array; - if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 279, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 280, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type___pyx_MemviewEnum.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 279, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 280, __pyx_L1_error) __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum; __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview; __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer; @@ -28651,30 +28749,30 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed; __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object; __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object; - if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 331, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type___pyx_memoryview.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 331, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 331, __pyx_L1_error) __pyx_memoryview_type = &__pyx_type___pyx_memoryview; __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; - if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 967, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type___pyx_memoryviewslice.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 967, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 967, __pyx_L1_error) __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; __Pyx_RefNannyFinishContext(); return 0; @@ -29037,90 +29135,90 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":209 + /* "View.MemoryView":210 * info.obj = self * * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< * * def __dealloc__(array self): */ - __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 209, __pyx_L1_error) + __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 209, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 210, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_array_type); - /* "View.MemoryView":286 + /* "View.MemoryView":287 * return self.name * * cdef generic = Enum("") # <<<<<<<<<<<<<< * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 286, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(generic); __Pyx_DECREF_SET(generic, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":287 + /* "View.MemoryView":288 * * cdef generic = Enum("") * cdef strided = Enum("") # default # <<<<<<<<<<<<<< * cdef indirect = Enum("") * */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 287, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(strided); __Pyx_DECREF_SET(strided, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":288 + /* "View.MemoryView":289 * cdef generic = Enum("") * cdef strided = Enum("") # default * cdef indirect = Enum("") # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 288, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(indirect); __Pyx_DECREF_SET(indirect, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":291 + /* "View.MemoryView":292 * * * cdef contiguous = Enum("") # <<<<<<<<<<<<<< * cdef indirect_contiguous = Enum("") * */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 291, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(contiguous); __Pyx_DECREF_SET(contiguous, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":292 + /* "View.MemoryView":293 * * cdef contiguous = Enum("") * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 292, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(indirect_contiguous); __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":316 + /* "View.MemoryView":317 * * DEF THREAD_LOCKS_PREALLOCATED = 8 * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<< @@ -29129,7 +29227,7 @@ if (!__Pyx_RefNanny) { */ __pyx_memoryview_thread_locks_used = 0; - /* "View.MemoryView":317 + /* "View.MemoryView":318 * DEF THREAD_LOCKS_PREALLOCATED = 8 * cdef int __pyx_memoryview_thread_locks_used = 0 * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<< @@ -29146,29 +29244,29 @@ if (!__Pyx_RefNanny) { __pyx_t_3[7] = PyThread_allocate_lock(); memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3, sizeof(__pyx_memoryview_thread_locks[0]) * (8)); - /* "View.MemoryView":549 + /* "View.MemoryView":551 * info.obj = self * * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 549, __pyx_L1_error) + __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 549, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 551, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_memoryview_type); - /* "View.MemoryView":995 + /* "View.MemoryView":997 * return self.from_object * * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 995, __pyx_L1_error) + __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 997, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 995, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 997, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_memoryviewslice_type); @@ -29837,7 +29935,7 @@ __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview, static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN { va_list vargs; char msg[200]; -#ifdef HAVE_STDARG_PROTOTYPES +#if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES) va_start(vargs, fmt); #else va_start(vargs); @@ -30273,7 +30371,7 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq return (equals == Py_EQ); } else { int result; -#if CYTHON_USE_UNICODE_INTERNALS +#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; @@ -31092,17 +31190,35 @@ static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; + PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; + PyObject *getstate = NULL; #if CYTHON_USE_PYTYPE_LOOKUP - if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; + getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); #else - if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; + getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); + if (!getstate && PyErr_Occurred()) { + goto __PYX_BAD; + } #endif + if (getstate) { +#if CYTHON_USE_PYTYPE_LOOKUP + object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); +#else + object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); + if (!object_getstate && PyErr_Occurred()) { + goto __PYX_BAD; + } +#endif + if (object_getstate != getstate) { + goto __PYX_GOOD; + } + } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else @@ -31147,6 +31263,8 @@ static int __Pyx_setup_reduce(PyObject* type_obj) { #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); + Py_XDECREF(object_getstate); + Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); @@ -31343,6 +31461,12 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { #include "compile.h" #include "frameobject.h" #include "traceback.h" +#if PY_VERSION_HEX >= 0x030b00a6 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { @@ -31406,14 +31530,24 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); - if (!py_code) goto bad; + if (!py_code) { + /* If the code object creation fails, then we should clear the + fetched exception references and propagate the new exception */ + Py_XDECREF(ptype); + Py_XDECREF(pvalue); + Py_XDECREF(ptraceback); + goto bad; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( @@ -34277,11 +34411,33 @@ __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, /* CheckBinaryVersion */ static int __Pyx_check_binary_version(void) { - char ctversion[4], rtversion[4]; - PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); - PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); - if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char ctversion[5]; + int same=1, i, found_dot; + const char* rt_from_call = Py_GetVersion(); + PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + found_dot = 0; + for (i = 0; i < 4; i++) { + if (!ctversion[i]) { + same = (rt_from_call[i] < '0' || rt_from_call[i] > '9'); + break; + } + if (rt_from_call[i] != ctversion[i]) { + same = 0; + break; + } + } + if (!same) { + char rtversion[5] = {'\0'}; char message[200]; + for (i=0; i<4; ++i) { + if (rt_from_call[i] == '.') { + if (found_dot) break; + found_dot = 1; + } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') { + break; + } + rtversion[i] = rt_from_call[i]; + } PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", diff --git a/acv_explainers/cyext_acv/cyext_acv_nopa.cpp b/acv_explainers/cyext_acv/cyext_acv_nopa.cpp index f2c522d..31e4ce5 100644 --- a/acv_explainers/cyext_acv/cyext_acv_nopa.cpp +++ b/acv_explainers/cyext_acv/cyext_acv_nopa.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.28 */ +/* Generated by Cython 0.29.32 */ /* BEGIN: Cython Metadata { @@ -29,8 +29,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_28" -#define CYTHON_HEX_VERSION 0x001D1CF0 +#define CYTHON_ABI "0_29_32" +#define CYTHON_HEX_VERSION 0x001D20F0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -69,6 +69,7 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_PYTYPE_LOOKUP @@ -105,10 +106,14 @@ END: Cython Metadata */ #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900) + #endif #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 1 #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif @@ -146,10 +151,59 @@ END: Cython Metadata */ #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(PY_NOGIL) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_NOGIL 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #ifndef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 1 + #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif @@ -199,7 +253,7 @@ END: Cython Metadata */ #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030B00A1) + #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000) #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) @@ -216,6 +270,9 @@ END: Cython Metadata */ #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) #endif + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 + #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) @@ -681,8 +738,10 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { } __Pyx_PyAsyncMethodsStruct; #endif -#if defined(WIN32) || defined(MS_WINDOWS) - #define _USE_MATH_DEFINES +#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) + #if !defined(_USE_MATH_DEFINES) + #define _USE_MATH_DEFINES + #endif #endif #include #ifdef NAN @@ -989,30 +1048,26 @@ typedef struct { #ifndef CYTHON_ATOMICS #define CYTHON_ATOMICS 1 #endif +#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS #define __pyx_atomic_int_type int -#if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\ - (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\ - !defined(__i386__) - #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1) - #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1) +#if CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\ + (__GNUC_MINOR__ > 1 ||\ + (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2)))) + #define __pyx_atomic_incr_aligned(value) __sync_fetch_and_add(value, 1) + #define __pyx_atomic_decr_aligned(value) __sync_fetch_and_sub(value, 1) #ifdef __PYX_DEBUG_ATOMICS #warning "Using GNU atomics" #endif -#elif CYTHON_ATOMICS && defined(_MSC_VER) && 0 - #include +#elif CYTHON_ATOMICS && defined(_MSC_VER) && CYTHON_COMPILING_IN_NOGIL + #include #undef __pyx_atomic_int_type - #define __pyx_atomic_int_type LONG - #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value) - #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value) + #define __pyx_atomic_int_type long + #pragma intrinsic (_InterlockedExchangeAdd) + #define __pyx_atomic_incr_aligned(value) _InterlockedExchangeAdd(value, 1) + #define __pyx_atomic_decr_aligned(value) _InterlockedExchangeAdd(value, -1) #ifdef __PYX_DEBUG_ATOMICS #pragma message ("Using MSVC atomics") #endif -#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0 - #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value) - #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value) - #ifdef __PYX_DEBUG_ATOMICS - #warning "Using Intel atomics" - #endif #else #undef CYTHON_ATOMICS #define CYTHON_ATOMICS 0 @@ -1023,9 +1078,9 @@ typedef struct { typedef volatile __pyx_atomic_int_type __pyx_atomic_int; #if CYTHON_ATOMICS #define __pyx_add_acquisition_count(memview)\ - __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) + __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview)) #define __pyx_sub_acquisition_count(memview)\ - __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) + __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview)) #else #define __pyx_add_acquisition_count(memview)\ __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) @@ -1082,7 +1137,7 @@ typedef struct { } __Pyx_BufFmt_Context; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":690 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":690 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -1091,7 +1146,7 @@ typedef struct { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":691 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":691 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -1100,7 +1155,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":692 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":692 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -1109,7 +1164,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":693 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":693 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -1118,7 +1173,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":697 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":697 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -1127,7 +1182,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":698 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":698 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -1136,7 +1191,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":699 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":699 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -1145,7 +1200,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":700 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":700 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -1154,7 +1209,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":704 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":704 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -1163,7 +1218,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":705 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":705 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -1172,7 +1227,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":714 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":714 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< @@ -1181,7 +1236,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":715 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":715 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< @@ -1190,7 +1245,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":716 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":716 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -1199,7 +1254,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":718 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":718 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -1208,7 +1263,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":719 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":719 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -1217,7 +1272,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":720 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":720 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -1226,7 +1281,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":722 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":722 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -1235,7 +1290,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":723 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":723 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -1244,7 +1299,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":725 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":725 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -1253,7 +1308,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":726 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":726 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -1262,7 +1317,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":727 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":727 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -1312,7 +1367,7 @@ struct __pyx_MemviewEnum_obj; struct __pyx_memoryview_obj; struct __pyx_memoryviewslice_obj; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":729 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":729 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -1321,7 +1376,7 @@ struct __pyx_memoryviewslice_obj; */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":730 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":730 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -1330,7 +1385,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":731 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":731 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -1339,7 +1394,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":733 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":733 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -1378,7 +1433,7 @@ struct __pyx_obj_14cyext_acv_nopa___pyx_scope_struct_1_genexpr { }; -/* "View.MemoryView":105 +/* "View.MemoryView":106 * * @cname("__pyx_array") * cdef class array: # <<<<<<<<<<<<<< @@ -1403,7 +1458,7 @@ struct __pyx_array_obj { }; -/* "View.MemoryView":279 +/* "View.MemoryView":280 * * @cname('__pyx_MemviewEnum') * cdef class Enum(object): # <<<<<<<<<<<<<< @@ -1416,7 +1471,7 @@ struct __pyx_MemviewEnum_obj { }; -/* "View.MemoryView":330 +/* "View.MemoryView":331 * * @cname('__pyx_memoryview') * cdef class memoryview(object): # <<<<<<<<<<<<<< @@ -1439,7 +1494,7 @@ struct __pyx_memoryview_obj { }; -/* "View.MemoryView":965 +/* "View.MemoryView":967 * * @cname('__pyx_memoryviewslice') * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< @@ -1456,7 +1511,7 @@ struct __pyx_memoryviewslice_obj { -/* "View.MemoryView":105 +/* "View.MemoryView":106 * * @cname("__pyx_array") * cdef class array: # <<<<<<<<<<<<<< @@ -1470,7 +1525,7 @@ struct __pyx_vtabstruct_array { static struct __pyx_vtabstruct_array *__pyx_vtabptr_array; -/* "View.MemoryView":330 +/* "View.MemoryView":331 * * @cname('__pyx_memoryview') * cdef class memoryview(object): # <<<<<<<<<<<<<< @@ -1490,7 +1545,7 @@ struct __pyx_vtabstruct_memoryview { static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview; -/* "View.MemoryView":965 +/* "View.MemoryView":967 * * @cname('__pyx_memoryviewslice') * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< @@ -1648,6 +1703,12 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, #if CYTHON_FAST_PYCALL static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" +#if PY_VERSION_HEX >= 0x030b00a6 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) @@ -2764,7 +2825,7 @@ static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview"; static const char __pyx_k_Check_condition_in_the_computati[] = "Check condition in the computation of SDP"; static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; -static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))"; +static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))"; static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported"; static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s"; static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)"; @@ -2785,7 +2846,7 @@ static PyObject *__pyx_kp_s_Check_condition_in_the_computati; static PyObject *__pyx_n_s_Ellipsis; static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr; static PyObject *__pyx_n_s_ImportError; -static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0; +static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0; static PyObject *__pyx_n_s_IndexError; static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte; static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr; @@ -2996,6 +3057,8 @@ static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_2; static PyObject *__pyx_int_3; +static PyObject *__pyx_int_112105877; +static PyObject *__pyx_int_136983863; static PyObject *__pyx_int_184977713; static PyObject *__pyx_int_neg_1; static PyObject *__pyx_tuple_; @@ -3020,14 +3083,15 @@ static PyObject *__pyx_tuple__19; static PyObject *__pyx_tuple__20; static PyObject *__pyx_tuple__21; static PyObject *__pyx_tuple__22; -static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__23; static PyObject *__pyx_tuple__25; static PyObject *__pyx_tuple__26; static PyObject *__pyx_tuple__27; static PyObject *__pyx_tuple__28; static PyObject *__pyx_tuple__29; -static PyObject *__pyx_codeobj__23; -static PyObject *__pyx_codeobj__30; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_codeobj__24; +static PyObject *__pyx_codeobj__31; /* Late includes */ /* "cyext_acv_nopa.pyx":26 @@ -49471,7 +49535,7 @@ static PyObject *__pyx_pf_14cyext_acv_nopa_44swing_sv_clf_direct_nopa(CYTHON_UNU return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":735 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":735 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -49488,7 +49552,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":736 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":736 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -49502,7 +49566,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":735 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":735 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -49521,7 +49585,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":738 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":738 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -49538,7 +49602,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":739 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":739 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -49552,7 +49616,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":738 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":738 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -49571,7 +49635,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":741 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":741 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -49588,7 +49652,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":742 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":742 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -49602,7 +49666,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":741 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":741 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -49621,7 +49685,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":744 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":744 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -49638,7 +49702,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":745 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":745 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -49652,7 +49716,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":744 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":744 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -49671,7 +49735,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":747 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":747 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -49688,7 +49752,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":748 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":748 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -49702,7 +49766,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":747 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":747 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -49721,7 +49785,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":750 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":750 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -49735,7 +49799,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ int __pyx_t_1; __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":751 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":751 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -49745,7 +49809,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0); if (__pyx_t_1) { - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":752 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":752 * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape # <<<<<<<<<<<<<< @@ -49757,7 +49821,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":751 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":751 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -49766,7 +49830,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ */ } - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":754 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":754 * return d.subarray.shape * else: * return () # <<<<<<<<<<<<<< @@ -49780,7 +49844,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; } - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":750 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":750 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -49795,7 +49859,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":929 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":929 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -49807,7 +49871,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":930 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":930 * * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< @@ -49816,7 +49880,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":931 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":931 * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< @@ -49825,7 +49889,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base)); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":929 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":929 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -49837,7 +49901,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":933 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":933 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -49852,7 +49916,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":934 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":934 * * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< @@ -49861,7 +49925,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ __pyx_v_base = PyArray_BASE(__pyx_v_arr); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":935 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":935 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -49871,7 +49935,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = ((__pyx_v_base == NULL) != 0); if (__pyx_t_1) { - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":936 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":936 * base = PyArray_BASE(arr) * if base is NULL: * return None # <<<<<<<<<<<<<< @@ -49882,7 +49946,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":935 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":935 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -49891,7 +49955,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":937 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":937 * if base is NULL: * return None * return base # <<<<<<<<<<<<<< @@ -49903,7 +49967,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = ((PyObject *)__pyx_v_base); goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":933 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":933 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -49918,7 +49982,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":941 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":941 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -49942,7 +50006,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_array", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":942 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":942 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -49958,7 +50022,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":943 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":943 * cdef inline int import_array() except -1: * try: * __pyx_import_array() # <<<<<<<<<<<<<< @@ -49967,7 +50031,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { */ __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 943, __pyx_L3_error) - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":942 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":942 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -49981,7 +50045,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":944 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":944 * try: * __pyx_import_array() * except Exception: # <<<<<<<<<<<<<< @@ -49996,7 +50060,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":945 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":945 * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -50012,7 +50076,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":942 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":942 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -50027,7 +50091,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":941 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":941 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -50050,7 +50114,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":947 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":947 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -50074,7 +50138,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_umath", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":948 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":948 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -50090,7 +50154,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":949 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":949 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -50099,7 +50163,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { */ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 949, __pyx_L3_error) - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":948 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":948 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -50113,7 +50177,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":950 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":950 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -50128,7 +50192,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":951 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":951 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -50144,7 +50208,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":948 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":948 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -50159,7 +50223,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":947 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":947 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -50182,7 +50246,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":953 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":953 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -50206,7 +50270,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":954 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":954 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -50222,7 +50286,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":955 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":955 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -50231,7 +50295,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { */ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 955, __pyx_L3_error) - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":954 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":954 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -50245,7 +50309,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":956 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":956 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -50260,7 +50324,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":957 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":957 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -50276,7 +50340,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":954 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":954 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -50291,7 +50355,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":953 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":953 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -50314,7 +50378,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":967 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":967 * * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< @@ -50327,7 +50391,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_timedelta64_object", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":979 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":979 * bool * """ * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< @@ -50337,7 +50401,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":967 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":967 * * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< @@ -50351,7 +50415,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":982 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":982 * * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< @@ -50364,7 +50428,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_datetime64_object", 0); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":994 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":994 * bool * """ * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< @@ -50374,7 +50438,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":982 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":982 * * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< @@ -50388,7 +50452,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":997 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":997 * * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -50399,7 +50463,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) { npy_datetime __pyx_r; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1004 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":1004 * also needed. That can be found using `get_datetime64_unit`. * """ * return (obj).obval # <<<<<<<<<<<<<< @@ -50409,7 +50473,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":997 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":997 * * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -50422,7 +50486,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1007 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":1007 * * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -50433,7 +50497,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) { npy_timedelta __pyx_r; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1011 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":1011 * returns the int64 value underlying scalar numpy timedelta64 object * """ * return (obj).obval # <<<<<<<<<<<<<< @@ -50443,7 +50507,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1007 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":1007 * * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -50456,7 +50520,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject return __pyx_r; } -/* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1014 +/* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":1014 * * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< @@ -50467,7 +50531,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) { NPY_DATETIMEUNIT __pyx_r; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1018 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":1018 * returns the unit part of the dtype for a numpy datetime64 object. * """ * return (obj).obmeta.base # <<<<<<<<<<<<<< @@ -50475,7 +50539,7 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base); goto __pyx_L0; - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1014 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":1014 * * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< @@ -51066,7 +51130,7 @@ static std::vector > __pyx_convert_vector_from_py_std_3a__3a_v return __pyx_r; } -/* "View.MemoryView":122 +/* "View.MemoryView":123 * cdef bint dtype_is_object * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< @@ -51118,13 +51182,13 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 122, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 123, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 122, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 123, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: @@ -51140,7 +51204,7 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 122, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 123, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -51156,14 +51220,14 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P } } __pyx_v_shape = ((PyObject*)values[0]); - __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 122, __pyx_L3_error) + __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 123, __pyx_L3_error) __pyx_v_format = values[2]; __pyx_v_mode = values[3]; if (values[4]) { - __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 123, __pyx_L3_error) + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 124, __pyx_L3_error) } else { - /* "View.MemoryView":123 + /* "View.MemoryView":124 * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<< @@ -51175,19 +51239,19 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 122, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 123, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 122, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 123, __pyx_L1_error) if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 122, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 123, __pyx_L1_error) } __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer); - /* "View.MemoryView":122 + /* "View.MemoryView":123 * cdef bint dtype_is_object * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< @@ -51229,7 +51293,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __Pyx_RefNannySetupContext("__cinit__", 0); __Pyx_INCREF(__pyx_v_format); - /* "View.MemoryView":129 + /* "View.MemoryView":130 * cdef PyObject **p * * self.ndim = len(shape) # <<<<<<<<<<<<<< @@ -51238,12 +51302,12 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ if (unlikely(__pyx_v_shape == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(2, 129, __pyx_L1_error) + __PYX_ERR(2, 130, __pyx_L1_error) } - __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(2, 129, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(2, 130, __pyx_L1_error) __pyx_v_self->ndim = ((int)__pyx_t_1); - /* "View.MemoryView":130 + /* "View.MemoryView":131 * * self.ndim = len(shape) * self.itemsize = itemsize # <<<<<<<<<<<<<< @@ -51252,7 +51316,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ __pyx_v_self->itemsize = __pyx_v_itemsize; - /* "View.MemoryView":132 + /* "View.MemoryView":133 * self.itemsize = itemsize * * if not self.ndim: # <<<<<<<<<<<<<< @@ -51262,20 +51326,20 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0); if (unlikely(__pyx_t_2)) { - /* "View.MemoryView":133 + /* "View.MemoryView":134 * * if not self.ndim: * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< * * if itemsize <= 0: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 133, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 133, __pyx_L1_error) + __PYX_ERR(2, 134, __pyx_L1_error) - /* "View.MemoryView":132 + /* "View.MemoryView":133 * self.itemsize = itemsize * * if not self.ndim: # <<<<<<<<<<<<<< @@ -51284,7 +51348,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ } - /* "View.MemoryView":135 + /* "View.MemoryView":136 * raise ValueError("Empty shape tuple for cython.array") * * if itemsize <= 0: # <<<<<<<<<<<<<< @@ -51294,20 +51358,20 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0); if (unlikely(__pyx_t_2)) { - /* "View.MemoryView":136 + /* "View.MemoryView":137 * * if itemsize <= 0: * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< * * if not isinstance(format, bytes): */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 136, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 136, __pyx_L1_error) + __PYX_ERR(2, 137, __pyx_L1_error) - /* "View.MemoryView":135 + /* "View.MemoryView":136 * raise ValueError("Empty shape tuple for cython.array") * * if itemsize <= 0: # <<<<<<<<<<<<<< @@ -51316,7 +51380,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ } - /* "View.MemoryView":138 + /* "View.MemoryView":139 * raise ValueError("itemsize <= 0 for cython.array") * * if not isinstance(format, bytes): # <<<<<<<<<<<<<< @@ -51327,14 +51391,14 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_4) { - /* "View.MemoryView":139 + /* "View.MemoryView":140 * * if not isinstance(format, bytes): * format = format.encode('ASCII') # <<<<<<<<<<<<<< * self._format = format # keep a reference to the byte string * self.format = self._format */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 139, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { @@ -51348,13 +51412,13 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ } __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 139, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":138 + /* "View.MemoryView":139 * raise ValueError("itemsize <= 0 for cython.array") * * if not isinstance(format, bytes): # <<<<<<<<<<<<<< @@ -51363,14 +51427,14 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ } - /* "View.MemoryView":140 + /* "View.MemoryView":141 * if not isinstance(format, bytes): * format = format.encode('ASCII') * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<< * self.format = self._format * */ - if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(2, 140, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(2, 141, __pyx_L1_error) __pyx_t_3 = __pyx_v_format; __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); @@ -51379,7 +51443,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_v_self->_format = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":141 + /* "View.MemoryView":142 * format = format.encode('ASCII') * self._format = format # keep a reference to the byte string * self.format = self._format # <<<<<<<<<<<<<< @@ -51388,12 +51452,12 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ if (unlikely(__pyx_v_self->_format == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(2, 141, __pyx_L1_error) + __PYX_ERR(2, 142, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(2, 141, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(2, 142, __pyx_L1_error) __pyx_v_self->format = __pyx_t_7; - /* "View.MemoryView":144 + /* "View.MemoryView":145 * * * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<< @@ -51402,7 +51466,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2))); - /* "View.MemoryView":145 + /* "View.MemoryView":146 * * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<< @@ -51411,7 +51475,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim); - /* "View.MemoryView":147 + /* "View.MemoryView":148 * self._strides = self._shape + self.ndim * * if not self._shape: # <<<<<<<<<<<<<< @@ -51421,20 +51485,20 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0); if (unlikely(__pyx_t_4)) { - /* "View.MemoryView":148 + /* "View.MemoryView":149 * * if not self._shape: * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< * * */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 148, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 148, __pyx_L1_error) + __PYX_ERR(2, 149, __pyx_L1_error) - /* "View.MemoryView":147 + /* "View.MemoryView":148 * self._strides = self._shape + self.ndim * * if not self._shape: # <<<<<<<<<<<<<< @@ -51443,7 +51507,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ } - /* "View.MemoryView":151 + /* "View.MemoryView":152 * * * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< @@ -51455,18 +51519,18 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ for (;;) { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(2, 151, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(2, 152, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 151, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 151, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_dim = __pyx_t_9; __pyx_v_idx = __pyx_t_8; __pyx_t_8 = (__pyx_t_8 + 1); - /* "View.MemoryView":152 + /* "View.MemoryView":153 * * for idx, dim in enumerate(shape): * if dim <= 0: # <<<<<<<<<<<<<< @@ -51476,18 +51540,18 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_t_4 = ((__pyx_v_dim <= 0) != 0); if (unlikely(__pyx_t_4)) { - /* "View.MemoryView":153 + /* "View.MemoryView":154 * for idx, dim in enumerate(shape): * if dim <= 0: * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<< * self._shape[idx] = dim * */ - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 153, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 153, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 153, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); @@ -51495,17 +51559,17 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6); __pyx_t_5 = 0; __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 153, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 153, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __PYX_ERR(2, 153, __pyx_L1_error) + __PYX_ERR(2, 154, __pyx_L1_error) - /* "View.MemoryView":152 + /* "View.MemoryView":153 * * for idx, dim in enumerate(shape): * if dim <= 0: # <<<<<<<<<<<<<< @@ -51514,7 +51578,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ } - /* "View.MemoryView":154 + /* "View.MemoryView":155 * if dim <= 0: * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) * self._shape[idx] = dim # <<<<<<<<<<<<<< @@ -51523,7 +51587,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim; - /* "View.MemoryView":151 + /* "View.MemoryView":152 * * * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< @@ -51533,17 +51597,17 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":157 + /* "View.MemoryView":158 * * cdef char order * if mode == 'fortran': # <<<<<<<<<<<<<< * order = b'F' * self.mode = u'fortran' */ - __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 157, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 158, __pyx_L1_error) if (__pyx_t_4) { - /* "View.MemoryView":158 + /* "View.MemoryView":159 * cdef char order * if mode == 'fortran': * order = b'F' # <<<<<<<<<<<<<< @@ -51552,7 +51616,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ __pyx_v_order = 'F'; - /* "View.MemoryView":159 + /* "View.MemoryView":160 * if mode == 'fortran': * order = b'F' * self.mode = u'fortran' # <<<<<<<<<<<<<< @@ -51565,7 +51629,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __Pyx_DECREF(__pyx_v_self->mode); __pyx_v_self->mode = __pyx_n_u_fortran; - /* "View.MemoryView":157 + /* "View.MemoryView":158 * * cdef char order * if mode == 'fortran': # <<<<<<<<<<<<<< @@ -51575,17 +51639,17 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ goto __pyx_L10; } - /* "View.MemoryView":160 + /* "View.MemoryView":161 * order = b'F' * self.mode = u'fortran' * elif mode == 'c': # <<<<<<<<<<<<<< * order = b'C' * self.mode = u'c' */ - __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 160, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 161, __pyx_L1_error) if (likely(__pyx_t_4)) { - /* "View.MemoryView":161 + /* "View.MemoryView":162 * self.mode = u'fortran' * elif mode == 'c': * order = b'C' # <<<<<<<<<<<<<< @@ -51594,7 +51658,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ __pyx_v_order = 'C'; - /* "View.MemoryView":162 + /* "View.MemoryView":163 * elif mode == 'c': * order = b'C' * self.mode = u'c' # <<<<<<<<<<<<<< @@ -51607,7 +51671,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __Pyx_DECREF(__pyx_v_self->mode); __pyx_v_self->mode = __pyx_n_u_c; - /* "View.MemoryView":160 + /* "View.MemoryView":161 * order = b'F' * self.mode = u'fortran' * elif mode == 'c': # <<<<<<<<<<<<<< @@ -51617,7 +51681,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ goto __pyx_L10; } - /* "View.MemoryView":164 + /* "View.MemoryView":165 * self.mode = u'c' * else: * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<< @@ -51625,18 +51689,18 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * self.len = fill_contig_strides_array(self._shape, self._strides, */ /*else*/ { - __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 164, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 164, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __PYX_ERR(2, 164, __pyx_L1_error) + __PYX_ERR(2, 165, __pyx_L1_error) } __pyx_L10:; - /* "View.MemoryView":166 + /* "View.MemoryView":167 * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) * * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<< @@ -51645,7 +51709,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order); - /* "View.MemoryView":169 + /* "View.MemoryView":170 * itemsize, self.ndim, order) * * self.free_data = allocate_buffer # <<<<<<<<<<<<<< @@ -51654,19 +51718,19 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ __pyx_v_self->free_data = __pyx_v_allocate_buffer; - /* "View.MemoryView":170 + /* "View.MemoryView":171 * * self.free_data = allocate_buffer * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<< * if allocate_buffer: * */ - __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 170, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 170, __pyx_L1_error) + __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 171, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 171, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_self->dtype_is_object = __pyx_t_4; - /* "View.MemoryView":171 + /* "View.MemoryView":172 * self.free_data = allocate_buffer * self.dtype_is_object = format == b'O' * if allocate_buffer: # <<<<<<<<<<<<<< @@ -51676,7 +51740,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_t_4 = (__pyx_v_allocate_buffer != 0); if (__pyx_t_4) { - /* "View.MemoryView":174 + /* "View.MemoryView":175 * * * self.data = malloc(self.len) # <<<<<<<<<<<<<< @@ -51685,7 +51749,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len)); - /* "View.MemoryView":175 + /* "View.MemoryView":176 * * self.data = malloc(self.len) * if not self.data: # <<<<<<<<<<<<<< @@ -51695,20 +51759,20 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0); if (unlikely(__pyx_t_4)) { - /* "View.MemoryView":176 + /* "View.MemoryView":177 * self.data = malloc(self.len) * if not self.data: * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< * * if self.dtype_is_object: */ - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 176, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __PYX_ERR(2, 176, __pyx_L1_error) + __PYX_ERR(2, 177, __pyx_L1_error) - /* "View.MemoryView":175 + /* "View.MemoryView":176 * * self.data = malloc(self.len) * if not self.data: # <<<<<<<<<<<<<< @@ -51717,7 +51781,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ } - /* "View.MemoryView":178 + /* "View.MemoryView":179 * raise MemoryError("unable to allocate array data.") * * if self.dtype_is_object: # <<<<<<<<<<<<<< @@ -51727,7 +51791,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0); if (__pyx_t_4) { - /* "View.MemoryView":179 + /* "View.MemoryView":180 * * if self.dtype_is_object: * p = self.data # <<<<<<<<<<<<<< @@ -51736,7 +51800,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ __pyx_v_p = ((PyObject **)__pyx_v_self->data); - /* "View.MemoryView":180 + /* "View.MemoryView":181 * if self.dtype_is_object: * p = self.data * for i in range(self.len / itemsize): # <<<<<<<<<<<<<< @@ -51745,18 +51809,18 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(2, 180, __pyx_L1_error) + __PYX_ERR(2, 181, __pyx_L1_error) } else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) { PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); - __PYX_ERR(2, 180, __pyx_L1_error) + __PYX_ERR(2, 181, __pyx_L1_error) } __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); __pyx_t_9 = __pyx_t_1; for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; - /* "View.MemoryView":181 + /* "View.MemoryView":182 * p = self.data * for i in range(self.len / itemsize): * p[i] = Py_None # <<<<<<<<<<<<<< @@ -51765,7 +51829,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ (__pyx_v_p[__pyx_v_i]) = Py_None; - /* "View.MemoryView":182 + /* "View.MemoryView":183 * for i in range(self.len / itemsize): * p[i] = Py_None * Py_INCREF(Py_None) # <<<<<<<<<<<<<< @@ -51775,7 +51839,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ Py_INCREF(Py_None); } - /* "View.MemoryView":178 + /* "View.MemoryView":179 * raise MemoryError("unable to allocate array data.") * * if self.dtype_is_object: # <<<<<<<<<<<<<< @@ -51784,7 +51848,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ } - /* "View.MemoryView":171 + /* "View.MemoryView":172 * self.free_data = allocate_buffer * self.dtype_is_object = format == b'O' * if allocate_buffer: # <<<<<<<<<<<<<< @@ -51793,7 +51857,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ } - /* "View.MemoryView":122 + /* "View.MemoryView":123 * cdef bint dtype_is_object * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< @@ -51817,7 +51881,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ return __pyx_r; } -/* "View.MemoryView":185 +/* "View.MemoryView":186 * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< @@ -51860,7 +51924,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); - /* "View.MemoryView":186 + /* "View.MemoryView":187 * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): * cdef int bufmode = -1 # <<<<<<<<<<<<<< @@ -51869,18 +51933,18 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru */ __pyx_v_bufmode = -1; - /* "View.MemoryView":187 + /* "View.MemoryView":188 * def __getbuffer__(self, Py_buffer *info, int flags): * cdef int bufmode = -1 * if self.mode == u"c": # <<<<<<<<<<<<<< * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * elif self.mode == u"fortran": */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 187, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 188, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":188 + /* "View.MemoryView":189 * cdef int bufmode = -1 * if self.mode == u"c": * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<< @@ -51889,7 +51953,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru */ __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); - /* "View.MemoryView":187 + /* "View.MemoryView":188 * def __getbuffer__(self, Py_buffer *info, int flags): * cdef int bufmode = -1 * if self.mode == u"c": # <<<<<<<<<<<<<< @@ -51899,18 +51963,18 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru goto __pyx_L3; } - /* "View.MemoryView":189 + /* "View.MemoryView":190 * if self.mode == u"c": * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * elif self.mode == u"fortran": # <<<<<<<<<<<<<< * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * if not (flags & bufmode): */ - __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 189, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 190, __pyx_L1_error) __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "View.MemoryView":190 + /* "View.MemoryView":191 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * elif self.mode == u"fortran": * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<< @@ -51919,7 +51983,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru */ __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); - /* "View.MemoryView":189 + /* "View.MemoryView":190 * if self.mode == u"c": * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * elif self.mode == u"fortran": # <<<<<<<<<<<<<< @@ -51929,7 +51993,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru } __pyx_L3:; - /* "View.MemoryView":191 + /* "View.MemoryView":192 * elif self.mode == u"fortran": * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * if not (flags & bufmode): # <<<<<<<<<<<<<< @@ -51939,20 +52003,20 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0); if (unlikely(__pyx_t_1)) { - /* "View.MemoryView":192 + /* "View.MemoryView":193 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * if not (flags & bufmode): * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< * info.buf = self.data * info.len = self.len */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 192, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 192, __pyx_L1_error) + __PYX_ERR(2, 193, __pyx_L1_error) - /* "View.MemoryView":191 + /* "View.MemoryView":192 * elif self.mode == u"fortran": * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * if not (flags & bufmode): # <<<<<<<<<<<<<< @@ -51961,7 +52025,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru */ } - /* "View.MemoryView":193 + /* "View.MemoryView":194 * if not (flags & bufmode): * raise ValueError("Can only create a buffer that is contiguous in memory.") * info.buf = self.data # <<<<<<<<<<<<<< @@ -51971,7 +52035,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_t_4 = __pyx_v_self->data; __pyx_v_info->buf = __pyx_t_4; - /* "View.MemoryView":194 + /* "View.MemoryView":195 * raise ValueError("Can only create a buffer that is contiguous in memory.") * info.buf = self.data * info.len = self.len # <<<<<<<<<<<<<< @@ -51981,7 +52045,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_t_5 = __pyx_v_self->len; __pyx_v_info->len = __pyx_t_5; - /* "View.MemoryView":195 + /* "View.MemoryView":196 * info.buf = self.data * info.len = self.len * info.ndim = self.ndim # <<<<<<<<<<<<<< @@ -51991,7 +52055,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_t_6 = __pyx_v_self->ndim; __pyx_v_info->ndim = __pyx_t_6; - /* "View.MemoryView":196 + /* "View.MemoryView":197 * info.len = self.len * info.ndim = self.ndim * info.shape = self._shape # <<<<<<<<<<<<<< @@ -52001,7 +52065,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_t_7 = __pyx_v_self->_shape; __pyx_v_info->shape = __pyx_t_7; - /* "View.MemoryView":197 + /* "View.MemoryView":198 * info.ndim = self.ndim * info.shape = self._shape * info.strides = self._strides # <<<<<<<<<<<<<< @@ -52011,7 +52075,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_t_7 = __pyx_v_self->_strides; __pyx_v_info->strides = __pyx_t_7; - /* "View.MemoryView":198 + /* "View.MemoryView":199 * info.shape = self._shape * info.strides = self._strides * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -52020,7 +52084,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru */ __pyx_v_info->suboffsets = NULL; - /* "View.MemoryView":199 + /* "View.MemoryView":200 * info.strides = self._strides * info.suboffsets = NULL * info.itemsize = self.itemsize # <<<<<<<<<<<<<< @@ -52030,7 +52094,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_t_5 = __pyx_v_self->itemsize; __pyx_v_info->itemsize = __pyx_t_5; - /* "View.MemoryView":200 + /* "View.MemoryView":201 * info.suboffsets = NULL * info.itemsize = self.itemsize * info.readonly = 0 # <<<<<<<<<<<<<< @@ -52039,7 +52103,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru */ __pyx_v_info->readonly = 0; - /* "View.MemoryView":202 + /* "View.MemoryView":203 * info.readonly = 0 * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< @@ -52049,7 +52113,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); if (__pyx_t_1) { - /* "View.MemoryView":203 + /* "View.MemoryView":204 * * if flags & PyBUF_FORMAT: * info.format = self.format # <<<<<<<<<<<<<< @@ -52059,7 +52123,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_t_4 = __pyx_v_self->format; __pyx_v_info->format = __pyx_t_4; - /* "View.MemoryView":202 + /* "View.MemoryView":203 * info.readonly = 0 * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< @@ -52069,7 +52133,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru goto __pyx_L5; } - /* "View.MemoryView":205 + /* "View.MemoryView":206 * info.format = self.format * else: * info.format = NULL # <<<<<<<<<<<<<< @@ -52081,7 +52145,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru } __pyx_L5:; - /* "View.MemoryView":207 + /* "View.MemoryView":208 * info.format = NULL * * info.obj = self # <<<<<<<<<<<<<< @@ -52094,7 +52158,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - /* "View.MemoryView":185 + /* "View.MemoryView":186 * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< @@ -52124,7 +52188,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru return __pyx_r; } -/* "View.MemoryView":211 +/* "View.MemoryView":212 * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") * * def __dealloc__(array self): # <<<<<<<<<<<<<< @@ -52148,7 +52212,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc int __pyx_t_1; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "View.MemoryView":212 + /* "View.MemoryView":213 * * def __dealloc__(array self): * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< @@ -52158,7 +52222,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0); if (__pyx_t_1) { - /* "View.MemoryView":213 + /* "View.MemoryView":214 * def __dealloc__(array self): * if self.callback_free_data != NULL: * self.callback_free_data(self.data) # <<<<<<<<<<<<<< @@ -52167,7 +52231,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc */ __pyx_v_self->callback_free_data(__pyx_v_self->data); - /* "View.MemoryView":212 + /* "View.MemoryView":213 * * def __dealloc__(array self): * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< @@ -52177,7 +52241,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc goto __pyx_L3; } - /* "View.MemoryView":214 + /* "View.MemoryView":215 * if self.callback_free_data != NULL: * self.callback_free_data(self.data) * elif self.free_data: # <<<<<<<<<<<<<< @@ -52187,7 +52251,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc __pyx_t_1 = (__pyx_v_self->free_data != 0); if (__pyx_t_1) { - /* "View.MemoryView":215 + /* "View.MemoryView":216 * self.callback_free_data(self.data) * elif self.free_data: * if self.dtype_is_object: # <<<<<<<<<<<<<< @@ -52197,7 +52261,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); if (__pyx_t_1) { - /* "View.MemoryView":216 + /* "View.MemoryView":217 * elif self.free_data: * if self.dtype_is_object: * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<< @@ -52206,7 +52270,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc */ __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0); - /* "View.MemoryView":215 + /* "View.MemoryView":216 * self.callback_free_data(self.data) * elif self.free_data: * if self.dtype_is_object: # <<<<<<<<<<<<<< @@ -52215,7 +52279,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc */ } - /* "View.MemoryView":218 + /* "View.MemoryView":219 * refcount_objects_in_slice(self.data, self._shape, * self._strides, self.ndim, False) * free(self.data) # <<<<<<<<<<<<<< @@ -52224,7 +52288,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc */ free(__pyx_v_self->data); - /* "View.MemoryView":214 + /* "View.MemoryView":215 * if self.callback_free_data != NULL: * self.callback_free_data(self.data) * elif self.free_data: # <<<<<<<<<<<<<< @@ -52234,7 +52298,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc } __pyx_L3:; - /* "View.MemoryView":219 + /* "View.MemoryView":220 * self._strides, self.ndim, False) * free(self.data) * PyObject_Free(self._shape) # <<<<<<<<<<<<<< @@ -52243,7 +52307,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc */ PyObject_Free(__pyx_v_self->_shape); - /* "View.MemoryView":211 + /* "View.MemoryView":212 * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") * * def __dealloc__(array self): # <<<<<<<<<<<<<< @@ -52255,7 +52319,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc __Pyx_RefNannyFinishContext(); } -/* "View.MemoryView":222 +/* "View.MemoryView":223 * * @property * def memview(self): # <<<<<<<<<<<<<< @@ -52285,7 +52349,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct _ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":223 + /* "View.MemoryView":224 * @property * def memview(self): * return self.get_memview() # <<<<<<<<<<<<<< @@ -52293,13 +52357,13 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct _ * @cname('get_memview') */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 223, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "View.MemoryView":222 + /* "View.MemoryView":223 * * @property * def memview(self): # <<<<<<<<<<<<<< @@ -52318,7 +52382,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct _ return __pyx_r; } -/* "View.MemoryView":226 +/* "View.MemoryView":227 * * @cname('get_memview') * cdef get_memview(self): # <<<<<<<<<<<<<< @@ -52338,7 +52402,7 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_memview", 0); - /* "View.MemoryView":227 + /* "View.MemoryView":228 * @cname('get_memview') * cdef get_memview(self): * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<< @@ -52347,7 +52411,7 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { */ __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE); - /* "View.MemoryView":228 + /* "View.MemoryView":229 * cdef get_memview(self): * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<< @@ -52355,11 +52419,11 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { * def __len__(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 228, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 228, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 228, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); @@ -52370,14 +52434,14 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 228, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":226 + /* "View.MemoryView":227 * * @cname('get_memview') * cdef get_memview(self): # <<<<<<<<<<<<<< @@ -52398,7 +52462,7 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { return __pyx_r; } -/* "View.MemoryView":230 +/* "View.MemoryView":231 * return memoryview(self, flags, self.dtype_is_object) * * def __len__(self): # <<<<<<<<<<<<<< @@ -52424,7 +52488,7 @@ static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(str __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); - /* "View.MemoryView":231 + /* "View.MemoryView":232 * * def __len__(self): * return self._shape[0] # <<<<<<<<<<<<<< @@ -52434,7 +52498,7 @@ static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(str __pyx_r = (__pyx_v_self->_shape[0]); goto __pyx_L0; - /* "View.MemoryView":230 + /* "View.MemoryView":231 * return memoryview(self, flags, self.dtype_is_object) * * def __len__(self): # <<<<<<<<<<<<<< @@ -52448,7 +52512,7 @@ static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(str return __pyx_r; } -/* "View.MemoryView":233 +/* "View.MemoryView":234 * return self._shape[0] * * def __getattr__(self, attr): # <<<<<<<<<<<<<< @@ -52479,7 +52543,7 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getattr__", 0); - /* "View.MemoryView":234 + /* "View.MemoryView":235 * * def __getattr__(self, attr): * return getattr(self.memview, attr) # <<<<<<<<<<<<<< @@ -52487,16 +52551,16 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__( * def __getitem__(self, item): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 234, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 234, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":233 + /* "View.MemoryView":234 * return self._shape[0] * * def __getattr__(self, attr): # <<<<<<<<<<<<<< @@ -52516,7 +52580,7 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__( return __pyx_r; } -/* "View.MemoryView":236 +/* "View.MemoryView":237 * return getattr(self.memview, attr) * * def __getitem__(self, item): # <<<<<<<<<<<<<< @@ -52547,7 +52611,7 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); - /* "View.MemoryView":237 + /* "View.MemoryView":238 * * def __getitem__(self, item): * return self.memview[item] # <<<<<<<<<<<<<< @@ -52555,16 +52619,16 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__ * def __setitem__(self, item, value): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 237, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 237, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":236 + /* "View.MemoryView":237 * return getattr(self.memview, attr) * * def __getitem__(self, item): # <<<<<<<<<<<<<< @@ -52584,7 +52648,7 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__ return __pyx_r; } -/* "View.MemoryView":239 +/* "View.MemoryView":240 * return self.memview[item] * * def __setitem__(self, item, value): # <<<<<<<<<<<<<< @@ -52614,19 +52678,19 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 0); - /* "View.MemoryView":240 + /* "View.MemoryView":241 * * def __setitem__(self, item, value): * self.memview[item] = value # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 240, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 240, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 241, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":239 + /* "View.MemoryView":240 * return self.memview[item] * * def __setitem__(self, item, value): # <<<<<<<<<<<<<< @@ -52759,7 +52823,7 @@ static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct return __pyx_r; } -/* "View.MemoryView":244 +/* "View.MemoryView":245 * * @cname("__pyx_array_new") * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< @@ -52781,7 +52845,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize int __pyx_clineno = 0; __Pyx_RefNannySetupContext("array_cwrapper", 0); - /* "View.MemoryView":248 + /* "View.MemoryView":249 * cdef array result * * if buf == NULL: # <<<<<<<<<<<<<< @@ -52791,20 +52855,20 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize __pyx_t_1 = ((__pyx_v_buf == NULL) != 0); if (__pyx_t_1) { - /* "View.MemoryView":249 + /* "View.MemoryView":250 * * if buf == NULL: * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<< * else: * result = array(shape, itemsize, format, mode.decode('ASCII'), */ - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 249, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 249, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 249, __pyx_L1_error) + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 249, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); @@ -52818,13 +52882,13 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 249, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); __pyx_t_4 = 0; - /* "View.MemoryView":248 + /* "View.MemoryView":249 * cdef array result * * if buf == NULL: # <<<<<<<<<<<<<< @@ -52834,7 +52898,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize goto __pyx_L3; } - /* "View.MemoryView":251 + /* "View.MemoryView":252 * result = array(shape, itemsize, format, mode.decode('ASCII')) * else: * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< @@ -52842,13 +52906,13 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize * result.data = buf */ /*else*/ { - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 251, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 251, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 251, __pyx_L1_error) + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 251, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); @@ -52863,32 +52927,32 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize __pyx_t_5 = 0; __pyx_t_3 = 0; - /* "View.MemoryView":252 + /* "View.MemoryView":253 * else: * result = array(shape, itemsize, format, mode.decode('ASCII'), * allocate_buffer=False) # <<<<<<<<<<<<<< * result.data = buf * */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 252, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 252, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 253, __pyx_L1_error) - /* "View.MemoryView":251 + /* "View.MemoryView":252 * result = array(shape, itemsize, format, mode.decode('ASCII')) * else: * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< * allocate_buffer=False) * result.data = buf */ - __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 251, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5); __pyx_t_5 = 0; - /* "View.MemoryView":253 + /* "View.MemoryView":254 * result = array(shape, itemsize, format, mode.decode('ASCII'), * allocate_buffer=False) * result.data = buf # <<<<<<<<<<<<<< @@ -52899,7 +52963,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize } __pyx_L3:; - /* "View.MemoryView":255 + /* "View.MemoryView":256 * result.data = buf * * return result # <<<<<<<<<<<<<< @@ -52911,7 +52975,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize __pyx_r = __pyx_v_result; goto __pyx_L0; - /* "View.MemoryView":244 + /* "View.MemoryView":245 * * @cname("__pyx_array_new") * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< @@ -52934,7 +52998,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize return __pyx_r; } -/* "View.MemoryView":281 +/* "View.MemoryView":282 * cdef class Enum(object): * cdef object name * def __init__(self, name): # <<<<<<<<<<<<<< @@ -52971,7 +53035,7 @@ static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_ar else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 281, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 282, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -52982,7 +53046,7 @@ static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_ar } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 281, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 282, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -53000,7 +53064,7 @@ static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struc __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); - /* "View.MemoryView":282 + /* "View.MemoryView":283 * cdef object name * def __init__(self, name): * self.name = name # <<<<<<<<<<<<<< @@ -53013,7 +53077,7 @@ static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struc __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = __pyx_v_name; - /* "View.MemoryView":281 + /* "View.MemoryView":282 * cdef class Enum(object): * cdef object name * def __init__(self, name): # <<<<<<<<<<<<<< @@ -53027,7 +53091,7 @@ static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struc return __pyx_r; } -/* "View.MemoryView":283 +/* "View.MemoryView":284 * def __init__(self, name): * self.name = name * def __repr__(self): # <<<<<<<<<<<<<< @@ -53053,7 +53117,7 @@ static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__", 0); - /* "View.MemoryView":284 + /* "View.MemoryView":285 * self.name = name * def __repr__(self): * return self.name # <<<<<<<<<<<<<< @@ -53065,7 +53129,7 @@ static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr_ __pyx_r = __pyx_v_self->name; goto __pyx_L0; - /* "View.MemoryView":283 + /* "View.MemoryView":284 * def __init__(self, name): * self.name = name * def __repr__(self): # <<<<<<<<<<<<<< @@ -53373,7 +53437,7 @@ static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_Me return __pyx_r; } -/* "View.MemoryView":298 +/* "View.MemoryView":299 * * @cname('__pyx_align_pointer') * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< @@ -53387,7 +53451,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) void *__pyx_r; int __pyx_t_1; - /* "View.MemoryView":300 + /* "View.MemoryView":301 * cdef void *align_pointer(void *memory, size_t alignment) nogil: * "Align pointer memory on a given boundary" * cdef Py_intptr_t aligned_p = memory # <<<<<<<<<<<<<< @@ -53396,7 +53460,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) */ __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory); - /* "View.MemoryView":304 + /* "View.MemoryView":305 * * with cython.cdivision(True): * offset = aligned_p % alignment # <<<<<<<<<<<<<< @@ -53405,7 +53469,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) */ __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); - /* "View.MemoryView":306 + /* "View.MemoryView":307 * offset = aligned_p % alignment * * if offset > 0: # <<<<<<<<<<<<<< @@ -53415,7 +53479,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) __pyx_t_1 = ((__pyx_v_offset > 0) != 0); if (__pyx_t_1) { - /* "View.MemoryView":307 + /* "View.MemoryView":308 * * if offset > 0: * aligned_p += alignment - offset # <<<<<<<<<<<<<< @@ -53424,7 +53488,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) */ __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset)); - /* "View.MemoryView":306 + /* "View.MemoryView":307 * offset = aligned_p % alignment * * if offset > 0: # <<<<<<<<<<<<<< @@ -53433,7 +53497,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) */ } - /* "View.MemoryView":309 + /* "View.MemoryView":310 * aligned_p += alignment - offset * * return aligned_p # <<<<<<<<<<<<<< @@ -53443,7 +53507,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) __pyx_r = ((void *)__pyx_v_aligned_p); goto __pyx_L0; - /* "View.MemoryView":298 + /* "View.MemoryView":299 * * @cname('__pyx_align_pointer') * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< @@ -53456,7 +53520,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) return __pyx_r; } -/* "View.MemoryView":345 +/* "View.MemoryView":346 * cdef __Pyx_TypeInfo *typeinfo * * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< @@ -53501,7 +53565,7 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 345, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 346, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -53511,7 +53575,7 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 345, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 346, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -53524,16 +53588,16 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar } } __pyx_v_obj = values[0]; - __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 345, __pyx_L3_error) + __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 346, __pyx_L3_error) if (values[2]) { - __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 345, __pyx_L3_error) + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 346, __pyx_L3_error) } else { __pyx_v_dtype_is_object = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 345, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 346, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -53558,7 +53622,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "View.MemoryView":346 + /* "View.MemoryView":347 * * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): * self.obj = obj # <<<<<<<<<<<<<< @@ -53571,7 +53635,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ __Pyx_DECREF(__pyx_v_self->obj); __pyx_v_self->obj = __pyx_v_obj; - /* "View.MemoryView":347 + /* "View.MemoryView":348 * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): * self.obj = obj * self.flags = flags # <<<<<<<<<<<<<< @@ -53580,7 +53644,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ */ __pyx_v_self->flags = __pyx_v_flags; - /* "View.MemoryView":348 + /* "View.MemoryView":349 * self.obj = obj * self.flags = flags * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< @@ -53600,16 +53664,16 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ __pyx_L4_bool_binop_done:; if (__pyx_t_1) { - /* "View.MemoryView":349 + /* "View.MemoryView":350 * self.flags = flags * if type(self) is memoryview or obj is not None: * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<< * if self.view.obj == NULL: * (<__pyx_buffer *> &self.view).obj = Py_None */ - __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 349, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 350, __pyx_L1_error) - /* "View.MemoryView":350 + /* "View.MemoryView":351 * if type(self) is memoryview or obj is not None: * __Pyx_GetBuffer(obj, &self.view, flags) * if self.view.obj == NULL: # <<<<<<<<<<<<<< @@ -53619,7 +53683,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0); if (__pyx_t_1) { - /* "View.MemoryView":351 + /* "View.MemoryView":352 * __Pyx_GetBuffer(obj, &self.view, flags) * if self.view.obj == NULL: * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<< @@ -53628,16 +53692,16 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ */ ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None; - /* "View.MemoryView":352 + /* "View.MemoryView":353 * if self.view.obj == NULL: * (<__pyx_buffer *> &self.view).obj = Py_None * Py_INCREF(Py_None) # <<<<<<<<<<<<<< * - * global __pyx_memoryview_thread_locks_used + * if not __PYX_CYTHON_ATOMICS_ENABLED(): */ Py_INCREF(Py_None); - /* "View.MemoryView":350 + /* "View.MemoryView":351 * if type(self) is memoryview or obj is not None: * __Pyx_GetBuffer(obj, &self.view, flags) * if self.view.obj == NULL: # <<<<<<<<<<<<<< @@ -53646,7 +53710,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ */ } - /* "View.MemoryView":348 + /* "View.MemoryView":349 * self.obj = obj * self.flags = flags * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< @@ -53656,100 +53720,119 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ } /* "View.MemoryView":355 + * Py_INCREF(Py_None) * - * global __pyx_memoryview_thread_locks_used - * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] - * __pyx_memoryview_thread_locks_used += 1 + * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<< + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: */ - __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0); + __pyx_t_1 = ((!(__PYX_CYTHON_ATOMICS_ENABLED() != 0)) != 0); if (__pyx_t_1) { - /* "View.MemoryView":356 - * global __pyx_memoryview_thread_locks_used - * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<< - * __pyx_memoryview_thread_locks_used += 1 - * if self.lock is NULL: - */ - __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); - /* "View.MemoryView":357 - * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] - * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<< - * if self.lock is NULL: - * self.lock = PyThread_allocate_lock() + * if not __PYX_CYTHON_ATOMICS_ENABLED(): + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 */ - __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1); + __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0); + if (__pyx_t_1) { - /* "View.MemoryView":355 - * - * global __pyx_memoryview_thread_locks_used - * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] - * __pyx_memoryview_thread_locks_used += 1 + /* "View.MemoryView":358 + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: */ - } + __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); - /* "View.MemoryView":358 - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] - * __pyx_memoryview_thread_locks_used += 1 - * if self.lock is NULL: # <<<<<<<<<<<<<< - * self.lock = PyThread_allocate_lock() + /* "View.MemoryView":359 + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<< * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() */ - __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); - if (__pyx_t_1) { + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1); - /* "View.MemoryView":359 - * __pyx_memoryview_thread_locks_used += 1 - * if self.lock is NULL: - * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<< - * if self.lock is NULL: - * raise MemoryError + /* "View.MemoryView":357 + * if not __PYX_CYTHON_ATOMICS_ENABLED(): + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 */ - __pyx_v_self->lock = PyThread_allocate_lock(); + } /* "View.MemoryView":360 - * if self.lock is NULL: - * self.lock = PyThread_allocate_lock() + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 * if self.lock is NULL: # <<<<<<<<<<<<<< - * raise MemoryError - * + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: */ __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); - if (unlikely(__pyx_t_1)) { + if (__pyx_t_1) { /* "View.MemoryView":361 - * self.lock = PyThread_allocate_lock() + * __pyx_memoryview_thread_locks_used += 1 * if self.lock is NULL: - * raise MemoryError # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<< + * if self.lock is NULL: + * raise MemoryError + */ + __pyx_v_self->lock = PyThread_allocate_lock(); + + /* "View.MemoryView":362 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":363 + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + * raise MemoryError # <<<<<<<<<<<<<< * * if flags & PyBUF_FORMAT: */ - PyErr_NoMemory(); __PYX_ERR(2, 361, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(2, 363, __pyx_L1_error) + + /* "View.MemoryView":362 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + } /* "View.MemoryView":360 - * if self.lock is NULL: - * self.lock = PyThread_allocate_lock() + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 * if self.lock is NULL: # <<<<<<<<<<<<<< - * raise MemoryError - * + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: */ } - /* "View.MemoryView":358 - * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] - * __pyx_memoryview_thread_locks_used += 1 - * if self.lock is NULL: # <<<<<<<<<<<<<< - * self.lock = PyThread_allocate_lock() - * if self.lock is NULL: + /* "View.MemoryView":355 + * Py_INCREF(Py_None) + * + * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<< + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: */ } - /* "View.MemoryView":363 - * raise MemoryError + /* "View.MemoryView":365 + * raise MemoryError * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') @@ -53758,7 +53841,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); if (__pyx_t_1) { - /* "View.MemoryView":364 + /* "View.MemoryView":366 * * if flags & PyBUF_FORMAT: * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<< @@ -53769,24 +53852,24 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; - goto __pyx_L11_bool_binop_done; + goto __pyx_L12_bool_binop_done; } __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0); __pyx_t_1 = __pyx_t_2; - __pyx_L11_bool_binop_done:; + __pyx_L12_bool_binop_done:; __pyx_v_self->dtype_is_object = __pyx_t_1; - /* "View.MemoryView":363 - * raise MemoryError + /* "View.MemoryView":365 + * raise MemoryError * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') * else: */ - goto __pyx_L10; + goto __pyx_L11; } - /* "View.MemoryView":366 + /* "View.MemoryView":368 * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') * else: * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<< @@ -53796,9 +53879,9 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ /*else*/ { __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object; } - __pyx_L10:; + __pyx_L11:; - /* "View.MemoryView":368 + /* "View.MemoryView":370 * self.dtype_is_object = dtype_is_object * * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<< @@ -53807,7 +53890,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ */ __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int)))); - /* "View.MemoryView":370 + /* "View.MemoryView":372 * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) * self.typeinfo = NULL # <<<<<<<<<<<<<< @@ -53816,7 +53899,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ */ __pyx_v_self->typeinfo = NULL; - /* "View.MemoryView":345 + /* "View.MemoryView":346 * cdef __Pyx_TypeInfo *typeinfo * * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< @@ -53835,7 +53918,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ return __pyx_r; } -/* "View.MemoryView":372 +/* "View.MemoryView":374 * self.typeinfo = NULL * * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< @@ -53866,7 +53949,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal PyThread_type_lock __pyx_t_7; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "View.MemoryView":373 + /* "View.MemoryView":375 * * def __dealloc__(memoryview self): * if self.obj is not None: # <<<<<<<<<<<<<< @@ -53877,7 +53960,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":374 + /* "View.MemoryView":376 * def __dealloc__(memoryview self): * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<< @@ -53886,7 +53969,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal */ __Pyx_ReleaseBuffer((&__pyx_v_self->view)); - /* "View.MemoryView":373 + /* "View.MemoryView":375 * * def __dealloc__(memoryview self): * if self.obj is not None: # <<<<<<<<<<<<<< @@ -53896,7 +53979,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal goto __pyx_L3; } - /* "View.MemoryView":375 + /* "View.MemoryView":377 * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<< @@ -53906,7 +53989,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0); if (__pyx_t_2) { - /* "View.MemoryView":377 + /* "View.MemoryView":379 * elif (<__pyx_buffer *> &self.view).obj == Py_None: * * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<< @@ -53915,7 +53998,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal */ ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL; - /* "View.MemoryView":378 + /* "View.MemoryView":380 * * (<__pyx_buffer *> &self.view).obj = NULL * Py_DECREF(Py_None) # <<<<<<<<<<<<<< @@ -53924,7 +54007,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal */ Py_DECREF(Py_None); - /* "View.MemoryView":375 + /* "View.MemoryView":377 * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<< @@ -53934,7 +54017,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal } __pyx_L3:; - /* "View.MemoryView":382 + /* "View.MemoryView":384 * cdef int i * global __pyx_memoryview_thread_locks_used * if self.lock != NULL: # <<<<<<<<<<<<<< @@ -53944,7 +54027,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0); if (__pyx_t_2) { - /* "View.MemoryView":383 + /* "View.MemoryView":385 * global __pyx_memoryview_thread_locks_used * if self.lock != NULL: * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<< @@ -53956,7 +54039,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; - /* "View.MemoryView":384 + /* "View.MemoryView":386 * if self.lock != NULL: * for i in range(__pyx_memoryview_thread_locks_used): * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< @@ -53966,7 +54049,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0); if (__pyx_t_2) { - /* "View.MemoryView":385 + /* "View.MemoryView":387 * for i in range(__pyx_memoryview_thread_locks_used): * if __pyx_memoryview_thread_locks[i] is self.lock: * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<< @@ -53975,7 +54058,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal */ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1); - /* "View.MemoryView":386 + /* "View.MemoryView":388 * if __pyx_memoryview_thread_locks[i] is self.lock: * __pyx_memoryview_thread_locks_used -= 1 * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< @@ -53985,7 +54068,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0); if (__pyx_t_2) { - /* "View.MemoryView":388 + /* "View.MemoryView":390 * if i != __pyx_memoryview_thread_locks_used: * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<< @@ -53995,7 +54078,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]); - /* "View.MemoryView":387 + /* "View.MemoryView":389 * __pyx_memoryview_thread_locks_used -= 1 * if i != __pyx_memoryview_thread_locks_used: * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<< @@ -54005,7 +54088,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6; (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7; - /* "View.MemoryView":386 + /* "View.MemoryView":388 * if __pyx_memoryview_thread_locks[i] is self.lock: * __pyx_memoryview_thread_locks_used -= 1 * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< @@ -54014,7 +54097,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal */ } - /* "View.MemoryView":389 + /* "View.MemoryView":391 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) * break # <<<<<<<<<<<<<< @@ -54023,7 +54106,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal */ goto __pyx_L6_break; - /* "View.MemoryView":384 + /* "View.MemoryView":386 * if self.lock != NULL: * for i in range(__pyx_memoryview_thread_locks_used): * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< @@ -54034,7 +54117,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal } /*else*/ { - /* "View.MemoryView":391 + /* "View.MemoryView":393 * break * else: * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<< @@ -54045,7 +54128,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal } __pyx_L6_break:; - /* "View.MemoryView":382 + /* "View.MemoryView":384 * cdef int i * global __pyx_memoryview_thread_locks_used * if self.lock != NULL: # <<<<<<<<<<<<<< @@ -54054,7 +54137,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal */ } - /* "View.MemoryView":372 + /* "View.MemoryView":374 * self.typeinfo = NULL * * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< @@ -54066,7 +54149,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal __Pyx_RefNannyFinishContext(); } -/* "View.MemoryView":393 +/* "View.MemoryView":395 * PyThread_free_lock(self.lock) * * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< @@ -54092,7 +54175,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_item_pointer", 0); - /* "View.MemoryView":395 + /* "View.MemoryView":397 * cdef char *get_item_pointer(memoryview self, object index) except NULL: * cdef Py_ssize_t dim * cdef char *itemp = self.view.buf # <<<<<<<<<<<<<< @@ -54101,7 +54184,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py */ __pyx_v_itemp = ((char *)__pyx_v_self->view.buf); - /* "View.MemoryView":397 + /* "View.MemoryView":399 * cdef char *itemp = self.view.buf * * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< @@ -54113,26 +54196,26 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 397, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 397, __pyx_L1_error) + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 399, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 397, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 399, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 397, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 397, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 399, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 397, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -54142,7 +54225,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(2, 397, __pyx_L1_error) + else __PYX_ERR(2, 399, __pyx_L1_error) } break; } @@ -54153,18 +54236,18 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py __pyx_v_dim = __pyx_t_1; __pyx_t_1 = (__pyx_t_1 + 1); - /* "View.MemoryView":398 + /* "View.MemoryView":400 * * for dim, idx in enumerate(index): * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<< * * return itemp */ - __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 398, __pyx_L1_error) - __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(2, 398, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 400, __pyx_L1_error) + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(2, 400, __pyx_L1_error) __pyx_v_itemp = __pyx_t_7; - /* "View.MemoryView":397 + /* "View.MemoryView":399 * cdef char *itemp = self.view.buf * * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< @@ -54174,7 +54257,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":400 + /* "View.MemoryView":402 * itemp = pybuffer_index(&self.view, itemp, idx, dim) * * return itemp # <<<<<<<<<<<<<< @@ -54184,7 +54267,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py __pyx_r = __pyx_v_itemp; goto __pyx_L0; - /* "View.MemoryView":393 + /* "View.MemoryView":395 * PyThread_free_lock(self.lock) * * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< @@ -54204,7 +54287,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py return __pyx_r; } -/* "View.MemoryView":403 +/* "View.MemoryView":405 * * * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< @@ -54242,7 +54325,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); - /* "View.MemoryView":404 + /* "View.MemoryView":406 * * def __getitem__(memoryview self, object index): * if index is Ellipsis: # <<<<<<<<<<<<<< @@ -54253,7 +54336,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":405 + /* "View.MemoryView":407 * def __getitem__(memoryview self, object index): * if index is Ellipsis: * return self # <<<<<<<<<<<<<< @@ -54265,7 +54348,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "View.MemoryView":404 + /* "View.MemoryView":406 * * def __getitem__(memoryview self, object index): * if index is Ellipsis: # <<<<<<<<<<<<<< @@ -54274,14 +54357,14 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ */ } - /* "View.MemoryView":407 + /* "View.MemoryView":409 * return self * * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< * * cdef char *itemp */ - __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 407, __pyx_L1_error) + __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(__pyx_t_3 != Py_None)) { PyObject* sequence = __pyx_t_3; @@ -54289,7 +54372,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(2, 407, __pyx_L1_error) + __PYX_ERR(2, 409, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); @@ -54297,31 +54380,31 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else - __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 407, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 407, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 407, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 409, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_indices = __pyx_t_5; __pyx_t_5 = 0; - /* "View.MemoryView":410 + /* "View.MemoryView":412 * * cdef char *itemp * if have_slices: # <<<<<<<<<<<<<< * return memview_slice(self, indices) * else: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 410, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 412, __pyx_L1_error) if (__pyx_t_2) { - /* "View.MemoryView":411 + /* "View.MemoryView":413 * cdef char *itemp * if have_slices: * return memview_slice(self, indices) # <<<<<<<<<<<<<< @@ -54329,13 +54412,13 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ * itemp = self.get_item_pointer(indices) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 411, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "View.MemoryView":410 + /* "View.MemoryView":412 * * cdef char *itemp * if have_slices: # <<<<<<<<<<<<<< @@ -54344,7 +54427,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ */ } - /* "View.MemoryView":413 + /* "View.MemoryView":415 * return memview_slice(self, indices) * else: * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<< @@ -54352,10 +54435,10 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ * */ /*else*/ { - __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(2, 413, __pyx_L1_error) + __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(2, 415, __pyx_L1_error) __pyx_v_itemp = __pyx_t_6; - /* "View.MemoryView":414 + /* "View.MemoryView":416 * else: * itemp = self.get_item_pointer(indices) * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<< @@ -54363,14 +54446,14 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ * def __setitem__(memoryview self, object index, object value): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 414, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } - /* "View.MemoryView":403 + /* "View.MemoryView":405 * * * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< @@ -54393,7 +54476,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ return __pyx_r; } -/* "View.MemoryView":416 +/* "View.MemoryView":418 * return self.convert_item_to_object(itemp) * * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< @@ -54429,7 +54512,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit __Pyx_RefNannySetupContext("__setitem__", 0); __Pyx_INCREF(__pyx_v_index); - /* "View.MemoryView":417 + /* "View.MemoryView":419 * * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: # <<<<<<<<<<<<<< @@ -54439,20 +54522,20 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit __pyx_t_1 = (__pyx_v_self->view.readonly != 0); if (unlikely(__pyx_t_1)) { - /* "View.MemoryView":418 + /* "View.MemoryView":420 * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<< * * have_slices, index = _unellipsify(index, self.view.ndim) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 418, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(2, 418, __pyx_L1_error) + __PYX_ERR(2, 420, __pyx_L1_error) - /* "View.MemoryView":417 + /* "View.MemoryView":419 * * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: # <<<<<<<<<<<<<< @@ -54461,14 +54544,14 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit */ } - /* "View.MemoryView":420 + /* "View.MemoryView":422 * raise TypeError("Cannot assign to read-only memoryview") * * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< * * if have_slices: */ - __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 420, __pyx_L1_error) + __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(__pyx_t_2 != Py_None)) { PyObject* sequence = __pyx_t_2; @@ -54476,7 +54559,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(2, 420, __pyx_L1_error) + __PYX_ERR(2, 422, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); @@ -54484,67 +54567,67 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 420, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 420, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 420, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 422, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_3; __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4); __pyx_t_4 = 0; - /* "View.MemoryView":422 + /* "View.MemoryView":424 * have_slices, index = _unellipsify(index, self.view.ndim) * * if have_slices: # <<<<<<<<<<<<<< * obj = self.is_slice(value) * if obj: */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 422, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 424, __pyx_L1_error) if (__pyx_t_1) { - /* "View.MemoryView":423 + /* "View.MemoryView":425 * * if have_slices: * obj = self.is_slice(value) # <<<<<<<<<<<<<< * if obj: * self.setitem_slice_assignment(self[index], obj) */ - __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 423, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_obj = __pyx_t_2; __pyx_t_2 = 0; - /* "View.MemoryView":424 + /* "View.MemoryView":426 * if have_slices: * obj = self.is_slice(value) * if obj: # <<<<<<<<<<<<<< * self.setitem_slice_assignment(self[index], obj) * else: */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 424, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 426, __pyx_L1_error) if (__pyx_t_1) { - /* "View.MemoryView":425 + /* "View.MemoryView":427 * obj = self.is_slice(value) * if obj: * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<< * else: * self.setitem_slice_assign_scalar(self[index], value) */ - __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 425, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 425, __pyx_L1_error) + __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "View.MemoryView":424 + /* "View.MemoryView":426 * if have_slices: * obj = self.is_slice(value) * if obj: # <<<<<<<<<<<<<< @@ -54554,7 +54637,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit goto __pyx_L5; } - /* "View.MemoryView":427 + /* "View.MemoryView":429 * self.setitem_slice_assignment(self[index], obj) * else: * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<< @@ -54562,17 +54645,17 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit * self.setitem_indexed(index, value) */ /*else*/ { - __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 427, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(2, 427, __pyx_L1_error) - __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 427, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(2, 429, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L5:; - /* "View.MemoryView":422 + /* "View.MemoryView":424 * have_slices, index = _unellipsify(index, self.view.ndim) * * if have_slices: # <<<<<<<<<<<<<< @@ -54582,7 +54665,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit goto __pyx_L4; } - /* "View.MemoryView":429 + /* "View.MemoryView":431 * self.setitem_slice_assign_scalar(self[index], value) * else: * self.setitem_indexed(index, value) # <<<<<<<<<<<<<< @@ -54590,13 +54673,13 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit * cdef is_slice(self, obj): */ /*else*/ { - __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 429, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L4:; - /* "View.MemoryView":416 + /* "View.MemoryView":418 * return self.convert_item_to_object(itemp) * * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< @@ -54621,7 +54704,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit return __pyx_r; } -/* "View.MemoryView":431 +/* "View.MemoryView":433 * self.setitem_indexed(index, value) * * cdef is_slice(self, obj): # <<<<<<<<<<<<<< @@ -54647,7 +54730,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ __Pyx_RefNannySetupContext("is_slice", 0); __Pyx_INCREF(__pyx_v_obj); - /* "View.MemoryView":432 + /* "View.MemoryView":434 * * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< @@ -54658,7 +54741,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":433 + /* "View.MemoryView":435 * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): * try: # <<<<<<<<<<<<<< @@ -54674,34 +54757,34 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ __Pyx_XGOTREF(__pyx_t_5); /*try:*/ { - /* "View.MemoryView":434 + /* "View.MemoryView":436 * if not isinstance(obj, memoryview): * try: * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< * self.dtype_is_object) * except TypeError: */ - __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 434, __pyx_L4_error) + __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 436, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); - /* "View.MemoryView":435 + /* "View.MemoryView":437 * try: * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, * self.dtype_is_object) # <<<<<<<<<<<<<< * except TypeError: * return None */ - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 435, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 437, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); - /* "View.MemoryView":434 + /* "View.MemoryView":436 * if not isinstance(obj, memoryview): * try: * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< * self.dtype_is_object) * except TypeError: */ - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 434, __pyx_L4_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 436, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); @@ -54712,13 +54795,13 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7); __pyx_t_6 = 0; __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 434, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 436, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); __pyx_t_7 = 0; - /* "View.MemoryView":433 + /* "View.MemoryView":435 * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): * try: # <<<<<<<<<<<<<< @@ -54735,7 +54818,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "View.MemoryView":436 + /* "View.MemoryView":438 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, * self.dtype_is_object) * except TypeError: # <<<<<<<<<<<<<< @@ -54745,12 +54828,12 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_9) { __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(2, 436, __pyx_L6_except_error) + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(2, 438, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_6); - /* "View.MemoryView":437 + /* "View.MemoryView":439 * self.dtype_is_object) * except TypeError: * return None # <<<<<<<<<<<<<< @@ -54767,7 +54850,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ goto __pyx_L6_except_error; __pyx_L6_except_error:; - /* "View.MemoryView":433 + /* "View.MemoryView":435 * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): * try: # <<<<<<<<<<<<<< @@ -54788,7 +54871,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ __pyx_L9_try_end:; } - /* "View.MemoryView":432 + /* "View.MemoryView":434 * * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< @@ -54797,7 +54880,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ */ } - /* "View.MemoryView":439 + /* "View.MemoryView":441 * return None * * return obj # <<<<<<<<<<<<<< @@ -54809,7 +54892,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ __pyx_r = __pyx_v_obj; goto __pyx_L0; - /* "View.MemoryView":431 + /* "View.MemoryView":433 * self.setitem_indexed(index, value) * * cdef is_slice(self, obj): # <<<<<<<<<<<<<< @@ -54831,7 +54914,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ return __pyx_r; } -/* "View.MemoryView":441 +/* "View.MemoryView":443 * return obj * * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< @@ -54855,52 +54938,52 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setitem_slice_assignment", 0); - /* "View.MemoryView":445 + /* "View.MemoryView":447 * cdef __Pyx_memviewslice src_slice * * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< * get_slice_from_memview(dst, &dst_slice)[0], * src.ndim, dst.ndim, self.dtype_is_object) */ - if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 445, __pyx_L1_error) - __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 445, __pyx_L1_error) + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 447, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 447, __pyx_L1_error) - /* "View.MemoryView":446 + /* "View.MemoryView":448 * * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<< * src.ndim, dst.ndim, self.dtype_is_object) * */ - if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 446, __pyx_L1_error) - __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 446, __pyx_L1_error) + if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 448, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 448, __pyx_L1_error) - /* "View.MemoryView":447 + /* "View.MemoryView":449 * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], * get_slice_from_memview(dst, &dst_slice)[0], * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<< * * cdef setitem_slice_assign_scalar(self, memoryview dst, value): */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 447, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 447, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 449, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 447, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 447, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 449, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":445 + /* "View.MemoryView":447 * cdef __Pyx_memviewslice src_slice * * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< * get_slice_from_memview(dst, &dst_slice)[0], * src.ndim, dst.ndim, self.dtype_is_object) */ - __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 445, __pyx_L1_error) + __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 447, __pyx_L1_error) - /* "View.MemoryView":441 + /* "View.MemoryView":443 * return obj * * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< @@ -54921,7 +55004,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi return __pyx_r; } -/* "View.MemoryView":449 +/* "View.MemoryView":451 * src.ndim, dst.ndim, self.dtype_is_object) * * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< @@ -54954,7 +55037,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0); - /* "View.MemoryView":451 + /* "View.MemoryView":453 * cdef setitem_slice_assign_scalar(self, memoryview dst, value): * cdef int array[128] * cdef void *tmp = NULL # <<<<<<<<<<<<<< @@ -54963,17 +55046,17 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor */ __pyx_v_tmp = NULL; - /* "View.MemoryView":456 + /* "View.MemoryView":458 * cdef __Pyx_memviewslice *dst_slice * cdef __Pyx_memviewslice tmp_slice * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<< * * if self.view.itemsize > sizeof(array): */ - __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 456, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 458, __pyx_L1_error) __pyx_v_dst_slice = __pyx_t_1; - /* "View.MemoryView":458 + /* "View.MemoryView":460 * dst_slice = get_slice_from_memview(dst, &tmp_slice) * * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< @@ -54983,7 +55066,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0); if (__pyx_t_2) { - /* "View.MemoryView":459 + /* "View.MemoryView":461 * * if self.view.itemsize > sizeof(array): * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<< @@ -54992,7 +55075,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor */ __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize); - /* "View.MemoryView":460 + /* "View.MemoryView":462 * if self.view.itemsize > sizeof(array): * tmp = PyMem_Malloc(self.view.itemsize) * if tmp == NULL: # <<<<<<<<<<<<<< @@ -55002,16 +55085,16 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0); if (unlikely(__pyx_t_2)) { - /* "View.MemoryView":461 + /* "View.MemoryView":463 * tmp = PyMem_Malloc(self.view.itemsize) * if tmp == NULL: * raise MemoryError # <<<<<<<<<<<<<< * item = tmp * else: */ - PyErr_NoMemory(); __PYX_ERR(2, 461, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(2, 463, __pyx_L1_error) - /* "View.MemoryView":460 + /* "View.MemoryView":462 * if self.view.itemsize > sizeof(array): * tmp = PyMem_Malloc(self.view.itemsize) * if tmp == NULL: # <<<<<<<<<<<<<< @@ -55020,7 +55103,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor */ } - /* "View.MemoryView":462 + /* "View.MemoryView":464 * if tmp == NULL: * raise MemoryError * item = tmp # <<<<<<<<<<<<<< @@ -55029,7 +55112,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor */ __pyx_v_item = __pyx_v_tmp; - /* "View.MemoryView":458 + /* "View.MemoryView":460 * dst_slice = get_slice_from_memview(dst, &tmp_slice) * * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< @@ -55039,7 +55122,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor goto __pyx_L3; } - /* "View.MemoryView":464 + /* "View.MemoryView":466 * item = tmp * else: * item = array # <<<<<<<<<<<<<< @@ -55051,7 +55134,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor } __pyx_L3:; - /* "View.MemoryView":466 + /* "View.MemoryView":468 * item = array * * try: # <<<<<<<<<<<<<< @@ -55060,7 +55143,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor */ /*try:*/ { - /* "View.MemoryView":467 + /* "View.MemoryView":469 * * try: * if self.dtype_is_object: # <<<<<<<<<<<<<< @@ -55070,7 +55153,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0); if (__pyx_t_2) { - /* "View.MemoryView":468 + /* "View.MemoryView":470 * try: * if self.dtype_is_object: * ( item)[0] = value # <<<<<<<<<<<<<< @@ -55079,7 +55162,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor */ (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value); - /* "View.MemoryView":467 + /* "View.MemoryView":469 * * try: * if self.dtype_is_object: # <<<<<<<<<<<<<< @@ -55089,7 +55172,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor goto __pyx_L8; } - /* "View.MemoryView":470 + /* "View.MemoryView":472 * ( item)[0] = value * else: * self.assign_item_from_object( item, value) # <<<<<<<<<<<<<< @@ -55097,13 +55180,13 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor * */ /*else*/ { - __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 470, __pyx_L6_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 472, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L8:; - /* "View.MemoryView":474 + /* "View.MemoryView":476 * * * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< @@ -55113,18 +55196,18 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0); if (__pyx_t_2) { - /* "View.MemoryView":475 + /* "View.MemoryView":477 * * if self.view.suboffsets != NULL: * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<< * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, * item, self.dtype_is_object) */ - __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 475, __pyx_L6_error) + __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 477, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":474 + /* "View.MemoryView":476 * * * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< @@ -55133,7 +55216,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor */ } - /* "View.MemoryView":476 + /* "View.MemoryView":478 * if self.view.suboffsets != NULL: * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<< @@ -55143,7 +55226,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object); } - /* "View.MemoryView":479 + /* "View.MemoryView":481 * item, self.dtype_is_object) * finally: * PyMem_Free(tmp) # <<<<<<<<<<<<<< @@ -55190,7 +55273,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor __pyx_L7:; } - /* "View.MemoryView":449 + /* "View.MemoryView":451 * src.ndim, dst.ndim, self.dtype_is_object) * * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< @@ -55211,7 +55294,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor return __pyx_r; } -/* "View.MemoryView":481 +/* "View.MemoryView":483 * PyMem_Free(tmp) * * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< @@ -55230,28 +55313,28 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setitem_indexed", 0); - /* "View.MemoryView":482 + /* "View.MemoryView":484 * * cdef setitem_indexed(self, index, value): * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<< * self.assign_item_from_object(itemp, value) * */ - __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(2, 482, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(2, 484, __pyx_L1_error) __pyx_v_itemp = __pyx_t_1; - /* "View.MemoryView":483 + /* "View.MemoryView":485 * cdef setitem_indexed(self, index, value): * cdef char *itemp = self.get_item_pointer(index) * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<< * * cdef convert_item_to_object(self, char *itemp): */ - __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 483, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":481 + /* "View.MemoryView":483 * PyMem_Free(tmp) * * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< @@ -55272,7 +55355,7 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_ return __pyx_r; } -/* "View.MemoryView":485 +/* "View.MemoryView":487 * self.assign_item_from_object(itemp, value) * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< @@ -55302,31 +55385,31 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview int __pyx_clineno = 0; __Pyx_RefNannySetupContext("convert_item_to_object", 0); - /* "View.MemoryView":488 + /* "View.MemoryView":490 * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" * import struct # <<<<<<<<<<<<<< * cdef bytes bytesitem * */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 488, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; - /* "View.MemoryView":491 + /* "View.MemoryView":493 * cdef bytes bytesitem * * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<< * try: * result = struct.unpack(self.view.format, bytesitem) */ - __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 491, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":492 + /* "View.MemoryView":494 * * bytesitem = itemp[:self.view.itemsize] * try: # <<<<<<<<<<<<<< @@ -55342,16 +55425,16 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { - /* "View.MemoryView":493 + /* "View.MemoryView":495 * bytesitem = itemp[:self.view.itemsize] * try: * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<< * except struct.error: * raise ValueError("Unable to convert item to object") */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 493, __pyx_L3_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 495, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 493, __pyx_L3_error) + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 495, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -55368,7 +55451,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 495, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -55377,14 +55460,14 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 495, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 493, __pyx_L3_error) + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 495, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -55395,7 +55478,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __Pyx_GIVEREF(__pyx_v_bytesitem); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem); __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 495, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -55403,7 +55486,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __pyx_v_result = __pyx_t_1; __pyx_t_1 = 0; - /* "View.MemoryView":492 + /* "View.MemoryView":494 * * bytesitem = itemp[:self.view.itemsize] * try: # <<<<<<<<<<<<<< @@ -55412,7 +55495,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview */ } - /* "View.MemoryView":497 + /* "View.MemoryView":499 * raise ValueError("Unable to convert item to object") * else: * if len(self.view.format) == 1: # <<<<<<<<<<<<<< @@ -55424,7 +55507,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __pyx_t_11 = ((__pyx_t_10 == 1) != 0); if (__pyx_t_11) { - /* "View.MemoryView":498 + /* "View.MemoryView":500 * else: * if len(self.view.format) == 1: * return result[0] # <<<<<<<<<<<<<< @@ -55432,13 +55515,13 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 498, __pyx_L5_except_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 500, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L6_except_return; - /* "View.MemoryView":497 + /* "View.MemoryView":499 * raise ValueError("Unable to convert item to object") * else: * if len(self.view.format) == 1: # <<<<<<<<<<<<<< @@ -55447,7 +55530,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview */ } - /* "View.MemoryView":499 + /* "View.MemoryView":501 * if len(self.view.format) == 1: * return result[0] * return result # <<<<<<<<<<<<<< @@ -55466,7 +55549,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "View.MemoryView":494 + /* "View.MemoryView":496 * try: * result = struct.unpack(self.view.format, bytesitem) * except struct.error: # <<<<<<<<<<<<<< @@ -55474,7 +55557,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview * else: */ __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 494, __pyx_L5_except_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 496, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -55482,28 +55565,28 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0; if (__pyx_t_8) { __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(2, 494, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(2, 496, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_1); - /* "View.MemoryView":495 + /* "View.MemoryView":497 * result = struct.unpack(self.view.format, bytesitem) * except struct.error: * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< * else: * if len(self.view.format) == 1: */ - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 495, __pyx_L5_except_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 497, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(2, 495, __pyx_L5_except_error) + __PYX_ERR(2, 497, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "View.MemoryView":492 + /* "View.MemoryView":494 * * bytesitem = itemp[:self.view.itemsize] * try: # <<<<<<<<<<<<<< @@ -55523,7 +55606,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview goto __pyx_L0; } - /* "View.MemoryView":485 + /* "View.MemoryView":487 * self.assign_item_from_object(itemp, value) * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< @@ -55549,7 +55632,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview return __pyx_r; } -/* "View.MemoryView":501 +/* "View.MemoryView":503 * return result * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< @@ -55583,19 +55666,19 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie int __pyx_clineno = 0; __Pyx_RefNannySetupContext("assign_item_from_object", 0); - /* "View.MemoryView":504 + /* "View.MemoryView":506 * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" * import struct # <<<<<<<<<<<<<< * cdef char c * cdef bytes bytesvalue */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 504, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; - /* "View.MemoryView":509 + /* "View.MemoryView":511 * cdef Py_ssize_t i * * if isinstance(value, tuple): # <<<<<<<<<<<<<< @@ -55606,37 +55689,37 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "View.MemoryView":510 + /* "View.MemoryView":512 * * if isinstance(value, tuple): * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<< * else: * bytesvalue = struct.pack(self.view.format, value) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 510, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 510, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 510, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 510, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 512, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "View.MemoryView":509 + /* "View.MemoryView":511 * cdef Py_ssize_t i * * if isinstance(value, tuple): # <<<<<<<<<<<<<< @@ -55646,7 +55729,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie goto __pyx_L3; } - /* "View.MemoryView":512 + /* "View.MemoryView":514 * bytesvalue = struct.pack(self.view.format, *value) * else: * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<< @@ -55654,9 +55737,9 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie * for i, c in enumerate(bytesvalue): */ /*else*/ { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 512, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 512, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_7 = 0; @@ -55673,7 +55756,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 514, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -55682,14 +55765,14 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 514, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 512, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -55700,18 +55783,18 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 512, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 514, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; } __pyx_L3:; - /* "View.MemoryView":514 + /* "View.MemoryView":516 * bytesvalue = struct.pack(self.view.format, value) * * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< @@ -55721,7 +55804,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie __pyx_t_9 = 0; if (unlikely(__pyx_v_bytesvalue == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); - __PYX_ERR(2, 514, __pyx_L1_error) + __PYX_ERR(2, 516, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_bytesvalue); __pyx_t_10 = __pyx_v_bytesvalue; @@ -55731,7 +55814,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie __pyx_t_11 = __pyx_t_14; __pyx_v_c = (__pyx_t_11[0]); - /* "View.MemoryView":515 + /* "View.MemoryView":517 * * for i, c in enumerate(bytesvalue): * itemp[i] = c # <<<<<<<<<<<<<< @@ -55740,7 +55823,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie */ __pyx_v_i = __pyx_t_9; - /* "View.MemoryView":514 + /* "View.MemoryView":516 * bytesvalue = struct.pack(self.view.format, value) * * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< @@ -55749,7 +55832,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie */ __pyx_t_9 = (__pyx_t_9 + 1); - /* "View.MemoryView":515 + /* "View.MemoryView":517 * * for i, c in enumerate(bytesvalue): * itemp[i] = c # <<<<<<<<<<<<<< @@ -55760,7 +55843,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "View.MemoryView":501 + /* "View.MemoryView":503 * return result * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< @@ -55788,7 +55871,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie return __pyx_r; } -/* "View.MemoryView":518 +/* "View.MemoryView":520 * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< @@ -55831,7 +55914,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); - /* "View.MemoryView":519 + /* "View.MemoryView":521 * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<< @@ -55849,20 +55932,20 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_L4_bool_binop_done:; if (unlikely(__pyx_t_1)) { - /* "View.MemoryView":520 + /* "View.MemoryView":522 * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<< * * if flags & PyBUF_ND: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 520, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 520, __pyx_L1_error) + __PYX_ERR(2, 522, __pyx_L1_error) - /* "View.MemoryView":519 + /* "View.MemoryView":521 * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<< @@ -55871,7 +55954,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu */ } - /* "View.MemoryView":522 + /* "View.MemoryView":524 * raise ValueError("Cannot create writable memory view from read-only memoryview") * * if flags & PyBUF_ND: # <<<<<<<<<<<<<< @@ -55881,7 +55964,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0); if (__pyx_t_1) { - /* "View.MemoryView":523 + /* "View.MemoryView":525 * * if flags & PyBUF_ND: * info.shape = self.view.shape # <<<<<<<<<<<<<< @@ -55891,7 +55974,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_4 = __pyx_v_self->view.shape; __pyx_v_info->shape = __pyx_t_4; - /* "View.MemoryView":522 + /* "View.MemoryView":524 * raise ValueError("Cannot create writable memory view from read-only memoryview") * * if flags & PyBUF_ND: # <<<<<<<<<<<<<< @@ -55901,7 +55984,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu goto __pyx_L6; } - /* "View.MemoryView":525 + /* "View.MemoryView":527 * info.shape = self.view.shape * else: * info.shape = NULL # <<<<<<<<<<<<<< @@ -55913,7 +55996,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu } __pyx_L6:; - /* "View.MemoryView":527 + /* "View.MemoryView":529 * info.shape = NULL * * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< @@ -55923,7 +56006,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); if (__pyx_t_1) { - /* "View.MemoryView":528 + /* "View.MemoryView":530 * * if flags & PyBUF_STRIDES: * info.strides = self.view.strides # <<<<<<<<<<<<<< @@ -55933,7 +56016,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_4 = __pyx_v_self->view.strides; __pyx_v_info->strides = __pyx_t_4; - /* "View.MemoryView":527 + /* "View.MemoryView":529 * info.shape = NULL * * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< @@ -55943,7 +56026,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu goto __pyx_L7; } - /* "View.MemoryView":530 + /* "View.MemoryView":532 * info.strides = self.view.strides * else: * info.strides = NULL # <<<<<<<<<<<<<< @@ -55955,7 +56038,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu } __pyx_L7:; - /* "View.MemoryView":532 + /* "View.MemoryView":534 * info.strides = NULL * * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< @@ -55965,7 +56048,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0); if (__pyx_t_1) { - /* "View.MemoryView":533 + /* "View.MemoryView":535 * * if flags & PyBUF_INDIRECT: * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<< @@ -55975,7 +56058,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_4 = __pyx_v_self->view.suboffsets; __pyx_v_info->suboffsets = __pyx_t_4; - /* "View.MemoryView":532 + /* "View.MemoryView":534 * info.strides = NULL * * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< @@ -55985,7 +56068,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu goto __pyx_L8; } - /* "View.MemoryView":535 + /* "View.MemoryView":537 * info.suboffsets = self.view.suboffsets * else: * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -55997,7 +56080,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu } __pyx_L8:; - /* "View.MemoryView":537 + /* "View.MemoryView":539 * info.suboffsets = NULL * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< @@ -56007,7 +56090,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); if (__pyx_t_1) { - /* "View.MemoryView":538 + /* "View.MemoryView":540 * * if flags & PyBUF_FORMAT: * info.format = self.view.format # <<<<<<<<<<<<<< @@ -56017,7 +56100,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_5 = __pyx_v_self->view.format; __pyx_v_info->format = __pyx_t_5; - /* "View.MemoryView":537 + /* "View.MemoryView":539 * info.suboffsets = NULL * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< @@ -56027,7 +56110,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu goto __pyx_L9; } - /* "View.MemoryView":540 + /* "View.MemoryView":542 * info.format = self.view.format * else: * info.format = NULL # <<<<<<<<<<<<<< @@ -56039,7 +56122,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu } __pyx_L9:; - /* "View.MemoryView":542 + /* "View.MemoryView":544 * info.format = NULL * * info.buf = self.view.buf # <<<<<<<<<<<<<< @@ -56049,7 +56132,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_6 = __pyx_v_self->view.buf; __pyx_v_info->buf = __pyx_t_6; - /* "View.MemoryView":543 + /* "View.MemoryView":545 * * info.buf = self.view.buf * info.ndim = self.view.ndim # <<<<<<<<<<<<<< @@ -56059,7 +56142,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_7 = __pyx_v_self->view.ndim; __pyx_v_info->ndim = __pyx_t_7; - /* "View.MemoryView":544 + /* "View.MemoryView":546 * info.buf = self.view.buf * info.ndim = self.view.ndim * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<< @@ -56069,7 +56152,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_8 = __pyx_v_self->view.itemsize; __pyx_v_info->itemsize = __pyx_t_8; - /* "View.MemoryView":545 + /* "View.MemoryView":547 * info.ndim = self.view.ndim * info.itemsize = self.view.itemsize * info.len = self.view.len # <<<<<<<<<<<<<< @@ -56079,7 +56162,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_8 = __pyx_v_self->view.len; __pyx_v_info->len = __pyx_t_8; - /* "View.MemoryView":546 + /* "View.MemoryView":548 * info.itemsize = self.view.itemsize * info.len = self.view.len * info.readonly = self.view.readonly # <<<<<<<<<<<<<< @@ -56089,7 +56172,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_t_1 = __pyx_v_self->view.readonly; __pyx_v_info->readonly = __pyx_t_1; - /* "View.MemoryView":547 + /* "View.MemoryView":549 * info.len = self.view.len * info.readonly = self.view.readonly * info.obj = self # <<<<<<<<<<<<<< @@ -56102,7 +56185,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - /* "View.MemoryView":518 + /* "View.MemoryView":520 * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< @@ -56132,7 +56215,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu return __pyx_r; } -/* "View.MemoryView":553 +/* "View.MemoryView":555 * * @property * def T(self): # <<<<<<<<<<<<<< @@ -56164,29 +56247,29 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct _ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":554 + /* "View.MemoryView":556 * @property * def T(self): * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<< * transpose_memslice(&result.from_slice) * return result */ - __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 554, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 554, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 556, __pyx_L1_error) __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":555 + /* "View.MemoryView":557 * def T(self): * cdef _memoryviewslice result = memoryview_copy(self) * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<< * return result * */ - __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 555, __pyx_L1_error) + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 557, __pyx_L1_error) - /* "View.MemoryView":556 + /* "View.MemoryView":558 * cdef _memoryviewslice result = memoryview_copy(self) * transpose_memslice(&result.from_slice) * return result # <<<<<<<<<<<<<< @@ -56198,7 +56281,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct _ __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; - /* "View.MemoryView":553 + /* "View.MemoryView":555 * * @property * def T(self): # <<<<<<<<<<<<<< @@ -56218,7 +56301,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct _ return __pyx_r; } -/* "View.MemoryView":559 +/* "View.MemoryView":561 * * @property * def base(self): # <<<<<<<<<<<<<< @@ -56244,7 +56327,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struc __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":560 + /* "View.MemoryView":562 * @property * def base(self): * return self.obj # <<<<<<<<<<<<<< @@ -56256,7 +56339,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struc __pyx_r = __pyx_v_self->obj; goto __pyx_L0; - /* "View.MemoryView":559 + /* "View.MemoryView":561 * * @property * def base(self): # <<<<<<<<<<<<<< @@ -56271,7 +56354,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struc return __pyx_r; } -/* "View.MemoryView":563 +/* "View.MemoryView":565 * * @property * def shape(self): # <<<<<<<<<<<<<< @@ -56306,7 +56389,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(stru int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":564 + /* "View.MemoryView":566 * @property * def shape(self): * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<< @@ -56314,25 +56397,25 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(stru * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 564, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { __pyx_t_2 = __pyx_t_4; __pyx_v_length = (__pyx_t_2[0]); - __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 564, __pyx_L1_error) + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 564, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 566, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 564, __pyx_L1_error) + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - /* "View.MemoryView":563 + /* "View.MemoryView":565 * * @property * def shape(self): # <<<<<<<<<<<<<< @@ -56352,7 +56435,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(stru return __pyx_r; } -/* "View.MemoryView":567 +/* "View.MemoryView":569 * * @property * def strides(self): # <<<<<<<<<<<<<< @@ -56388,7 +56471,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":568 + /* "View.MemoryView":570 * @property * def strides(self): * if self.view.strides == NULL: # <<<<<<<<<<<<<< @@ -56398,20 +56481,20 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0); if (unlikely(__pyx_t_1)) { - /* "View.MemoryView":570 + /* "View.MemoryView":572 * if self.view.strides == NULL: * * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 570, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(2, 570, __pyx_L1_error) + __PYX_ERR(2, 572, __pyx_L1_error) - /* "View.MemoryView":568 + /* "View.MemoryView":570 * @property * def strides(self): * if self.view.strides == NULL: # <<<<<<<<<<<<<< @@ -56420,7 +56503,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st */ } - /* "View.MemoryView":572 + /* "View.MemoryView":574 * raise ValueError("Buffer view does not expose strides") * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<< @@ -56428,25 +56511,25 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 572, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim); for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { __pyx_t_3 = __pyx_t_5; __pyx_v_stride = (__pyx_t_3[0]); - __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 572, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 572, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 574, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 572, __pyx_L1_error) + __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "View.MemoryView":567 + /* "View.MemoryView":569 * * @property * def strides(self): # <<<<<<<<<<<<<< @@ -56466,7 +56549,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st return __pyx_r; } -/* "View.MemoryView":575 +/* "View.MemoryView":577 * * @property * def suboffsets(self): # <<<<<<<<<<<<<< @@ -56502,7 +56585,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":576 + /* "View.MemoryView":578 * @property * def suboffsets(self): * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< @@ -56512,7 +56595,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0); if (__pyx_t_1) { - /* "View.MemoryView":577 + /* "View.MemoryView":579 * def suboffsets(self): * if self.view.suboffsets == NULL: * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< @@ -56520,16 +56603,16 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 577, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__15, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 577, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__15, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "View.MemoryView":576 + /* "View.MemoryView":578 * @property * def suboffsets(self): * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< @@ -56538,7 +56621,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ */ } - /* "View.MemoryView":579 + /* "View.MemoryView":581 * return (-1,) * self.view.ndim * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<< @@ -56546,25 +56629,25 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 579, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { __pyx_t_4 = __pyx_t_6; __pyx_v_suboffset = (__pyx_t_4[0]); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 579, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 581, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error) + __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":575 + /* "View.MemoryView":577 * * @property * def suboffsets(self): # <<<<<<<<<<<<<< @@ -56584,7 +56667,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ return __pyx_r; } -/* "View.MemoryView":582 +/* "View.MemoryView":584 * * @property * def ndim(self): # <<<<<<<<<<<<<< @@ -56614,7 +56697,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":583 + /* "View.MemoryView":585 * @property * def ndim(self): * return self.view.ndim # <<<<<<<<<<<<<< @@ -56622,13 +56705,13 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struc * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 583, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "View.MemoryView":582 + /* "View.MemoryView":584 * * @property * def ndim(self): # <<<<<<<<<<<<<< @@ -56647,7 +56730,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struc return __pyx_r; } -/* "View.MemoryView":586 +/* "View.MemoryView":588 * * @property * def itemsize(self): # <<<<<<<<<<<<<< @@ -56677,7 +56760,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":587 + /* "View.MemoryView":589 * @property * def itemsize(self): * return self.view.itemsize # <<<<<<<<<<<<<< @@ -56685,13 +56768,13 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(s * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 587, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "View.MemoryView":586 + /* "View.MemoryView":588 * * @property * def itemsize(self): # <<<<<<<<<<<<<< @@ -56710,7 +56793,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(s return __pyx_r; } -/* "View.MemoryView":590 +/* "View.MemoryView":592 * * @property * def nbytes(self): # <<<<<<<<<<<<<< @@ -56742,7 +56825,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(str int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":591 + /* "View.MemoryView":593 * @property * def nbytes(self): * return self.size * self.view.itemsize # <<<<<<<<<<<<<< @@ -56750,11 +56833,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(str * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 591, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 591, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 591, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -56762,7 +56845,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(str __pyx_t_3 = 0; goto __pyx_L0; - /* "View.MemoryView":590 + /* "View.MemoryView":592 * * @property * def nbytes(self): # <<<<<<<<<<<<<< @@ -56783,7 +56866,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(str return __pyx_r; } -/* "View.MemoryView":594 +/* "View.MemoryView":596 * * @property * def size(self): # <<<<<<<<<<<<<< @@ -56820,7 +56903,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":595 + /* "View.MemoryView":597 * @property * def size(self): * if self._size is None: # <<<<<<<<<<<<<< @@ -56831,7 +56914,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":596 + /* "View.MemoryView":598 * def size(self): * if self._size is None: * result = 1 # <<<<<<<<<<<<<< @@ -56841,7 +56924,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc __Pyx_INCREF(__pyx_int_1); __pyx_v_result = __pyx_int_1; - /* "View.MemoryView":598 + /* "View.MemoryView":600 * result = 1 * * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<< @@ -56851,25 +56934,25 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { __pyx_t_3 = __pyx_t_5; - __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 598, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); __pyx_t_6 = 0; - /* "View.MemoryView":599 + /* "View.MemoryView":601 * * for length in self.view.shape[:self.view.ndim]: * result *= length # <<<<<<<<<<<<<< * * self._size = result */ - __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 599, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); __pyx_t_6 = 0; } - /* "View.MemoryView":601 + /* "View.MemoryView":603 * result *= length * * self._size = result # <<<<<<<<<<<<<< @@ -56882,7 +56965,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc __Pyx_DECREF(__pyx_v_self->_size); __pyx_v_self->_size = __pyx_v_result; - /* "View.MemoryView":595 + /* "View.MemoryView":597 * @property * def size(self): * if self._size is None: # <<<<<<<<<<<<<< @@ -56891,7 +56974,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc */ } - /* "View.MemoryView":603 + /* "View.MemoryView":605 * self._size = result * * return self._size # <<<<<<<<<<<<<< @@ -56903,7 +56986,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc __pyx_r = __pyx_v_self->_size; goto __pyx_L0; - /* "View.MemoryView":594 + /* "View.MemoryView":596 * * @property * def size(self): # <<<<<<<<<<<<<< @@ -56924,7 +57007,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc return __pyx_r; } -/* "View.MemoryView":605 +/* "View.MemoryView":607 * return self._size * * def __len__(self): # <<<<<<<<<<<<<< @@ -56951,7 +57034,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 int __pyx_t_1; __Pyx_RefNannySetupContext("__len__", 0); - /* "View.MemoryView":606 + /* "View.MemoryView":608 * * def __len__(self): * if self.view.ndim >= 1: # <<<<<<<<<<<<<< @@ -56961,7 +57044,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0); if (__pyx_t_1) { - /* "View.MemoryView":607 + /* "View.MemoryView":609 * def __len__(self): * if self.view.ndim >= 1: * return self.view.shape[0] # <<<<<<<<<<<<<< @@ -56971,7 +57054,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 __pyx_r = (__pyx_v_self->view.shape[0]); goto __pyx_L0; - /* "View.MemoryView":606 + /* "View.MemoryView":608 * * def __len__(self): * if self.view.ndim >= 1: # <<<<<<<<<<<<<< @@ -56980,7 +57063,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 */ } - /* "View.MemoryView":609 + /* "View.MemoryView":611 * return self.view.shape[0] * * return 0 # <<<<<<<<<<<<<< @@ -56990,7 +57073,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 __pyx_r = 0; goto __pyx_L0; - /* "View.MemoryView":605 + /* "View.MemoryView":607 * return self._size * * def __len__(self): # <<<<<<<<<<<<<< @@ -57004,7 +57087,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 return __pyx_r; } -/* "View.MemoryView":611 +/* "View.MemoryView":613 * return 0 * * def __repr__(self): # <<<<<<<<<<<<<< @@ -57036,7 +57119,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); - /* "View.MemoryView":612 + /* "View.MemoryView":614 * * def __repr__(self): * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< @@ -57044,33 +57127,33 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12 * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 612, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":613 + /* "View.MemoryView":615 * def __repr__(self): * return "" % (self.base.__class__.__name__, * id(self)) # <<<<<<<<<<<<<< * * def __str__(self): */ - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 613, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "View.MemoryView":612 + /* "View.MemoryView":614 * * def __repr__(self): * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< * id(self)) * */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 612, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); @@ -57078,14 +57161,14 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 612, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":611 + /* "View.MemoryView":613 * return 0 * * def __repr__(self): # <<<<<<<<<<<<<< @@ -57106,7 +57189,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12 return __pyx_r; } -/* "View.MemoryView":615 +/* "View.MemoryView":617 * id(self)) * * def __str__(self): # <<<<<<<<<<<<<< @@ -57137,7 +57220,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 0); - /* "View.MemoryView":616 + /* "View.MemoryView":618 * * def __str__(self): * return "" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<< @@ -57145,27 +57228,27 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14 * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 616, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 616, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "View.MemoryView":615 + /* "View.MemoryView":617 * id(self)) * * def __str__(self): # <<<<<<<<<<<<<< @@ -57185,7 +57268,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14 return __pyx_r; } -/* "View.MemoryView":619 +/* "View.MemoryView":621 * * * def is_c_contig(self): # <<<<<<<<<<<<<< @@ -57218,17 +57301,17 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_c_contig", 0); - /* "View.MemoryView":622 + /* "View.MemoryView":624 * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< * return slice_is_contig(mslice[0], 'C', self.view.ndim) * */ - __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 622, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 624, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; - /* "View.MemoryView":623 + /* "View.MemoryView":625 * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<< @@ -57236,13 +57319,13 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16 * def is_f_contig(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 623, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":619 + /* "View.MemoryView":621 * * * def is_c_contig(self): # <<<<<<<<<<<<<< @@ -57261,7 +57344,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16 return __pyx_r; } -/* "View.MemoryView":625 +/* "View.MemoryView":627 * return slice_is_contig(mslice[0], 'C', self.view.ndim) * * def is_f_contig(self): # <<<<<<<<<<<<<< @@ -57294,17 +57377,17 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_f_contig", 0); - /* "View.MemoryView":628 + /* "View.MemoryView":630 * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< * return slice_is_contig(mslice[0], 'F', self.view.ndim) * */ - __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 628, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 630, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; - /* "View.MemoryView":629 + /* "View.MemoryView":631 * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<< @@ -57312,13 +57395,13 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18 * def copy(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 629, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":625 + /* "View.MemoryView":627 * return slice_is_contig(mslice[0], 'C', self.view.ndim) * * def is_f_contig(self): # <<<<<<<<<<<<<< @@ -57337,7 +57420,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18 return __pyx_r; } -/* "View.MemoryView":631 +/* "View.MemoryView":633 * return slice_is_contig(mslice[0], 'F', self.view.ndim) * * def copy(self): # <<<<<<<<<<<<<< @@ -57370,7 +57453,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 0); - /* "View.MemoryView":633 + /* "View.MemoryView":635 * def copy(self): * cdef __Pyx_memviewslice mslice * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<< @@ -57379,7 +57462,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 */ __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS)); - /* "View.MemoryView":635 + /* "View.MemoryView":637 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS * * slice_copy(self, &mslice) # <<<<<<<<<<<<<< @@ -57388,17 +57471,17 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 */ __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice)); - /* "View.MemoryView":636 + /* "View.MemoryView":638 * * slice_copy(self, &mslice) * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<< * self.view.itemsize, * flags|PyBUF_C_CONTIGUOUS, */ - __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 636, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 638, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; - /* "View.MemoryView":641 + /* "View.MemoryView":643 * self.dtype_is_object) * * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<< @@ -57406,13 +57489,13 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 * def copy_fortran(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 641, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":631 + /* "View.MemoryView":633 * return slice_is_contig(mslice[0], 'F', self.view.ndim) * * def copy(self): # <<<<<<<<<<<<<< @@ -57431,7 +57514,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 return __pyx_r; } -/* "View.MemoryView":643 +/* "View.MemoryView":645 * return memoryview_copy_from_slice(self, &mslice) * * def copy_fortran(self): # <<<<<<<<<<<<<< @@ -57465,7 +57548,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy_fortran", 0); - /* "View.MemoryView":645 + /* "View.MemoryView":647 * def copy_fortran(self): * cdef __Pyx_memviewslice src, dst * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<< @@ -57474,7 +57557,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22 */ __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS)); - /* "View.MemoryView":647 + /* "View.MemoryView":649 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS * * slice_copy(self, &src) # <<<<<<<<<<<<<< @@ -57483,17 +57566,17 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22 */ __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src)); - /* "View.MemoryView":648 + /* "View.MemoryView":650 * * slice_copy(self, &src) * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<< * self.view.itemsize, * flags|PyBUF_F_CONTIGUOUS, */ - __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 648, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 650, __pyx_L1_error) __pyx_v_dst = __pyx_t_1; - /* "View.MemoryView":653 + /* "View.MemoryView":655 * self.dtype_is_object) * * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<< @@ -57501,13 +57584,13 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22 * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 653, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":643 + /* "View.MemoryView":645 * return memoryview_copy_from_slice(self, &mslice) * * def copy_fortran(self): # <<<<<<<<<<<<<< @@ -57639,7 +57722,7 @@ static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED st return __pyx_r; } -/* "View.MemoryView":657 +/* "View.MemoryView":659 * * @cname('__pyx_memoryview_new') * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< @@ -57659,18 +57742,18 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in int __pyx_clineno = 0; __Pyx_RefNannySetupContext("memoryview_cwrapper", 0); - /* "View.MemoryView":658 + /* "View.MemoryView":660 * @cname('__pyx_memoryview_new') * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< * result.typeinfo = typeinfo * return result */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 658, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 658, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 658, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_o); __Pyx_GIVEREF(__pyx_v_o); @@ -57681,13 +57764,13 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 658, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":659 + /* "View.MemoryView":661 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): * cdef memoryview result = memoryview(o, flags, dtype_is_object) * result.typeinfo = typeinfo # <<<<<<<<<<<<<< @@ -57696,7 +57779,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in */ __pyx_v_result->typeinfo = __pyx_v_typeinfo; - /* "View.MemoryView":660 + /* "View.MemoryView":662 * cdef memoryview result = memoryview(o, flags, dtype_is_object) * result.typeinfo = typeinfo * return result # <<<<<<<<<<<<<< @@ -57708,7 +57791,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; - /* "View.MemoryView":657 + /* "View.MemoryView":659 * * @cname('__pyx_memoryview_new') * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< @@ -57730,7 +57813,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in return __pyx_r; } -/* "View.MemoryView":663 +/* "View.MemoryView":665 * * @cname('__pyx_memoryview_check') * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< @@ -57744,7 +57827,7 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { int __pyx_t_1; __Pyx_RefNannySetupContext("memoryview_check", 0); - /* "View.MemoryView":664 + /* "View.MemoryView":666 * @cname('__pyx_memoryview_check') * cdef inline bint memoryview_check(object o): * return isinstance(o, memoryview) # <<<<<<<<<<<<<< @@ -57755,7 +57838,7 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { __pyx_r = __pyx_t_1; goto __pyx_L0; - /* "View.MemoryView":663 + /* "View.MemoryView":665 * * @cname('__pyx_memoryview_check') * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< @@ -57769,7 +57852,7 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { return __pyx_r; } -/* "View.MemoryView":666 +/* "View.MemoryView":668 * return isinstance(o, memoryview) * * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< @@ -57803,7 +57886,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_unellipsify", 0); - /* "View.MemoryView":671 + /* "View.MemoryView":673 * full slices. * """ * if not isinstance(index, tuple): # <<<<<<<<<<<<<< @@ -57814,14 +57897,14 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":672 + /* "View.MemoryView":674 * """ * if not isinstance(index, tuple): * tup = (index,) # <<<<<<<<<<<<<< * else: * tup = index */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 672, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_index); __Pyx_GIVEREF(__pyx_v_index); @@ -57829,7 +57912,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_v_tup = __pyx_t_3; __pyx_t_3 = 0; - /* "View.MemoryView":671 + /* "View.MemoryView":673 * full slices. * """ * if not isinstance(index, tuple): # <<<<<<<<<<<<<< @@ -57839,7 +57922,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { goto __pyx_L3; } - /* "View.MemoryView":674 + /* "View.MemoryView":676 * tup = (index,) * else: * tup = index # <<<<<<<<<<<<<< @@ -57852,19 +57935,19 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { } __pyx_L3:; - /* "View.MemoryView":676 + /* "View.MemoryView":678 * tup = index * * result = [] # <<<<<<<<<<<<<< * have_slices = False * seen_ellipsis = False */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 676, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 678, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_result = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":677 + /* "View.MemoryView":679 * * result = [] * have_slices = False # <<<<<<<<<<<<<< @@ -57873,7 +57956,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { */ __pyx_v_have_slices = 0; - /* "View.MemoryView":678 + /* "View.MemoryView":680 * result = [] * have_slices = False * seen_ellipsis = False # <<<<<<<<<<<<<< @@ -57882,7 +57965,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { */ __pyx_v_seen_ellipsis = 0; - /* "View.MemoryView":679 + /* "View.MemoryView":681 * have_slices = False * seen_ellipsis = False * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< @@ -57895,26 +57978,26 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 679, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 679, __pyx_L1_error) + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 681, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 679, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 681, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 679, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 681, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -57924,7 +58007,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(2, 679, __pyx_L1_error) + else __PYX_ERR(2, 681, __pyx_L1_error) } break; } @@ -57934,13 +58017,13 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_7 = 0; __Pyx_INCREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3); - __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_7; __pyx_t_7 = 0; - /* "View.MemoryView":680 + /* "View.MemoryView":682 * seen_ellipsis = False * for idx, item in enumerate(tup): * if item is Ellipsis: # <<<<<<<<<<<<<< @@ -57951,7 +58034,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "View.MemoryView":681 + /* "View.MemoryView":683 * for idx, item in enumerate(tup): * if item is Ellipsis: * if not seen_ellipsis: # <<<<<<<<<<<<<< @@ -57961,15 +58044,15 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0); if (__pyx_t_1) { - /* "View.MemoryView":682 + /* "View.MemoryView":684 * if item is Ellipsis: * if not seen_ellipsis: * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< * seen_ellipsis = True * else: */ - __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 682, __pyx_L1_error) - __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 682, __pyx_L1_error) + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 684, __pyx_L1_error) + __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { @@ -57978,10 +58061,10 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__18); } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 682, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 684, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "View.MemoryView":683 + /* "View.MemoryView":685 * if not seen_ellipsis: * result.extend([slice(None)] * (ndim - len(tup) + 1)) * seen_ellipsis = True # <<<<<<<<<<<<<< @@ -57990,7 +58073,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { */ __pyx_v_seen_ellipsis = 1; - /* "View.MemoryView":681 + /* "View.MemoryView":683 * for idx, item in enumerate(tup): * if item is Ellipsis: * if not seen_ellipsis: # <<<<<<<<<<<<<< @@ -58000,7 +58083,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { goto __pyx_L7; } - /* "View.MemoryView":685 + /* "View.MemoryView":687 * seen_ellipsis = True * else: * result.append(slice(None)) # <<<<<<<<<<<<<< @@ -58008,11 +58091,11 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * else: */ /*else*/ { - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__18); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 685, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__18); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 687, __pyx_L1_error) } __pyx_L7:; - /* "View.MemoryView":686 + /* "View.MemoryView":688 * else: * result.append(slice(None)) * have_slices = True # <<<<<<<<<<<<<< @@ -58021,7 +58104,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { */ __pyx_v_have_slices = 1; - /* "View.MemoryView":680 + /* "View.MemoryView":682 * seen_ellipsis = False * for idx, item in enumerate(tup): * if item is Ellipsis: # <<<<<<<<<<<<<< @@ -58031,7 +58114,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { goto __pyx_L6; } - /* "View.MemoryView":688 + /* "View.MemoryView":690 * have_slices = True * else: * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< @@ -58051,23 +58134,23 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_L9_bool_binop_done:; if (unlikely(__pyx_t_1)) { - /* "View.MemoryView":689 + /* "View.MemoryView":691 * else: * if not isinstance(item, slice) and not PyIndex_Check(item): * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<< * * have_slices = have_slices or isinstance(item, slice) */ - __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 689, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 689, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_11, 0, 0, 0); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __PYX_ERR(2, 689, __pyx_L1_error) + __PYX_ERR(2, 691, __pyx_L1_error) - /* "View.MemoryView":688 + /* "View.MemoryView":690 * have_slices = True * else: * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< @@ -58076,7 +58159,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { */ } - /* "View.MemoryView":691 + /* "View.MemoryView":693 * raise TypeError("Cannot index with type '%s'" % type(item)) * * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<< @@ -58095,18 +58178,18 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_L11_bool_binop_done:; __pyx_v_have_slices = __pyx_t_1; - /* "View.MemoryView":692 + /* "View.MemoryView":694 * * have_slices = have_slices or isinstance(item, slice) * result.append(item) # <<<<<<<<<<<<<< * * nslices = ndim - len(result) */ - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 692, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 694, __pyx_L1_error) } __pyx_L6:; - /* "View.MemoryView":679 + /* "View.MemoryView":681 * have_slices = False * seen_ellipsis = False * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< @@ -58117,17 +58200,17 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":694 + /* "View.MemoryView":696 * result.append(item) * * nslices = ndim - len(result) # <<<<<<<<<<<<<< * if nslices: * result.extend([slice(None)] * nslices) */ - __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 694, __pyx_L1_error) + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 696, __pyx_L1_error) __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); - /* "View.MemoryView":695 + /* "View.MemoryView":697 * * nslices = ndim - len(result) * if nslices: # <<<<<<<<<<<<<< @@ -58137,14 +58220,14 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_1 = (__pyx_v_nslices != 0); if (__pyx_t_1) { - /* "View.MemoryView":696 + /* "View.MemoryView":698 * nslices = ndim - len(result) * if nslices: * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< * * return have_slices or nslices, tuple(result) */ - __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 696, __pyx_L1_error) + __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { @@ -58153,10 +58236,10 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__18); } } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 696, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 698, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":695 + /* "View.MemoryView":697 * * nslices = ndim - len(result) * if nslices: # <<<<<<<<<<<<<< @@ -58165,7 +58248,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { */ } - /* "View.MemoryView":698 + /* "View.MemoryView":700 * result.extend([slice(None)] * nslices) * * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<< @@ -58175,20 +58258,20 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __Pyx_XDECREF(__pyx_r); if (!__pyx_v_have_slices) { } else { - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L14_bool_binop_done; } - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; __pyx_L14_bool_binop_done:; - __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error) + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 698, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); @@ -58200,7 +58283,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_11 = 0; goto __pyx_L0; - /* "View.MemoryView":666 + /* "View.MemoryView":668 * return isinstance(o, memoryview) * * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< @@ -58226,7 +58309,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { return __pyx_r; } -/* "View.MemoryView":700 +/* "View.MemoryView":702 * return have_slices or nslices, tuple(result) * * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< @@ -58248,7 +58331,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("assert_direct_dimensions", 0); - /* "View.MemoryView":701 + /* "View.MemoryView":703 * * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<< @@ -58260,7 +58343,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ __pyx_t_1 = __pyx_t_3; __pyx_v_suboffset = (__pyx_t_1[0]); - /* "View.MemoryView":702 + /* "View.MemoryView":704 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: # <<<<<<<<<<<<<< @@ -58270,20 +58353,20 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0); if (unlikely(__pyx_t_4)) { - /* "View.MemoryView":703 + /* "View.MemoryView":705 * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 703, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(2, 703, __pyx_L1_error) + __PYX_ERR(2, 705, __pyx_L1_error) - /* "View.MemoryView":702 + /* "View.MemoryView":704 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: # <<<<<<<<<<<<<< @@ -58293,7 +58376,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ } } - /* "View.MemoryView":700 + /* "View.MemoryView":702 * return have_slices or nslices, tuple(result) * * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< @@ -58314,7 +58397,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ return __pyx_r; } -/* "View.MemoryView":710 +/* "View.MemoryView":712 * * @cname('__pyx_memview_slice') * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< @@ -58358,7 +58441,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("memview_slice", 0); - /* "View.MemoryView":711 + /* "View.MemoryView":713 * @cname('__pyx_memview_slice') * cdef memoryview memview_slice(memoryview memview, object indices): * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<< @@ -58368,7 +58451,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_v_new_ndim = 0; __pyx_v_suboffset_dim = -1; - /* "View.MemoryView":718 + /* "View.MemoryView":720 * * * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<< @@ -58377,7 +58460,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)))); - /* "View.MemoryView":722 + /* "View.MemoryView":724 * cdef _memoryviewslice memviewsliceobj * * assert memview.view.ndim > 0 # <<<<<<<<<<<<<< @@ -58388,12 +58471,12 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(2, 722, __pyx_L1_error) + __PYX_ERR(2, 724, __pyx_L1_error) } } #endif - /* "View.MemoryView":724 + /* "View.MemoryView":726 * assert memview.view.ndim > 0 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< @@ -58404,20 +58487,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":725 + /* "View.MemoryView":727 * * if isinstance(memview, _memoryviewslice): * memviewsliceobj = memview # <<<<<<<<<<<<<< * p_src = &memviewsliceobj.from_slice * else: */ - if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 725, __pyx_L1_error) + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 727, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":726 + /* "View.MemoryView":728 * if isinstance(memview, _memoryviewslice): * memviewsliceobj = memview * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<< @@ -58426,7 +58509,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice); - /* "View.MemoryView":724 + /* "View.MemoryView":726 * assert memview.view.ndim > 0 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< @@ -58436,7 +58519,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ goto __pyx_L3; } - /* "View.MemoryView":728 + /* "View.MemoryView":730 * p_src = &memviewsliceobj.from_slice * else: * slice_copy(memview, &src) # <<<<<<<<<<<<<< @@ -58446,7 +58529,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ /*else*/ { __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src)); - /* "View.MemoryView":729 + /* "View.MemoryView":731 * else: * slice_copy(memview, &src) * p_src = &src # <<<<<<<<<<<<<< @@ -58457,7 +58540,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ } __pyx_L3:; - /* "View.MemoryView":735 + /* "View.MemoryView":737 * * * dst.memview = p_src.memview # <<<<<<<<<<<<<< @@ -58467,7 +58550,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_t_4 = __pyx_v_p_src->memview; __pyx_v_dst.memview = __pyx_t_4; - /* "View.MemoryView":736 + /* "View.MemoryView":738 * * dst.memview = p_src.memview * dst.data = p_src.data # <<<<<<<<<<<<<< @@ -58477,7 +58560,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_t_5 = __pyx_v_p_src->data; __pyx_v_dst.data = __pyx_t_5; - /* "View.MemoryView":741 + /* "View.MemoryView":743 * * * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<< @@ -58486,7 +58569,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ __pyx_v_p_dst = (&__pyx_v_dst); - /* "View.MemoryView":742 + /* "View.MemoryView":744 * * cdef __Pyx_memviewslice *p_dst = &dst * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<< @@ -58495,7 +58578,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim); - /* "View.MemoryView":746 + /* "View.MemoryView":748 * cdef bint have_start, have_stop, have_step * * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< @@ -58507,26 +58590,26 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 748, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 748, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 748, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } @@ -58536,7 +58619,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(2, 746, __pyx_L1_error) + else __PYX_ERR(2, 748, __pyx_L1_error) } break; } @@ -58547,7 +58630,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_v_dim = __pyx_t_6; __pyx_t_6 = (__pyx_t_6 + 1); - /* "View.MemoryView":747 + /* "View.MemoryView":749 * * for dim, index in enumerate(indices): * if PyIndex_Check(index): # <<<<<<<<<<<<<< @@ -58557,25 +58640,25 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0); if (__pyx_t_2) { - /* "View.MemoryView":751 + /* "View.MemoryView":753 * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<< * 0, 0, 0, # have_{start,stop,step} * False) */ - __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 751, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 753, __pyx_L1_error) - /* "View.MemoryView":748 + /* "View.MemoryView":750 * for dim, index in enumerate(indices): * if PyIndex_Check(index): * slice_memviewslice( # <<<<<<<<<<<<<< * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 748, __pyx_L1_error) + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 750, __pyx_L1_error) - /* "View.MemoryView":747 + /* "View.MemoryView":749 * * for dim, index in enumerate(indices): * if PyIndex_Check(index): # <<<<<<<<<<<<<< @@ -58585,7 +58668,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ goto __pyx_L6; } - /* "View.MemoryView":754 + /* "View.MemoryView":756 * 0, 0, 0, # have_{start,stop,step} * False) * elif index is None: # <<<<<<<<<<<<<< @@ -58596,7 +58679,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "View.MemoryView":755 + /* "View.MemoryView":757 * False) * elif index is None: * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<< @@ -58605,7 +58688,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1; - /* "View.MemoryView":756 + /* "View.MemoryView":758 * elif index is None: * p_dst.shape[new_ndim] = 1 * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<< @@ -58614,7 +58697,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0; - /* "View.MemoryView":757 + /* "View.MemoryView":759 * p_dst.shape[new_ndim] = 1 * p_dst.strides[new_ndim] = 0 * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<< @@ -58623,7 +58706,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L; - /* "View.MemoryView":758 + /* "View.MemoryView":760 * p_dst.strides[new_ndim] = 0 * p_dst.suboffsets[new_ndim] = -1 * new_ndim += 1 # <<<<<<<<<<<<<< @@ -58632,7 +58715,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); - /* "View.MemoryView":754 + /* "View.MemoryView":756 * 0, 0, 0, # have_{start,stop,step} * False) * elif index is None: # <<<<<<<<<<<<<< @@ -58642,7 +58725,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ goto __pyx_L6; } - /* "View.MemoryView":760 + /* "View.MemoryView":762 * new_ndim += 1 * else: * start = index.start or 0 # <<<<<<<<<<<<<< @@ -58650,13 +58733,13 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * step = index.step or 0 */ /*else*/ { - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 760, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 762, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 760, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 762, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 760, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 762, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_bool_binop_done; @@ -58665,20 +58748,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_L7_bool_binop_done:; __pyx_v_start = __pyx_t_10; - /* "View.MemoryView":761 + /* "View.MemoryView":763 * else: * start = index.start or 0 * stop = index.stop or 0 # <<<<<<<<<<<<<< * step = index.step or 0 * */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 761, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 761, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 763, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 761, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 763, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_bool_binop_done; @@ -58687,20 +58770,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_L9_bool_binop_done:; __pyx_v_stop = __pyx_t_10; - /* "View.MemoryView":762 + /* "View.MemoryView":764 * start = index.start or 0 * stop = index.stop or 0 * step = index.step or 0 # <<<<<<<<<<<<<< * * have_start = index.start is not None */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 762, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 762, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 764, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 762, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 764, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L11_bool_binop_done; @@ -58709,55 +58792,55 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_L11_bool_binop_done:; __pyx_v_step = __pyx_t_10; - /* "View.MemoryView":764 + /* "View.MemoryView":766 * step = index.step or 0 * * have_start = index.start is not None # <<<<<<<<<<<<<< * have_stop = index.stop is not None * have_step = index.step is not None */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 764, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_have_start = __pyx_t_1; - /* "View.MemoryView":765 + /* "View.MemoryView":767 * * have_start = index.start is not None * have_stop = index.stop is not None # <<<<<<<<<<<<<< * have_step = index.step is not None * */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 765, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_have_stop = __pyx_t_1; - /* "View.MemoryView":766 + /* "View.MemoryView":768 * have_start = index.start is not None * have_stop = index.stop is not None * have_step = index.step is not None # <<<<<<<<<<<<<< * * slice_memviewslice( */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 766, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_have_step = __pyx_t_1; - /* "View.MemoryView":768 + /* "View.MemoryView":770 * have_step = index.step is not None * * slice_memviewslice( # <<<<<<<<<<<<<< * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ - __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 768, __pyx_L1_error) + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 770, __pyx_L1_error) - /* "View.MemoryView":774 + /* "View.MemoryView":776 * have_start, have_stop, have_step, * True) * new_ndim += 1 # <<<<<<<<<<<<<< @@ -58768,7 +58851,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ } __pyx_L6:; - /* "View.MemoryView":746 + /* "View.MemoryView":748 * cdef bint have_start, have_stop, have_step * * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< @@ -58778,7 +58861,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":776 + /* "View.MemoryView":778 * new_ndim += 1 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< @@ -58789,7 +58872,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":777 + /* "View.MemoryView":779 * * if isinstance(memview, _memoryviewslice): * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< @@ -58798,39 +58881,39 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ __Pyx_XDECREF(((PyObject *)__pyx_r)); - /* "View.MemoryView":778 + /* "View.MemoryView":780 * if isinstance(memview, _memoryviewslice): * return memoryview_fromslice(dst, new_ndim, * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<< * memviewsliceobj.to_dtype_func, * memview.dtype_is_object) */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 778, __pyx_L1_error) } + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 780, __pyx_L1_error) } - /* "View.MemoryView":779 + /* "View.MemoryView":781 * return memoryview_fromslice(dst, new_ndim, * memviewsliceobj.to_object_func, * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<< * memview.dtype_is_object) * else: */ - if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 779, __pyx_L1_error) } + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 781, __pyx_L1_error) } - /* "View.MemoryView":777 + /* "View.MemoryView":779 * * if isinstance(memview, _memoryviewslice): * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< * memviewsliceobj.to_object_func, * memviewsliceobj.to_dtype_func, */ - __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 777, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 777, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 779, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "View.MemoryView":776 + /* "View.MemoryView":778 * new_ndim += 1 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< @@ -58839,7 +58922,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ } - /* "View.MemoryView":782 + /* "View.MemoryView":784 * memview.dtype_is_object) * else: * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< @@ -58849,30 +58932,30 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ /*else*/ { __Pyx_XDECREF(((PyObject *)__pyx_r)); - /* "View.MemoryView":783 + /* "View.MemoryView":785 * else: * return memoryview_fromslice(dst, new_ndim, NULL, NULL, * memview.dtype_is_object) # <<<<<<<<<<<<<< * * */ - __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 782, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "View.MemoryView":782 + /* "View.MemoryView":784 * memview.dtype_is_object) * else: * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< * memview.dtype_is_object) * */ - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 782, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 784, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; } - /* "View.MemoryView":710 + /* "View.MemoryView":712 * * @cname('__pyx_memview_slice') * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< @@ -58894,7 +58977,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ return __pyx_r; } -/* "View.MemoryView":807 +/* "View.MemoryView":809 * * @cname('__pyx_memoryview_slice_memviewslice') * cdef int slice_memviewslice( # <<<<<<<<<<<<<< @@ -58913,7 +58996,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, const char *__pyx_filename = NULL; int __pyx_clineno = 0; - /* "View.MemoryView":827 + /* "View.MemoryView":829 * cdef bint negative_step * * if not is_slice: # <<<<<<<<<<<<<< @@ -58923,7 +59006,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0); if (__pyx_t_1) { - /* "View.MemoryView":829 + /* "View.MemoryView":831 * if not is_slice: * * if start < 0: # <<<<<<<<<<<<<< @@ -58933,7 +59016,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_1 = ((__pyx_v_start < 0) != 0); if (__pyx_t_1) { - /* "View.MemoryView":830 + /* "View.MemoryView":832 * * if start < 0: * start += shape # <<<<<<<<<<<<<< @@ -58942,7 +59025,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_start = (__pyx_v_start + __pyx_v_shape); - /* "View.MemoryView":829 + /* "View.MemoryView":831 * if not is_slice: * * if start < 0: # <<<<<<<<<<<<<< @@ -58951,7 +59034,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":831 + /* "View.MemoryView":833 * if start < 0: * start += shape * if not 0 <= start < shape: # <<<<<<<<<<<<<< @@ -58965,16 +59048,16 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":832 + /* "View.MemoryView":834 * start += shape * if not 0 <= start < shape: * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<< * else: * */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 832, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 834, __pyx_L1_error) - /* "View.MemoryView":831 + /* "View.MemoryView":833 * if start < 0: * start += shape * if not 0 <= start < shape: # <<<<<<<<<<<<<< @@ -58983,7 +59066,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":827 + /* "View.MemoryView":829 * cdef bint negative_step * * if not is_slice: # <<<<<<<<<<<<<< @@ -58993,7 +59076,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L3; } - /* "View.MemoryView":835 + /* "View.MemoryView":837 * else: * * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<< @@ -59012,7 +59095,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_L6_bool_binop_done:; __pyx_v_negative_step = __pyx_t_2; - /* "View.MemoryView":837 + /* "View.MemoryView":839 * negative_step = have_step != 0 and step < 0 * * if have_step and step == 0: # <<<<<<<<<<<<<< @@ -59030,16 +59113,16 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_L9_bool_binop_done:; if (__pyx_t_2) { - /* "View.MemoryView":838 + /* "View.MemoryView":840 * * if have_step and step == 0: * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<< * * */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 838, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 840, __pyx_L1_error) - /* "View.MemoryView":837 + /* "View.MemoryView":839 * negative_step = have_step != 0 and step < 0 * * if have_step and step == 0: # <<<<<<<<<<<<<< @@ -59048,7 +59131,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":841 + /* "View.MemoryView":843 * * * if have_start: # <<<<<<<<<<<<<< @@ -59058,7 +59141,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = (__pyx_v_have_start != 0); if (__pyx_t_2) { - /* "View.MemoryView":842 + /* "View.MemoryView":844 * * if have_start: * if start < 0: # <<<<<<<<<<<<<< @@ -59068,7 +59151,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_start < 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":843 + /* "View.MemoryView":845 * if have_start: * if start < 0: * start += shape # <<<<<<<<<<<<<< @@ -59077,7 +59160,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_start = (__pyx_v_start + __pyx_v_shape); - /* "View.MemoryView":844 + /* "View.MemoryView":846 * if start < 0: * start += shape * if start < 0: # <<<<<<<<<<<<<< @@ -59087,7 +59170,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_start < 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":845 + /* "View.MemoryView":847 * start += shape * if start < 0: * start = 0 # <<<<<<<<<<<<<< @@ -59096,7 +59179,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_start = 0; - /* "View.MemoryView":844 + /* "View.MemoryView":846 * if start < 0: * start += shape * if start < 0: # <<<<<<<<<<<<<< @@ -59105,7 +59188,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":842 + /* "View.MemoryView":844 * * if have_start: * if start < 0: # <<<<<<<<<<<<<< @@ -59115,7 +59198,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L12; } - /* "View.MemoryView":846 + /* "View.MemoryView":848 * if start < 0: * start = 0 * elif start >= shape: # <<<<<<<<<<<<<< @@ -59125,7 +59208,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0); if (__pyx_t_2) { - /* "View.MemoryView":847 + /* "View.MemoryView":849 * start = 0 * elif start >= shape: * if negative_step: # <<<<<<<<<<<<<< @@ -59135,7 +59218,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = (__pyx_v_negative_step != 0); if (__pyx_t_2) { - /* "View.MemoryView":848 + /* "View.MemoryView":850 * elif start >= shape: * if negative_step: * start = shape - 1 # <<<<<<<<<<<<<< @@ -59144,7 +59227,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_start = (__pyx_v_shape - 1); - /* "View.MemoryView":847 + /* "View.MemoryView":849 * start = 0 * elif start >= shape: * if negative_step: # <<<<<<<<<<<<<< @@ -59154,7 +59237,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L14; } - /* "View.MemoryView":850 + /* "View.MemoryView":852 * start = shape - 1 * else: * start = shape # <<<<<<<<<<<<<< @@ -59166,7 +59249,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } __pyx_L14:; - /* "View.MemoryView":846 + /* "View.MemoryView":848 * if start < 0: * start = 0 * elif start >= shape: # <<<<<<<<<<<<<< @@ -59176,7 +59259,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } __pyx_L12:; - /* "View.MemoryView":841 + /* "View.MemoryView":843 * * * if have_start: # <<<<<<<<<<<<<< @@ -59186,7 +59269,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L11; } - /* "View.MemoryView":852 + /* "View.MemoryView":854 * start = shape * else: * if negative_step: # <<<<<<<<<<<<<< @@ -59197,7 +59280,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = (__pyx_v_negative_step != 0); if (__pyx_t_2) { - /* "View.MemoryView":853 + /* "View.MemoryView":855 * else: * if negative_step: * start = shape - 1 # <<<<<<<<<<<<<< @@ -59206,7 +59289,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_start = (__pyx_v_shape - 1); - /* "View.MemoryView":852 + /* "View.MemoryView":854 * start = shape * else: * if negative_step: # <<<<<<<<<<<<<< @@ -59216,7 +59299,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L15; } - /* "View.MemoryView":855 + /* "View.MemoryView":857 * start = shape - 1 * else: * start = 0 # <<<<<<<<<<<<<< @@ -59230,7 +59313,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } __pyx_L11:; - /* "View.MemoryView":857 + /* "View.MemoryView":859 * start = 0 * * if have_stop: # <<<<<<<<<<<<<< @@ -59240,7 +59323,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = (__pyx_v_have_stop != 0); if (__pyx_t_2) { - /* "View.MemoryView":858 + /* "View.MemoryView":860 * * if have_stop: * if stop < 0: # <<<<<<<<<<<<<< @@ -59250,7 +59333,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_stop < 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":859 + /* "View.MemoryView":861 * if have_stop: * if stop < 0: * stop += shape # <<<<<<<<<<<<<< @@ -59259,7 +59342,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape); - /* "View.MemoryView":860 + /* "View.MemoryView":862 * if stop < 0: * stop += shape * if stop < 0: # <<<<<<<<<<<<<< @@ -59269,7 +59352,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_stop < 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":861 + /* "View.MemoryView":863 * stop += shape * if stop < 0: * stop = 0 # <<<<<<<<<<<<<< @@ -59278,7 +59361,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_stop = 0; - /* "View.MemoryView":860 + /* "View.MemoryView":862 * if stop < 0: * stop += shape * if stop < 0: # <<<<<<<<<<<<<< @@ -59287,7 +59370,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":858 + /* "View.MemoryView":860 * * if have_stop: * if stop < 0: # <<<<<<<<<<<<<< @@ -59297,7 +59380,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L17; } - /* "View.MemoryView":862 + /* "View.MemoryView":864 * if stop < 0: * stop = 0 * elif stop > shape: # <<<<<<<<<<<<<< @@ -59307,7 +59390,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0); if (__pyx_t_2) { - /* "View.MemoryView":863 + /* "View.MemoryView":865 * stop = 0 * elif stop > shape: * stop = shape # <<<<<<<<<<<<<< @@ -59316,7 +59399,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_stop = __pyx_v_shape; - /* "View.MemoryView":862 + /* "View.MemoryView":864 * if stop < 0: * stop = 0 * elif stop > shape: # <<<<<<<<<<<<<< @@ -59326,7 +59409,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } __pyx_L17:; - /* "View.MemoryView":857 + /* "View.MemoryView":859 * start = 0 * * if have_stop: # <<<<<<<<<<<<<< @@ -59336,7 +59419,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L16; } - /* "View.MemoryView":865 + /* "View.MemoryView":867 * stop = shape * else: * if negative_step: # <<<<<<<<<<<<<< @@ -59347,7 +59430,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = (__pyx_v_negative_step != 0); if (__pyx_t_2) { - /* "View.MemoryView":866 + /* "View.MemoryView":868 * else: * if negative_step: * stop = -1 # <<<<<<<<<<<<<< @@ -59356,7 +59439,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_stop = -1L; - /* "View.MemoryView":865 + /* "View.MemoryView":867 * stop = shape * else: * if negative_step: # <<<<<<<<<<<<<< @@ -59366,7 +59449,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L19; } - /* "View.MemoryView":868 + /* "View.MemoryView":870 * stop = -1 * else: * stop = shape # <<<<<<<<<<<<<< @@ -59380,7 +59463,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } __pyx_L16:; - /* "View.MemoryView":870 + /* "View.MemoryView":872 * stop = shape * * if not have_step: # <<<<<<<<<<<<<< @@ -59390,7 +59473,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":871 + /* "View.MemoryView":873 * * if not have_step: * step = 1 # <<<<<<<<<<<<<< @@ -59399,7 +59482,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_step = 1; - /* "View.MemoryView":870 + /* "View.MemoryView":872 * stop = shape * * if not have_step: # <<<<<<<<<<<<<< @@ -59408,7 +59491,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":875 + /* "View.MemoryView":877 * * with cython.cdivision(True): * new_shape = (stop - start) // step # <<<<<<<<<<<<<< @@ -59417,7 +59500,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step); - /* "View.MemoryView":877 + /* "View.MemoryView":879 * new_shape = (stop - start) // step * * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< @@ -59427,7 +59510,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":878 + /* "View.MemoryView":880 * * if (stop - start) - step * new_shape: * new_shape += 1 # <<<<<<<<<<<<<< @@ -59436,7 +59519,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_new_shape = (__pyx_v_new_shape + 1); - /* "View.MemoryView":877 + /* "View.MemoryView":879 * new_shape = (stop - start) // step * * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< @@ -59445,7 +59528,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":880 + /* "View.MemoryView":882 * new_shape += 1 * * if new_shape < 0: # <<<<<<<<<<<<<< @@ -59455,7 +59538,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":881 + /* "View.MemoryView":883 * * if new_shape < 0: * new_shape = 0 # <<<<<<<<<<<<<< @@ -59464,7 +59547,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_new_shape = 0; - /* "View.MemoryView":880 + /* "View.MemoryView":882 * new_shape += 1 * * if new_shape < 0: # <<<<<<<<<<<<<< @@ -59473,7 +59556,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":884 + /* "View.MemoryView":886 * * * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<< @@ -59482,7 +59565,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step); - /* "View.MemoryView":885 + /* "View.MemoryView":887 * * dst.strides[new_ndim] = stride * step * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<< @@ -59491,7 +59574,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape; - /* "View.MemoryView":886 + /* "View.MemoryView":888 * dst.strides[new_ndim] = stride * step * dst.shape[new_ndim] = new_shape * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<< @@ -59502,7 +59585,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } __pyx_L3:; - /* "View.MemoryView":889 + /* "View.MemoryView":891 * * * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< @@ -59512,7 +59595,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":890 + /* "View.MemoryView":892 * * if suboffset_dim[0] < 0: * dst.data += start * stride # <<<<<<<<<<<<<< @@ -59521,7 +59604,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride)); - /* "View.MemoryView":889 + /* "View.MemoryView":891 * * * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< @@ -59531,7 +59614,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L23; } - /* "View.MemoryView":892 + /* "View.MemoryView":894 * dst.data += start * stride * else: * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<< @@ -59544,7 +59627,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } __pyx_L23:; - /* "View.MemoryView":894 + /* "View.MemoryView":896 * dst.suboffsets[suboffset_dim[0]] += start * stride * * if suboffset >= 0: # <<<<<<<<<<<<<< @@ -59554,7 +59637,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":895 + /* "View.MemoryView":897 * * if suboffset >= 0: * if not is_slice: # <<<<<<<<<<<<<< @@ -59564,7 +59647,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":896 + /* "View.MemoryView":898 * if suboffset >= 0: * if not is_slice: * if new_ndim == 0: # <<<<<<<<<<<<<< @@ -59574,7 +59657,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":897 + /* "View.MemoryView":899 * if not is_slice: * if new_ndim == 0: * dst.data = ( dst.data)[0] + suboffset # <<<<<<<<<<<<<< @@ -59583,7 +59666,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset); - /* "View.MemoryView":896 + /* "View.MemoryView":898 * if suboffset >= 0: * if not is_slice: * if new_ndim == 0: # <<<<<<<<<<<<<< @@ -59593,7 +59676,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L26; } - /* "View.MemoryView":899 + /* "View.MemoryView":901 * dst.data = ( dst.data)[0] + suboffset * else: * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<< @@ -59602,18 +59685,18 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ /*else*/ { - /* "View.MemoryView":900 + /* "View.MemoryView":902 * else: * _err_dim(IndexError, "All dimensions preceding dimension %d " * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<< * else: * suboffset_dim[0] = new_ndim */ - __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 899, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 901, __pyx_L1_error) } __pyx_L26:; - /* "View.MemoryView":895 + /* "View.MemoryView":897 * * if suboffset >= 0: * if not is_slice: # <<<<<<<<<<<<<< @@ -59623,7 +59706,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, goto __pyx_L25; } - /* "View.MemoryView":902 + /* "View.MemoryView":904 * "must be indexed and not sliced", dim) * else: * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<< @@ -59635,7 +59718,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } __pyx_L25:; - /* "View.MemoryView":894 + /* "View.MemoryView":896 * dst.suboffsets[suboffset_dim[0]] += start * stride * * if suboffset >= 0: # <<<<<<<<<<<<<< @@ -59644,7 +59727,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, */ } - /* "View.MemoryView":904 + /* "View.MemoryView":906 * suboffset_dim[0] = new_ndim * * return 0 # <<<<<<<<<<<<<< @@ -59654,7 +59737,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_r = 0; goto __pyx_L0; - /* "View.MemoryView":807 + /* "View.MemoryView":809 * * @cname('__pyx_memoryview_slice_memviewslice') * cdef int slice_memviewslice( # <<<<<<<<<<<<<< @@ -59678,7 +59761,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, return __pyx_r; } -/* "View.MemoryView":910 +/* "View.MemoryView":912 * * @cname('__pyx_pybuffer_index') * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< @@ -59703,7 +59786,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pybuffer_index", 0); - /* "View.MemoryView":912 + /* "View.MemoryView":914 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, * Py_ssize_t dim) except NULL: * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<< @@ -59712,7 +59795,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ __pyx_v_suboffset = -1L; - /* "View.MemoryView":913 + /* "View.MemoryView":915 * Py_ssize_t dim) except NULL: * cdef Py_ssize_t shape, stride, suboffset = -1 * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<< @@ -59722,7 +59805,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P __pyx_t_1 = __pyx_v_view->itemsize; __pyx_v_itemsize = __pyx_t_1; - /* "View.MemoryView":916 + /* "View.MemoryView":918 * cdef char *resultp * * if view.ndim == 0: # <<<<<<<<<<<<<< @@ -59732,7 +59815,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":917 + /* "View.MemoryView":919 * * if view.ndim == 0: * shape = view.len / itemsize # <<<<<<<<<<<<<< @@ -59741,15 +59824,15 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(2, 917, __pyx_L1_error) + __PYX_ERR(2, 919, __pyx_L1_error) } else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) { PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); - __PYX_ERR(2, 917, __pyx_L1_error) + __PYX_ERR(2, 919, __pyx_L1_error) } __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); - /* "View.MemoryView":918 + /* "View.MemoryView":920 * if view.ndim == 0: * shape = view.len / itemsize * stride = itemsize # <<<<<<<<<<<<<< @@ -59758,7 +59841,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ __pyx_v_stride = __pyx_v_itemsize; - /* "View.MemoryView":916 + /* "View.MemoryView":918 * cdef char *resultp * * if view.ndim == 0: # <<<<<<<<<<<<<< @@ -59768,7 +59851,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P goto __pyx_L3; } - /* "View.MemoryView":920 + /* "View.MemoryView":922 * stride = itemsize * else: * shape = view.shape[dim] # <<<<<<<<<<<<<< @@ -59778,7 +59861,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P /*else*/ { __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]); - /* "View.MemoryView":921 + /* "View.MemoryView":923 * else: * shape = view.shape[dim] * stride = view.strides[dim] # <<<<<<<<<<<<<< @@ -59787,7 +59870,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]); - /* "View.MemoryView":922 + /* "View.MemoryView":924 * shape = view.shape[dim] * stride = view.strides[dim] * if view.suboffsets != NULL: # <<<<<<<<<<<<<< @@ -59797,7 +59880,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0); if (__pyx_t_2) { - /* "View.MemoryView":923 + /* "View.MemoryView":925 * stride = view.strides[dim] * if view.suboffsets != NULL: * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<< @@ -59806,7 +59889,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]); - /* "View.MemoryView":922 + /* "View.MemoryView":924 * shape = view.shape[dim] * stride = view.strides[dim] * if view.suboffsets != NULL: # <<<<<<<<<<<<<< @@ -59817,7 +59900,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P } __pyx_L3:; - /* "View.MemoryView":925 + /* "View.MemoryView":927 * suboffset = view.suboffsets[dim] * * if index < 0: # <<<<<<<<<<<<<< @@ -59827,7 +59910,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P __pyx_t_2 = ((__pyx_v_index < 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":926 + /* "View.MemoryView":928 * * if index < 0: * index += view.shape[dim] # <<<<<<<<<<<<<< @@ -59836,7 +59919,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim])); - /* "View.MemoryView":927 + /* "View.MemoryView":929 * if index < 0: * index += view.shape[dim] * if index < 0: # <<<<<<<<<<<<<< @@ -59846,26 +59929,26 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P __pyx_t_2 = ((__pyx_v_index < 0) != 0); if (unlikely(__pyx_t_2)) { - /* "View.MemoryView":928 + /* "View.MemoryView":930 * index += view.shape[dim] * if index < 0: * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< * * if index >= shape: */ - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 928, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 928, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 928, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 928, __pyx_L1_error) + __PYX_ERR(2, 930, __pyx_L1_error) - /* "View.MemoryView":927 + /* "View.MemoryView":929 * if index < 0: * index += view.shape[dim] * if index < 0: # <<<<<<<<<<<<<< @@ -59874,7 +59957,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ } - /* "View.MemoryView":925 + /* "View.MemoryView":927 * suboffset = view.suboffsets[dim] * * if index < 0: # <<<<<<<<<<<<<< @@ -59883,7 +59966,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ } - /* "View.MemoryView":930 + /* "View.MemoryView":932 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) * * if index >= shape: # <<<<<<<<<<<<<< @@ -59893,26 +59976,26 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0); if (unlikely(__pyx_t_2)) { - /* "View.MemoryView":931 + /* "View.MemoryView":933 * * if index >= shape: * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< * * resultp = bufp + index * stride */ - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 931, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 933, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 931, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 933, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 931, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 933, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 931, __pyx_L1_error) + __PYX_ERR(2, 933, __pyx_L1_error) - /* "View.MemoryView":930 + /* "View.MemoryView":932 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) * * if index >= shape: # <<<<<<<<<<<<<< @@ -59921,7 +60004,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ } - /* "View.MemoryView":933 + /* "View.MemoryView":935 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) * * resultp = bufp + index * stride # <<<<<<<<<<<<<< @@ -59930,7 +60013,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride)); - /* "View.MemoryView":934 + /* "View.MemoryView":936 * * resultp = bufp + index * stride * if suboffset >= 0: # <<<<<<<<<<<<<< @@ -59940,7 +60023,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":935 + /* "View.MemoryView":937 * resultp = bufp + index * stride * if suboffset >= 0: * resultp = ( resultp)[0] + suboffset # <<<<<<<<<<<<<< @@ -59949,7 +60032,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset); - /* "View.MemoryView":934 + /* "View.MemoryView":936 * * resultp = bufp + index * stride * if suboffset >= 0: # <<<<<<<<<<<<<< @@ -59958,7 +60041,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P */ } - /* "View.MemoryView":937 + /* "View.MemoryView":939 * resultp = ( resultp)[0] + suboffset * * return resultp # <<<<<<<<<<<<<< @@ -59968,7 +60051,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P __pyx_r = __pyx_v_resultp; goto __pyx_L0; - /* "View.MemoryView":910 + /* "View.MemoryView":912 * * @cname('__pyx_pybuffer_index') * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< @@ -59987,7 +60070,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P return __pyx_r; } -/* "View.MemoryView":943 +/* "View.MemoryView":945 * * @cname('__pyx_memslice_transpose') * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< @@ -60015,7 +60098,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { const char *__pyx_filename = NULL; int __pyx_clineno = 0; - /* "View.MemoryView":944 + /* "View.MemoryView":946 * @cname('__pyx_memslice_transpose') * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<< @@ -60025,7 +60108,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { __pyx_t_1 = __pyx_v_memslice->memview->view.ndim; __pyx_v_ndim = __pyx_t_1; - /* "View.MemoryView":946 + /* "View.MemoryView":948 * cdef int ndim = memslice.memview.view.ndim * * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<< @@ -60035,7 +60118,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { __pyx_t_2 = __pyx_v_memslice->shape; __pyx_v_shape = __pyx_t_2; - /* "View.MemoryView":947 + /* "View.MemoryView":949 * * cdef Py_ssize_t *shape = memslice.shape * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<< @@ -60045,7 +60128,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { __pyx_t_2 = __pyx_v_memslice->strides; __pyx_v_strides = __pyx_t_2; - /* "View.MemoryView":951 + /* "View.MemoryView":953 * * cdef int i, j * for i in range(ndim / 2): # <<<<<<<<<<<<<< @@ -60057,7 +60140,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; - /* "View.MemoryView":952 + /* "View.MemoryView":954 * cdef int i, j * for i in range(ndim / 2): * j = ndim - 1 - i # <<<<<<<<<<<<<< @@ -60066,7 +60149,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { */ __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i); - /* "View.MemoryView":953 + /* "View.MemoryView":955 * for i in range(ndim / 2): * j = ndim - 1 - i * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<< @@ -60078,7 +60161,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5; (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6; - /* "View.MemoryView":954 + /* "View.MemoryView":956 * j = ndim - 1 - i * strides[i], strides[j] = strides[j], strides[i] * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<< @@ -60090,7 +60173,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6; (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5; - /* "View.MemoryView":956 + /* "View.MemoryView":958 * shape[i], shape[j] = shape[j], shape[i] * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< @@ -60108,16 +60191,16 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { __pyx_L6_bool_binop_done:; if (__pyx_t_7) { - /* "View.MemoryView":957 + /* "View.MemoryView":959 * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<< * * return 1 */ - __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 957, __pyx_L1_error) + __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 959, __pyx_L1_error) - /* "View.MemoryView":956 + /* "View.MemoryView":958 * shape[i], shape[j] = shape[j], shape[i] * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< @@ -60127,7 +60210,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { } } - /* "View.MemoryView":959 + /* "View.MemoryView":961 * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") * * return 1 # <<<<<<<<<<<<<< @@ -60137,7 +60220,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { __pyx_r = 1; goto __pyx_L0; - /* "View.MemoryView":943 + /* "View.MemoryView":945 * * @cname('__pyx_memslice_transpose') * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< @@ -60161,7 +60244,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { return __pyx_r; } -/* "View.MemoryView":976 +/* "View.MemoryView":978 * cdef int (*to_dtype_func)(char *, object) except 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -60184,7 +60267,7 @@ static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewsl __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "View.MemoryView":977 + /* "View.MemoryView":979 * * def __dealloc__(self): * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<< @@ -60193,7 +60276,7 @@ static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewsl */ __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1); - /* "View.MemoryView":976 + /* "View.MemoryView":978 * cdef int (*to_dtype_func)(char *, object) except 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -60205,7 +60288,7 @@ static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewsl __Pyx_RefNannyFinishContext(); } -/* "View.MemoryView":979 +/* "View.MemoryView":981 * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< @@ -60223,7 +60306,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor int __pyx_clineno = 0; __Pyx_RefNannySetupContext("convert_item_to_object", 0); - /* "View.MemoryView":980 + /* "View.MemoryView":982 * * cdef convert_item_to_object(self, char *itemp): * if self.to_object_func != NULL: # <<<<<<<<<<<<<< @@ -60233,7 +60316,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0); if (__pyx_t_1) { - /* "View.MemoryView":981 + /* "View.MemoryView":983 * cdef convert_item_to_object(self, char *itemp): * if self.to_object_func != NULL: * return self.to_object_func(itemp) # <<<<<<<<<<<<<< @@ -60241,13 +60324,13 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor * return memoryview.convert_item_to_object(self, itemp) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 981, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "View.MemoryView":980 + /* "View.MemoryView":982 * * cdef convert_item_to_object(self, char *itemp): * if self.to_object_func != NULL: # <<<<<<<<<<<<<< @@ -60256,7 +60339,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor */ } - /* "View.MemoryView":983 + /* "View.MemoryView":985 * return self.to_object_func(itemp) * else: * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<< @@ -60265,14 +60348,14 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 983, __pyx_L1_error) + __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } - /* "View.MemoryView":979 + /* "View.MemoryView":981 * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< @@ -60291,7 +60374,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor return __pyx_r; } -/* "View.MemoryView":985 +/* "View.MemoryView":987 * return memoryview.convert_item_to_object(self, itemp) * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< @@ -60310,7 +60393,7 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo int __pyx_clineno = 0; __Pyx_RefNannySetupContext("assign_item_from_object", 0); - /* "View.MemoryView":986 + /* "View.MemoryView":988 * * cdef assign_item_from_object(self, char *itemp, object value): * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< @@ -60320,16 +60403,16 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0); if (__pyx_t_1) { - /* "View.MemoryView":987 + /* "View.MemoryView":989 * cdef assign_item_from_object(self, char *itemp, object value): * if self.to_dtype_func != NULL: * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<< * else: * memoryview.assign_item_from_object(self, itemp, value) */ - __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 987, __pyx_L1_error) + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 989, __pyx_L1_error) - /* "View.MemoryView":986 + /* "View.MemoryView":988 * * cdef assign_item_from_object(self, char *itemp, object value): * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< @@ -60339,7 +60422,7 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo goto __pyx_L3; } - /* "View.MemoryView":989 + /* "View.MemoryView":991 * self.to_dtype_func(itemp, value) * else: * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<< @@ -60347,13 +60430,13 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo * @property */ /*else*/ { - __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 989, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 991, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L3:; - /* "View.MemoryView":985 + /* "View.MemoryView":987 * return memoryview.convert_item_to_object(self, itemp) * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< @@ -60374,7 +60457,7 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo return __pyx_r; } -/* "View.MemoryView":992 +/* "View.MemoryView":994 * * @property * def base(self): # <<<<<<<<<<<<<< @@ -60400,7 +60483,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); - /* "View.MemoryView":993 + /* "View.MemoryView":995 * @property * def base(self): * return self.from_object # <<<<<<<<<<<<<< @@ -60412,7 +60495,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__ __pyx_r = __pyx_v_self->from_object; goto __pyx_L0; - /* "View.MemoryView":992 + /* "View.MemoryView":994 * * @property * def base(self): # <<<<<<<<<<<<<< @@ -60540,7 +60623,7 @@ static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUS return __pyx_r; } -/* "View.MemoryView":999 +/* "View.MemoryView":1001 * * @cname('__pyx_memoryview_fromslice') * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< @@ -60568,7 +60651,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl int __pyx_clineno = 0; __Pyx_RefNannySetupContext("memoryview_fromslice", 0); - /* "View.MemoryView":1007 + /* "View.MemoryView":1009 * cdef _memoryviewslice result * * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< @@ -60578,7 +60661,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0); if (__pyx_t_1) { - /* "View.MemoryView":1008 + /* "View.MemoryView":1010 * * if memviewslice.memview == Py_None: * return None # <<<<<<<<<<<<<< @@ -60589,7 +60672,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "View.MemoryView":1007 + /* "View.MemoryView":1009 * cdef _memoryviewslice result * * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< @@ -60598,16 +60681,16 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ } - /* "View.MemoryView":1013 + /* "View.MemoryView":1015 * * * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<< * * result.from_slice = memviewslice */ - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1013, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1015, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1013, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1015, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -60618,13 +60701,13 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1013, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1015, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":1015 + /* "View.MemoryView":1017 * result = _memoryviewslice(None, 0, dtype_is_object) * * result.from_slice = memviewslice # <<<<<<<<<<<<<< @@ -60633,7 +60716,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->from_slice = __pyx_v_memviewslice; - /* "View.MemoryView":1016 + /* "View.MemoryView":1018 * * result.from_slice = memviewslice * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<< @@ -60642,14 +60725,14 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1); - /* "View.MemoryView":1018 + /* "View.MemoryView":1020 * __PYX_INC_MEMVIEW(&memviewslice, 1) * * result.from_object = ( memviewslice.memview).base # <<<<<<<<<<<<<< * result.typeinfo = memviewslice.memview.typeinfo * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1018, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1020, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_result->from_object); @@ -60657,7 +60740,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_v_result->from_object = __pyx_t_2; __pyx_t_2 = 0; - /* "View.MemoryView":1019 + /* "View.MemoryView":1021 * * result.from_object = ( memviewslice.memview).base * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<< @@ -60667,7 +60750,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo; __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4; - /* "View.MemoryView":1021 + /* "View.MemoryView":1023 * result.typeinfo = memviewslice.memview.typeinfo * * result.view = memviewslice.memview.view # <<<<<<<<<<<<<< @@ -60677,7 +60760,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_5 = __pyx_v_memviewslice.memview->view; __pyx_v_result->__pyx_base.view = __pyx_t_5; - /* "View.MemoryView":1022 + /* "View.MemoryView":1024 * * result.view = memviewslice.memview.view * result.view.buf = memviewslice.data # <<<<<<<<<<<<<< @@ -60686,7 +60769,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data); - /* "View.MemoryView":1023 + /* "View.MemoryView":1025 * result.view = memviewslice.memview.view * result.view.buf = memviewslice.data * result.view.ndim = ndim # <<<<<<<<<<<<<< @@ -60695,7 +60778,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim; - /* "View.MemoryView":1024 + /* "View.MemoryView":1026 * result.view.buf = memviewslice.data * result.view.ndim = ndim * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<< @@ -60704,7 +60787,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None; - /* "View.MemoryView":1025 + /* "View.MemoryView":1027 * result.view.ndim = ndim * (<__pyx_buffer *> &result.view).obj = Py_None * Py_INCREF(Py_None) # <<<<<<<<<<<<<< @@ -60713,7 +60796,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ Py_INCREF(Py_None); - /* "View.MemoryView":1027 + /* "View.MemoryView":1029 * Py_INCREF(Py_None) * * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<< @@ -60723,7 +60806,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0); if (__pyx_t_1) { - /* "View.MemoryView":1028 + /* "View.MemoryView":1030 * * if (memviewslice.memview).flags & PyBUF_WRITABLE: * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<< @@ -60732,7 +60815,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS; - /* "View.MemoryView":1027 + /* "View.MemoryView":1029 * Py_INCREF(Py_None) * * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<< @@ -60742,7 +60825,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl goto __pyx_L4; } - /* "View.MemoryView":1030 + /* "View.MemoryView":1032 * result.flags = PyBUF_RECORDS * else: * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<< @@ -60754,7 +60837,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl } __pyx_L4:; - /* "View.MemoryView":1032 + /* "View.MemoryView":1034 * result.flags = PyBUF_RECORDS_RO * * result.view.shape = result.from_slice.shape # <<<<<<<<<<<<<< @@ -60763,7 +60846,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape); - /* "View.MemoryView":1033 + /* "View.MemoryView":1035 * * result.view.shape = result.from_slice.shape * result.view.strides = result.from_slice.strides # <<<<<<<<<<<<<< @@ -60772,7 +60855,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides); - /* "View.MemoryView":1036 + /* "View.MemoryView":1038 * * * result.view.suboffsets = NULL # <<<<<<<<<<<<<< @@ -60781,7 +60864,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->__pyx_base.view.suboffsets = NULL; - /* "View.MemoryView":1037 + /* "View.MemoryView":1039 * * result.view.suboffsets = NULL * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<< @@ -60793,7 +60876,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_6 = __pyx_t_8; __pyx_v_suboffset = (__pyx_t_6[0]); - /* "View.MemoryView":1038 + /* "View.MemoryView":1040 * result.view.suboffsets = NULL * for suboffset in result.from_slice.suboffsets[:ndim]: * if suboffset >= 0: # <<<<<<<<<<<<<< @@ -60803,7 +60886,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0); if (__pyx_t_1) { - /* "View.MemoryView":1039 + /* "View.MemoryView":1041 * for suboffset in result.from_slice.suboffsets[:ndim]: * if suboffset >= 0: * result.view.suboffsets = result.from_slice.suboffsets # <<<<<<<<<<<<<< @@ -60812,7 +60895,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets); - /* "View.MemoryView":1040 + /* "View.MemoryView":1042 * if suboffset >= 0: * result.view.suboffsets = result.from_slice.suboffsets * break # <<<<<<<<<<<<<< @@ -60821,7 +60904,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ goto __pyx_L6_break; - /* "View.MemoryView":1038 + /* "View.MemoryView":1040 * result.view.suboffsets = NULL * for suboffset in result.from_slice.suboffsets[:ndim]: * if suboffset >= 0: # <<<<<<<<<<<<<< @@ -60832,7 +60915,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl } __pyx_L6_break:; - /* "View.MemoryView":1042 + /* "View.MemoryView":1044 * break * * result.view.len = result.view.itemsize # <<<<<<<<<<<<<< @@ -60842,7 +60925,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize; __pyx_v_result->__pyx_base.view.len = __pyx_t_9; - /* "View.MemoryView":1043 + /* "View.MemoryView":1045 * * result.view.len = result.view.itemsize * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<< @@ -60852,29 +60935,29 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim); for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { __pyx_t_6 = __pyx_t_8; - __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1043, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1045, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); __pyx_t_2 = 0; - /* "View.MemoryView":1044 + /* "View.MemoryView":1046 * result.view.len = result.view.itemsize * for length in result.view.shape[:ndim]: * result.view.len *= length # <<<<<<<<<<<<<< * * result.to_object_func = to_object_func */ - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1044, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1046, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1044, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1046, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1044, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1046, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result->__pyx_base.view.len = __pyx_t_9; } - /* "View.MemoryView":1046 + /* "View.MemoryView":1048 * result.view.len *= length * * result.to_object_func = to_object_func # <<<<<<<<<<<<<< @@ -60883,7 +60966,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->to_object_func = __pyx_v_to_object_func; - /* "View.MemoryView":1047 + /* "View.MemoryView":1049 * * result.to_object_func = to_object_func * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<< @@ -60892,7 +60975,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl */ __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func; - /* "View.MemoryView":1049 + /* "View.MemoryView":1051 * result.to_dtype_func = to_dtype_func * * return result # <<<<<<<<<<<<<< @@ -60904,7 +60987,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; - /* "View.MemoryView":999 + /* "View.MemoryView":1001 * * @cname('__pyx_memoryview_fromslice') * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< @@ -60926,7 +61009,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl return __pyx_r; } -/* "View.MemoryView":1052 +/* "View.MemoryView":1054 * * @cname('__pyx_memoryview_get_slice_from_memoryview') * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< @@ -60946,7 +61029,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_slice_from_memview", 0); - /* "View.MemoryView":1055 + /* "View.MemoryView":1057 * __Pyx_memviewslice *mslice) except NULL: * cdef _memoryviewslice obj * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< @@ -60957,20 +61040,20 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":1056 + /* "View.MemoryView":1058 * cdef _memoryviewslice obj * if isinstance(memview, _memoryviewslice): * obj = memview # <<<<<<<<<<<<<< * return &obj.from_slice * else: */ - if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1056, __pyx_L1_error) + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1058, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); __pyx_t_3 = 0; - /* "View.MemoryView":1057 + /* "View.MemoryView":1059 * if isinstance(memview, _memoryviewslice): * obj = memview * return &obj.from_slice # <<<<<<<<<<<<<< @@ -60980,7 +61063,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p __pyx_r = (&__pyx_v_obj->from_slice); goto __pyx_L0; - /* "View.MemoryView":1055 + /* "View.MemoryView":1057 * __Pyx_memviewslice *mslice) except NULL: * cdef _memoryviewslice obj * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< @@ -60989,7 +61072,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p */ } - /* "View.MemoryView":1059 + /* "View.MemoryView":1061 * return &obj.from_slice * else: * slice_copy(memview, mslice) # <<<<<<<<<<<<<< @@ -60999,7 +61082,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p /*else*/ { __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice); - /* "View.MemoryView":1060 + /* "View.MemoryView":1062 * else: * slice_copy(memview, mslice) * return mslice # <<<<<<<<<<<<<< @@ -61010,7 +61093,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p goto __pyx_L0; } - /* "View.MemoryView":1052 + /* "View.MemoryView":1054 * * @cname('__pyx_memoryview_get_slice_from_memoryview') * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< @@ -61029,7 +61112,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p return __pyx_r; } -/* "View.MemoryView":1063 +/* "View.MemoryView":1065 * * @cname('__pyx_memoryview_slice_copy') * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< @@ -61050,7 +61133,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem Py_ssize_t __pyx_t_5; __Pyx_RefNannySetupContext("slice_copy", 0); - /* "View.MemoryView":1067 + /* "View.MemoryView":1069 * cdef (Py_ssize_t*) shape, strides, suboffsets * * shape = memview.view.shape # <<<<<<<<<<<<<< @@ -61060,7 +61143,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem __pyx_t_1 = __pyx_v_memview->view.shape; __pyx_v_shape = __pyx_t_1; - /* "View.MemoryView":1068 + /* "View.MemoryView":1070 * * shape = memview.view.shape * strides = memview.view.strides # <<<<<<<<<<<<<< @@ -61070,7 +61153,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem __pyx_t_1 = __pyx_v_memview->view.strides; __pyx_v_strides = __pyx_t_1; - /* "View.MemoryView":1069 + /* "View.MemoryView":1071 * shape = memview.view.shape * strides = memview.view.strides * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<< @@ -61080,7 +61163,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem __pyx_t_1 = __pyx_v_memview->view.suboffsets; __pyx_v_suboffsets = __pyx_t_1; - /* "View.MemoryView":1071 + /* "View.MemoryView":1073 * suboffsets = memview.view.suboffsets * * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<< @@ -61089,7 +61172,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem */ __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview); - /* "View.MemoryView":1072 + /* "View.MemoryView":1074 * * dst.memview = <__pyx_memoryview *> memview * dst.data = memview.view.buf # <<<<<<<<<<<<<< @@ -61098,7 +61181,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem */ __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf); - /* "View.MemoryView":1074 + /* "View.MemoryView":1076 * dst.data = memview.view.buf * * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<< @@ -61110,7 +61193,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_dim = __pyx_t_4; - /* "View.MemoryView":1075 + /* "View.MemoryView":1077 * * for dim in range(memview.view.ndim): * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<< @@ -61119,7 +61202,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem */ (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]); - /* "View.MemoryView":1076 + /* "View.MemoryView":1078 * for dim in range(memview.view.ndim): * dst.shape[dim] = shape[dim] * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<< @@ -61128,7 +61211,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem */ (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]); - /* "View.MemoryView":1077 + /* "View.MemoryView":1079 * dst.shape[dim] = shape[dim] * dst.strides[dim] = strides[dim] * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<< @@ -61143,7 +61226,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5; } - /* "View.MemoryView":1063 + /* "View.MemoryView":1065 * * @cname('__pyx_memoryview_slice_copy') * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< @@ -61155,7 +61238,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem __Pyx_RefNannyFinishContext(); } -/* "View.MemoryView":1080 +/* "View.MemoryView":1082 * * @cname('__pyx_memoryview_copy_object') * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< @@ -61173,7 +61256,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("memoryview_copy", 0); - /* "View.MemoryView":1083 + /* "View.MemoryView":1085 * "Create a new memoryview object" * cdef __Pyx_memviewslice memviewslice * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<< @@ -61182,7 +61265,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx */ __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice)); - /* "View.MemoryView":1084 + /* "View.MemoryView":1086 * cdef __Pyx_memviewslice memviewslice * slice_copy(memview, &memviewslice) * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<< @@ -61190,13 +61273,13 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx * @cname('__pyx_memoryview_copy_object_from_slice') */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1084, __pyx_L1_error) + __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1086, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "View.MemoryView":1080 + /* "View.MemoryView":1082 * * @cname('__pyx_memoryview_copy_object') * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< @@ -61215,7 +61298,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx return __pyx_r; } -/* "View.MemoryView":1087 +/* "View.MemoryView":1089 * * @cname('__pyx_memoryview_copy_object_from_slice') * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< @@ -61238,7 +61321,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview int __pyx_clineno = 0; __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0); - /* "View.MemoryView":1094 + /* "View.MemoryView":1096 * cdef int (*to_dtype_func)(char *, object) except 0 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< @@ -61249,7 +61332,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "View.MemoryView":1095 + /* "View.MemoryView":1097 * * if isinstance(memview, _memoryviewslice): * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<< @@ -61259,7 +61342,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func; __pyx_v_to_object_func = __pyx_t_3; - /* "View.MemoryView":1096 + /* "View.MemoryView":1098 * if isinstance(memview, _memoryviewslice): * to_object_func = (<_memoryviewslice> memview).to_object_func * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<< @@ -61269,7 +61352,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func; __pyx_v_to_dtype_func = __pyx_t_4; - /* "View.MemoryView":1094 + /* "View.MemoryView":1096 * cdef int (*to_dtype_func)(char *, object) except 0 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< @@ -61279,7 +61362,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview goto __pyx_L3; } - /* "View.MemoryView":1098 + /* "View.MemoryView":1100 * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func * else: * to_object_func = NULL # <<<<<<<<<<<<<< @@ -61289,7 +61372,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview /*else*/ { __pyx_v_to_object_func = NULL; - /* "View.MemoryView":1099 + /* "View.MemoryView":1101 * else: * to_object_func = NULL * to_dtype_func = NULL # <<<<<<<<<<<<<< @@ -61300,7 +61383,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview } __pyx_L3:; - /* "View.MemoryView":1101 + /* "View.MemoryView":1103 * to_dtype_func = NULL * * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<< @@ -61309,20 +61392,20 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview */ __Pyx_XDECREF(__pyx_r); - /* "View.MemoryView":1103 + /* "View.MemoryView":1105 * return memoryview_fromslice(memviewslice[0], memview.view.ndim, * to_object_func, to_dtype_func, * memview.dtype_is_object) # <<<<<<<<<<<<<< * * */ - __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1101, __pyx_L1_error) + __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - /* "View.MemoryView":1087 + /* "View.MemoryView":1089 * * @cname('__pyx_memoryview_copy_object_from_slice') * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< @@ -61341,7 +61424,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview return __pyx_r; } -/* "View.MemoryView":1109 +/* "View.MemoryView":1111 * * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< @@ -61353,7 +61436,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { Py_ssize_t __pyx_r; int __pyx_t_1; - /* "View.MemoryView":1110 + /* "View.MemoryView":1112 * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: * if arg < 0: # <<<<<<<<<<<<<< @@ -61363,7 +61446,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { __pyx_t_1 = ((__pyx_v_arg < 0) != 0); if (__pyx_t_1) { - /* "View.MemoryView":1111 + /* "View.MemoryView":1113 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: * if arg < 0: * return -arg # <<<<<<<<<<<<<< @@ -61373,7 +61456,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { __pyx_r = (-__pyx_v_arg); goto __pyx_L0; - /* "View.MemoryView":1110 + /* "View.MemoryView":1112 * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: * if arg < 0: # <<<<<<<<<<<<<< @@ -61382,7 +61465,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { */ } - /* "View.MemoryView":1113 + /* "View.MemoryView":1115 * return -arg * else: * return arg # <<<<<<<<<<<<<< @@ -61394,7 +61477,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { goto __pyx_L0; } - /* "View.MemoryView":1109 + /* "View.MemoryView":1111 * * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< @@ -61407,7 +61490,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { return __pyx_r; } -/* "View.MemoryView":1116 +/* "View.MemoryView":1118 * * @cname('__pyx_get_best_slice_order') * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< @@ -61425,7 +61508,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ int __pyx_t_3; int __pyx_t_4; - /* "View.MemoryView":1121 + /* "View.MemoryView":1123 * """ * cdef int i * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<< @@ -61434,7 +61517,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ */ __pyx_v_c_stride = 0; - /* "View.MemoryView":1122 + /* "View.MemoryView":1124 * cdef int i * cdef Py_ssize_t c_stride = 0 * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<< @@ -61443,7 +61526,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ */ __pyx_v_f_stride = 0; - /* "View.MemoryView":1124 + /* "View.MemoryView":1126 * cdef Py_ssize_t f_stride = 0 * * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< @@ -61453,7 +61536,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { __pyx_v_i = __pyx_t_1; - /* "View.MemoryView":1125 + /* "View.MemoryView":1127 * * for i in range(ndim - 1, -1, -1): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< @@ -61463,7 +61546,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1126 + /* "View.MemoryView":1128 * for i in range(ndim - 1, -1, -1): * if mslice.shape[i] > 1: * c_stride = mslice.strides[i] # <<<<<<<<<<<<<< @@ -61472,7 +61555,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ */ __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]); - /* "View.MemoryView":1127 + /* "View.MemoryView":1129 * if mslice.shape[i] > 1: * c_stride = mslice.strides[i] * break # <<<<<<<<<<<<<< @@ -61481,7 +61564,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ */ goto __pyx_L4_break; - /* "View.MemoryView":1125 + /* "View.MemoryView":1127 * * for i in range(ndim - 1, -1, -1): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< @@ -61492,7 +61575,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ } __pyx_L4_break:; - /* "View.MemoryView":1129 + /* "View.MemoryView":1131 * break * * for i in range(ndim): # <<<<<<<<<<<<<< @@ -61504,7 +61587,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "View.MemoryView":1130 + /* "View.MemoryView":1132 * * for i in range(ndim): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< @@ -61514,7 +61597,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1131 + /* "View.MemoryView":1133 * for i in range(ndim): * if mslice.shape[i] > 1: * f_stride = mslice.strides[i] # <<<<<<<<<<<<<< @@ -61523,7 +61606,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ */ __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]); - /* "View.MemoryView":1132 + /* "View.MemoryView":1134 * if mslice.shape[i] > 1: * f_stride = mslice.strides[i] * break # <<<<<<<<<<<<<< @@ -61532,7 +61615,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ */ goto __pyx_L7_break; - /* "View.MemoryView":1130 + /* "View.MemoryView":1132 * * for i in range(ndim): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< @@ -61543,7 +61626,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ } __pyx_L7_break:; - /* "View.MemoryView":1134 + /* "View.MemoryView":1136 * break * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< @@ -61553,7 +61636,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1135 + /* "View.MemoryView":1137 * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): * return 'C' # <<<<<<<<<<<<<< @@ -61563,7 +61646,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ __pyx_r = 'C'; goto __pyx_L0; - /* "View.MemoryView":1134 + /* "View.MemoryView":1136 * break * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< @@ -61572,7 +61655,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ */ } - /* "View.MemoryView":1137 + /* "View.MemoryView":1139 * return 'C' * else: * return 'F' # <<<<<<<<<<<<<< @@ -61584,7 +61667,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ goto __pyx_L0; } - /* "View.MemoryView":1116 + /* "View.MemoryView":1118 * * @cname('__pyx_get_best_slice_order') * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< @@ -61597,7 +61680,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ return __pyx_r; } -/* "View.MemoryView":1140 +/* "View.MemoryView":1142 * * @cython.cdivision(True) * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< @@ -61618,7 +61701,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v Py_ssize_t __pyx_t_5; Py_ssize_t __pyx_t_6; - /* "View.MemoryView":1147 + /* "View.MemoryView":1149 * * cdef Py_ssize_t i * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<< @@ -61627,7 +61710,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ __pyx_v_src_extent = (__pyx_v_src_shape[0]); - /* "View.MemoryView":1148 + /* "View.MemoryView":1150 * cdef Py_ssize_t i * cdef Py_ssize_t src_extent = src_shape[0] * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<< @@ -61636,7 +61719,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ __pyx_v_dst_extent = (__pyx_v_dst_shape[0]); - /* "View.MemoryView":1149 + /* "View.MemoryView":1151 * cdef Py_ssize_t src_extent = src_shape[0] * cdef Py_ssize_t dst_extent = dst_shape[0] * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<< @@ -61645,7 +61728,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ __pyx_v_src_stride = (__pyx_v_src_strides[0]); - /* "View.MemoryView":1150 + /* "View.MemoryView":1152 * cdef Py_ssize_t dst_extent = dst_shape[0] * cdef Py_ssize_t src_stride = src_strides[0] * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<< @@ -61654,7 +61737,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ __pyx_v_dst_stride = (__pyx_v_dst_strides[0]); - /* "View.MemoryView":1152 + /* "View.MemoryView":1154 * cdef Py_ssize_t dst_stride = dst_strides[0] * * if ndim == 1: # <<<<<<<<<<<<<< @@ -61664,7 +61747,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); if (__pyx_t_1) { - /* "View.MemoryView":1153 + /* "View.MemoryView":1155 * * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< @@ -61684,7 +61767,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v goto __pyx_L5_bool_binop_done; } - /* "View.MemoryView":1154 + /* "View.MemoryView":1156 * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and * src_stride == itemsize == dst_stride): # <<<<<<<<<<<<<< @@ -61699,7 +61782,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v __pyx_t_1 = __pyx_t_3; __pyx_L5_bool_binop_done:; - /* "View.MemoryView":1153 + /* "View.MemoryView":1155 * * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< @@ -61708,7 +61791,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ if (__pyx_t_1) { - /* "View.MemoryView":1155 + /* "View.MemoryView":1157 * if (src_stride > 0 and dst_stride > 0 and * src_stride == itemsize == dst_stride): * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<< @@ -61717,7 +61800,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent))); - /* "View.MemoryView":1153 + /* "View.MemoryView":1155 * * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< @@ -61727,7 +61810,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v goto __pyx_L4; } - /* "View.MemoryView":1157 + /* "View.MemoryView":1159 * memcpy(dst_data, src_data, itemsize * dst_extent) * else: * for i in range(dst_extent): # <<<<<<<<<<<<<< @@ -61740,7 +61823,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "View.MemoryView":1158 + /* "View.MemoryView":1160 * else: * for i in range(dst_extent): * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<< @@ -61749,7 +61832,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize)); - /* "View.MemoryView":1159 + /* "View.MemoryView":1161 * for i in range(dst_extent): * memcpy(dst_data, src_data, itemsize) * src_data += src_stride # <<<<<<<<<<<<<< @@ -61758,7 +61841,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); - /* "View.MemoryView":1160 + /* "View.MemoryView":1162 * memcpy(dst_data, src_data, itemsize) * src_data += src_stride * dst_data += dst_stride # <<<<<<<<<<<<<< @@ -61770,7 +61853,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v } __pyx_L4:; - /* "View.MemoryView":1152 + /* "View.MemoryView":1154 * cdef Py_ssize_t dst_stride = dst_strides[0] * * if ndim == 1: # <<<<<<<<<<<<<< @@ -61780,7 +61863,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v goto __pyx_L3; } - /* "View.MemoryView":1162 + /* "View.MemoryView":1164 * dst_data += dst_stride * else: * for i in range(dst_extent): # <<<<<<<<<<<<<< @@ -61793,7 +61876,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "View.MemoryView":1163 + /* "View.MemoryView":1165 * else: * for i in range(dst_extent): * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<< @@ -61802,7 +61885,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize); - /* "View.MemoryView":1167 + /* "View.MemoryView":1169 * src_shape + 1, dst_shape + 1, * ndim - 1, itemsize) * src_data += src_stride # <<<<<<<<<<<<<< @@ -61811,7 +61894,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v */ __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); - /* "View.MemoryView":1168 + /* "View.MemoryView":1170 * ndim - 1, itemsize) * src_data += src_stride * dst_data += dst_stride # <<<<<<<<<<<<<< @@ -61823,7 +61906,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v } __pyx_L3:; - /* "View.MemoryView":1140 + /* "View.MemoryView":1142 * * @cython.cdivision(True) * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< @@ -61834,7 +61917,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v /* function exit code */ } -/* "View.MemoryView":1170 +/* "View.MemoryView":1172 * dst_data += dst_stride * * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< @@ -61844,7 +61927,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) { - /* "View.MemoryView":1173 + /* "View.MemoryView":1175 * __Pyx_memviewslice *dst, * int ndim, size_t itemsize) nogil: * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<< @@ -61853,7 +61936,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi */ _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize); - /* "View.MemoryView":1170 + /* "View.MemoryView":1172 * dst_data += dst_stride * * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< @@ -61864,7 +61947,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi /* function exit code */ } -/* "View.MemoryView":1177 +/* "View.MemoryView":1179 * * @cname('__pyx_memoryview_slice_get_size') * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< @@ -61881,7 +61964,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr Py_ssize_t *__pyx_t_3; Py_ssize_t *__pyx_t_4; - /* "View.MemoryView":1179 + /* "View.MemoryView":1181 * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: * "Return the size of the memory occupied by the slice in number of bytes" * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<< @@ -61891,7 +61974,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr __pyx_t_1 = __pyx_v_src->memview->view.itemsize; __pyx_v_size = __pyx_t_1; - /* "View.MemoryView":1181 + /* "View.MemoryView":1183 * cdef Py_ssize_t shape, size = src.memview.view.itemsize * * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<< @@ -61903,7 +61986,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr __pyx_t_2 = __pyx_t_4; __pyx_v_shape = (__pyx_t_2[0]); - /* "View.MemoryView":1182 + /* "View.MemoryView":1184 * * for shape in src.shape[:ndim]: * size *= shape # <<<<<<<<<<<<<< @@ -61913,7 +61996,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr __pyx_v_size = (__pyx_v_size * __pyx_v_shape); } - /* "View.MemoryView":1184 + /* "View.MemoryView":1186 * size *= shape * * return size # <<<<<<<<<<<<<< @@ -61923,7 +62006,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr __pyx_r = __pyx_v_size; goto __pyx_L0; - /* "View.MemoryView":1177 + /* "View.MemoryView":1179 * * @cname('__pyx_memoryview_slice_get_size') * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< @@ -61936,7 +62019,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr return __pyx_r; } -/* "View.MemoryView":1187 +/* "View.MemoryView":1189 * * @cname('__pyx_fill_contig_strides_array') * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< @@ -61952,7 +62035,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ int __pyx_t_3; int __pyx_t_4; - /* "View.MemoryView":1196 + /* "View.MemoryView":1198 * cdef int idx * * if order == 'F': # <<<<<<<<<<<<<< @@ -61962,7 +62045,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ __pyx_t_1 = ((__pyx_v_order == 'F') != 0); if (__pyx_t_1) { - /* "View.MemoryView":1197 + /* "View.MemoryView":1199 * * if order == 'F': * for idx in range(ndim): # <<<<<<<<<<<<<< @@ -61974,7 +62057,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_idx = __pyx_t_4; - /* "View.MemoryView":1198 + /* "View.MemoryView":1200 * if order == 'F': * for idx in range(ndim): * strides[idx] = stride # <<<<<<<<<<<<<< @@ -61983,7 +62066,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ */ (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; - /* "View.MemoryView":1199 + /* "View.MemoryView":1201 * for idx in range(ndim): * strides[idx] = stride * stride *= shape[idx] # <<<<<<<<<<<<<< @@ -61993,7 +62076,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); } - /* "View.MemoryView":1196 + /* "View.MemoryView":1198 * cdef int idx * * if order == 'F': # <<<<<<<<<<<<<< @@ -62003,7 +62086,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ goto __pyx_L3; } - /* "View.MemoryView":1201 + /* "View.MemoryView":1203 * stride *= shape[idx] * else: * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< @@ -62014,7 +62097,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) { __pyx_v_idx = __pyx_t_2; - /* "View.MemoryView":1202 + /* "View.MemoryView":1204 * else: * for idx in range(ndim - 1, -1, -1): * strides[idx] = stride # <<<<<<<<<<<<<< @@ -62023,7 +62106,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ */ (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; - /* "View.MemoryView":1203 + /* "View.MemoryView":1205 * for idx in range(ndim - 1, -1, -1): * strides[idx] = stride * stride *= shape[idx] # <<<<<<<<<<<<<< @@ -62035,7 +62118,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ } __pyx_L3:; - /* "View.MemoryView":1205 + /* "View.MemoryView":1207 * stride *= shape[idx] * * return stride # <<<<<<<<<<<<<< @@ -62045,7 +62128,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ __pyx_r = __pyx_v_stride; goto __pyx_L0; - /* "View.MemoryView":1187 + /* "View.MemoryView":1189 * * @cname('__pyx_fill_contig_strides_array') * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< @@ -62058,7 +62141,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ return __pyx_r; } -/* "View.MemoryView":1208 +/* "View.MemoryView":1210 * * @cname('__pyx_memoryview_copy_data_to_temp') * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< @@ -62082,7 +62165,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, const char *__pyx_filename = NULL; int __pyx_clineno = 0; - /* "View.MemoryView":1219 + /* "View.MemoryView":1221 * cdef void *result * * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< @@ -62092,7 +62175,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_t_1 = __pyx_v_src->memview->view.itemsize; __pyx_v_itemsize = __pyx_t_1; - /* "View.MemoryView":1220 + /* "View.MemoryView":1222 * * cdef size_t itemsize = src.memview.view.itemsize * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<< @@ -62101,7 +62184,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, */ __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim); - /* "View.MemoryView":1222 + /* "View.MemoryView":1224 * cdef size_t size = slice_get_size(src, ndim) * * result = malloc(size) # <<<<<<<<<<<<<< @@ -62110,7 +62193,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, */ __pyx_v_result = malloc(__pyx_v_size); - /* "View.MemoryView":1223 + /* "View.MemoryView":1225 * * result = malloc(size) * if not result: # <<<<<<<<<<<<<< @@ -62120,16 +62203,16 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1224 + /* "View.MemoryView":1226 * result = malloc(size) * if not result: * _err(MemoryError, NULL) # <<<<<<<<<<<<<< * * */ - __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 1224, __pyx_L1_error) + __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 1226, __pyx_L1_error) - /* "View.MemoryView":1223 + /* "View.MemoryView":1225 * * result = malloc(size) * if not result: # <<<<<<<<<<<<<< @@ -62138,7 +62221,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, */ } - /* "View.MemoryView":1227 + /* "View.MemoryView":1229 * * * tmpslice.data = result # <<<<<<<<<<<<<< @@ -62147,7 +62230,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, */ __pyx_v_tmpslice->data = ((char *)__pyx_v_result); - /* "View.MemoryView":1228 + /* "View.MemoryView":1230 * * tmpslice.data = result * tmpslice.memview = src.memview # <<<<<<<<<<<<<< @@ -62157,7 +62240,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_t_4 = __pyx_v_src->memview; __pyx_v_tmpslice->memview = __pyx_t_4; - /* "View.MemoryView":1229 + /* "View.MemoryView":1231 * tmpslice.data = result * tmpslice.memview = src.memview * for i in range(ndim): # <<<<<<<<<<<<<< @@ -62169,7 +62252,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "View.MemoryView":1230 + /* "View.MemoryView":1232 * tmpslice.memview = src.memview * for i in range(ndim): * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<< @@ -62178,7 +62261,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, */ (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]); - /* "View.MemoryView":1231 + /* "View.MemoryView":1233 * for i in range(ndim): * tmpslice.shape[i] = src.shape[i] * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< @@ -62188,7 +62271,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L; } - /* "View.MemoryView":1233 + /* "View.MemoryView":1235 * tmpslice.suboffsets[i] = -1 * * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<< @@ -62197,7 +62280,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, */ (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order)); - /* "View.MemoryView":1237 + /* "View.MemoryView":1239 * * * for i in range(ndim): # <<<<<<<<<<<<<< @@ -62209,7 +62292,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "View.MemoryView":1238 + /* "View.MemoryView":1240 * * for i in range(ndim): * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< @@ -62219,7 +62302,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1239 + /* "View.MemoryView":1241 * for i in range(ndim): * if tmpslice.shape[i] == 1: * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<< @@ -62228,7 +62311,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, */ (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0; - /* "View.MemoryView":1238 + /* "View.MemoryView":1240 * * for i in range(ndim): * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< @@ -62238,7 +62321,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, } } - /* "View.MemoryView":1241 + /* "View.MemoryView":1243 * tmpslice.strides[i] = 0 * * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< @@ -62248,7 +62331,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1242 + /* "View.MemoryView":1244 * * if slice_is_contig(src[0], order, ndim): * memcpy(result, src.data, size) # <<<<<<<<<<<<<< @@ -62257,7 +62340,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, */ (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size)); - /* "View.MemoryView":1241 + /* "View.MemoryView":1243 * tmpslice.strides[i] = 0 * * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< @@ -62267,7 +62350,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, goto __pyx_L9; } - /* "View.MemoryView":1244 + /* "View.MemoryView":1246 * memcpy(result, src.data, size) * else: * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<< @@ -62279,7 +62362,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, } __pyx_L9:; - /* "View.MemoryView":1246 + /* "View.MemoryView":1248 * copy_strided_to_strided(src, tmpslice, ndim, itemsize) * * return result # <<<<<<<<<<<<<< @@ -62289,7 +62372,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_r = __pyx_v_result; goto __pyx_L0; - /* "View.MemoryView":1208 + /* "View.MemoryView":1210 * * @cname('__pyx_memoryview_copy_data_to_temp') * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< @@ -62313,7 +62396,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, return __pyx_r; } -/* "View.MemoryView":1251 +/* "View.MemoryView":1253 * * @cname('__pyx_memoryview_err_extents') * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< @@ -62336,20 +62419,20 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent #endif __Pyx_RefNannySetupContext("_err_extents", 0); - /* "View.MemoryView":1254 + /* "View.MemoryView":1256 * Py_ssize_t extent2) except -1 with gil: * raise ValueError("got differing extents in dimension %d (got %d and %d)" % * (i, extent1, extent2)) # <<<<<<<<<<<<<< * * @cname('__pyx_memoryview_err_dim') */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1254, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1254, __pyx_L1_error) + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1254, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1254, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); @@ -62361,24 +62444,24 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent __pyx_t_2 = 0; __pyx_t_3 = 0; - /* "View.MemoryView":1253 + /* "View.MemoryView":1255 * cdef int _err_extents(int i, Py_ssize_t extent1, * Py_ssize_t extent2) except -1 with gil: * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<< * (i, extent1, extent2)) * */ - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1253, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1253, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(2, 1253, __pyx_L1_error) + __PYX_ERR(2, 1255, __pyx_L1_error) - /* "View.MemoryView":1251 + /* "View.MemoryView":1253 * * @cname('__pyx_memoryview_err_extents') * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< @@ -62401,7 +62484,7 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent return __pyx_r; } -/* "View.MemoryView":1257 +/* "View.MemoryView":1259 * * @cname('__pyx_memoryview_err_dim') * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< @@ -62425,18 +62508,18 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, __Pyx_RefNannySetupContext("_err_dim", 0); __Pyx_INCREF(__pyx_v_error); - /* "View.MemoryView":1258 + /* "View.MemoryView":1260 * @cname('__pyx_memoryview_err_dim') * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<< * * @cname('__pyx_memoryview_err') */ - __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1258, __pyx_L1_error) + __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1258, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1258, __pyx_L1_error) + __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1260, __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; @@ -62454,14 +62537,14 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1258, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(2, 1258, __pyx_L1_error) + __PYX_ERR(2, 1260, __pyx_L1_error) - /* "View.MemoryView":1257 + /* "View.MemoryView":1259 * * @cname('__pyx_memoryview_err_dim') * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< @@ -62485,7 +62568,7 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, return __pyx_r; } -/* "View.MemoryView":1261 +/* "View.MemoryView":1263 * * @cname('__pyx_memoryview_err') * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< @@ -62510,7 +62593,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { __Pyx_RefNannySetupContext("_err", 0); __Pyx_INCREF(__pyx_v_error); - /* "View.MemoryView":1262 + /* "View.MemoryView":1264 * @cname('__pyx_memoryview_err') * cdef int _err(object error, char *msg) except -1 with gil: * if msg != NULL: # <<<<<<<<<<<<<< @@ -62520,14 +62603,14 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { __pyx_t_1 = ((__pyx_v_msg != NULL) != 0); if (unlikely(__pyx_t_1)) { - /* "View.MemoryView":1263 + /* "View.MemoryView":1265 * cdef int _err(object error, char *msg) except -1 with gil: * if msg != NULL: * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<< * else: * raise error */ - __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1263, __pyx_L1_error) + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_error); __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; @@ -62543,14 +62626,14 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1263, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(2, 1263, __pyx_L1_error) + __PYX_ERR(2, 1265, __pyx_L1_error) - /* "View.MemoryView":1262 + /* "View.MemoryView":1264 * @cname('__pyx_memoryview_err') * cdef int _err(object error, char *msg) except -1 with gil: * if msg != NULL: # <<<<<<<<<<<<<< @@ -62559,7 +62642,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { */ } - /* "View.MemoryView":1265 + /* "View.MemoryView":1267 * raise error(msg.decode('ascii')) * else: * raise error # <<<<<<<<<<<<<< @@ -62568,10 +62651,10 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { */ /*else*/ { __Pyx_Raise(__pyx_v_error, 0, 0, 0); - __PYX_ERR(2, 1265, __pyx_L1_error) + __PYX_ERR(2, 1267, __pyx_L1_error) } - /* "View.MemoryView":1261 + /* "View.MemoryView":1263 * * @cname('__pyx_memoryview_err') * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< @@ -62595,7 +62678,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { return __pyx_r; } -/* "View.MemoryView":1268 +/* "View.MemoryView":1270 * * @cname('__pyx_memoryview_copy_contents') * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< @@ -62625,7 +62708,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; - /* "View.MemoryView":1276 + /* "View.MemoryView":1278 * Check for overlapping memory and verify the shapes. * """ * cdef void *tmpdata = NULL # <<<<<<<<<<<<<< @@ -62634,7 +62717,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_tmpdata = NULL; - /* "View.MemoryView":1277 + /* "View.MemoryView":1279 * """ * cdef void *tmpdata = NULL * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< @@ -62644,7 +62727,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_1 = __pyx_v_src.memview->view.itemsize; __pyx_v_itemsize = __pyx_t_1; - /* "View.MemoryView":1279 + /* "View.MemoryView":1281 * cdef size_t itemsize = src.memview.view.itemsize * cdef int i * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<< @@ -62653,7 +62736,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim); - /* "View.MemoryView":1280 + /* "View.MemoryView":1282 * cdef int i * cdef char order = get_best_order(&src, src_ndim) * cdef bint broadcasting = False # <<<<<<<<<<<<<< @@ -62662,7 +62745,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_broadcasting = 0; - /* "View.MemoryView":1281 + /* "View.MemoryView":1283 * cdef char order = get_best_order(&src, src_ndim) * cdef bint broadcasting = False * cdef bint direct_copy = False # <<<<<<<<<<<<<< @@ -62671,7 +62754,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_direct_copy = 0; - /* "View.MemoryView":1284 + /* "View.MemoryView":1286 * cdef __Pyx_memviewslice tmp * * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< @@ -62681,7 +62764,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1285 + /* "View.MemoryView":1287 * * if src_ndim < dst_ndim: * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<< @@ -62690,7 +62773,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim); - /* "View.MemoryView":1284 + /* "View.MemoryView":1286 * cdef __Pyx_memviewslice tmp * * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< @@ -62700,7 +62783,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ goto __pyx_L3; } - /* "View.MemoryView":1286 + /* "View.MemoryView":1288 * if src_ndim < dst_ndim: * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< @@ -62710,7 +62793,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1287 + /* "View.MemoryView":1289 * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<< @@ -62719,7 +62802,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim); - /* "View.MemoryView":1286 + /* "View.MemoryView":1288 * if src_ndim < dst_ndim: * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< @@ -62729,7 +62812,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ } __pyx_L3:; - /* "View.MemoryView":1289 + /* "View.MemoryView":1291 * broadcast_leading(&dst, dst_ndim, src_ndim) * * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<< @@ -62745,7 +62828,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ } __pyx_v_ndim = __pyx_t_5; - /* "View.MemoryView":1291 + /* "View.MemoryView":1293 * cdef int ndim = max(src_ndim, dst_ndim) * * for i in range(ndim): # <<<<<<<<<<<<<< @@ -62757,7 +62840,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "View.MemoryView":1292 + /* "View.MemoryView":1294 * * for i in range(ndim): * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< @@ -62767,7 +62850,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1293 + /* "View.MemoryView":1295 * for i in range(ndim): * if src.shape[i] != dst.shape[i]: * if src.shape[i] == 1: # <<<<<<<<<<<<<< @@ -62777,7 +62860,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1294 + /* "View.MemoryView":1296 * if src.shape[i] != dst.shape[i]: * if src.shape[i] == 1: * broadcasting = True # <<<<<<<<<<<<<< @@ -62786,7 +62869,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_broadcasting = 1; - /* "View.MemoryView":1295 + /* "View.MemoryView":1297 * if src.shape[i] == 1: * broadcasting = True * src.strides[i] = 0 # <<<<<<<<<<<<<< @@ -62795,7 +62878,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ (__pyx_v_src.strides[__pyx_v_i]) = 0; - /* "View.MemoryView":1293 + /* "View.MemoryView":1295 * for i in range(ndim): * if src.shape[i] != dst.shape[i]: * if src.shape[i] == 1: # <<<<<<<<<<<<<< @@ -62805,7 +62888,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ goto __pyx_L7; } - /* "View.MemoryView":1297 + /* "View.MemoryView":1299 * src.strides[i] = 0 * else: * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<< @@ -62813,11 +62896,11 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * if src.suboffsets[i] >= 0: */ /*else*/ { - __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1297, __pyx_L1_error) + __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1299, __pyx_L1_error) } __pyx_L7:; - /* "View.MemoryView":1292 + /* "View.MemoryView":1294 * * for i in range(ndim): * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< @@ -62826,7 +62909,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ } - /* "View.MemoryView":1299 + /* "View.MemoryView":1301 * _err_extents(i, dst.shape[i], src.shape[i]) * * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< @@ -62836,16 +62919,16 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1300 + /* "View.MemoryView":1302 * * if src.suboffsets[i] >= 0: * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<< * * if slices_overlap(&src, &dst, ndim, itemsize): */ - __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1300, __pyx_L1_error) + __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1302, __pyx_L1_error) - /* "View.MemoryView":1299 + /* "View.MemoryView":1301 * _err_extents(i, dst.shape[i], src.shape[i]) * * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< @@ -62855,7 +62938,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ } } - /* "View.MemoryView":1302 + /* "View.MemoryView":1304 * _err_dim(ValueError, "Dimension %d is not direct", i) * * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< @@ -62865,7 +62948,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1304 + /* "View.MemoryView":1306 * if slices_overlap(&src, &dst, ndim, itemsize): * * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< @@ -62875,7 +62958,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1305 + /* "View.MemoryView":1307 * * if not slice_is_contig(src, order, ndim): * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<< @@ -62884,7 +62967,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim); - /* "View.MemoryView":1304 + /* "View.MemoryView":1306 * if slices_overlap(&src, &dst, ndim, itemsize): * * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< @@ -62893,17 +62976,17 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ } - /* "View.MemoryView":1307 + /* "View.MemoryView":1309 * order = get_best_order(&dst, ndim) * * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<< * src = tmp * */ - __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(2, 1307, __pyx_L1_error) + __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(2, 1309, __pyx_L1_error) __pyx_v_tmpdata = __pyx_t_7; - /* "View.MemoryView":1308 + /* "View.MemoryView":1310 * * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) * src = tmp # <<<<<<<<<<<<<< @@ -62912,7 +62995,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_src = __pyx_v_tmp; - /* "View.MemoryView":1302 + /* "View.MemoryView":1304 * _err_dim(ValueError, "Dimension %d is not direct", i) * * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< @@ -62921,7 +63004,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ } - /* "View.MemoryView":1310 + /* "View.MemoryView":1312 * src = tmp * * if not broadcasting: # <<<<<<<<<<<<<< @@ -62931,7 +63014,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1313 + /* "View.MemoryView":1315 * * * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< @@ -62941,7 +63024,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1314 + /* "View.MemoryView":1316 * * if slice_is_contig(src, 'C', ndim): * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<< @@ -62950,7 +63033,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim); - /* "View.MemoryView":1313 + /* "View.MemoryView":1315 * * * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< @@ -62960,7 +63043,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ goto __pyx_L12; } - /* "View.MemoryView":1315 + /* "View.MemoryView":1317 * if slice_is_contig(src, 'C', ndim): * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< @@ -62970,7 +63053,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0); if (__pyx_t_2) { - /* "View.MemoryView":1316 + /* "View.MemoryView":1318 * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<< @@ -62979,7 +63062,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim); - /* "View.MemoryView":1315 + /* "View.MemoryView":1317 * if slice_is_contig(src, 'C', ndim): * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< @@ -62989,7 +63072,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ } __pyx_L12:; - /* "View.MemoryView":1318 + /* "View.MemoryView":1320 * direct_copy = slice_is_contig(dst, 'F', ndim) * * if direct_copy: # <<<<<<<<<<<<<< @@ -62999,7 +63082,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_2 = (__pyx_v_direct_copy != 0); if (__pyx_t_2) { - /* "View.MemoryView":1320 + /* "View.MemoryView":1322 * if direct_copy: * * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< @@ -63008,7 +63091,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); - /* "View.MemoryView":1321 + /* "View.MemoryView":1323 * * refcount_copying(&dst, dtype_is_object, ndim, False) * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<< @@ -63017,7 +63100,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim))); - /* "View.MemoryView":1322 + /* "View.MemoryView":1324 * refcount_copying(&dst, dtype_is_object, ndim, False) * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< @@ -63026,7 +63109,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); - /* "View.MemoryView":1323 + /* "View.MemoryView":1325 * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) * refcount_copying(&dst, dtype_is_object, ndim, True) * free(tmpdata) # <<<<<<<<<<<<<< @@ -63035,7 +63118,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ free(__pyx_v_tmpdata); - /* "View.MemoryView":1324 + /* "View.MemoryView":1326 * refcount_copying(&dst, dtype_is_object, ndim, True) * free(tmpdata) * return 0 # <<<<<<<<<<<<<< @@ -63045,7 +63128,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_r = 0; goto __pyx_L0; - /* "View.MemoryView":1318 + /* "View.MemoryView":1320 * direct_copy = slice_is_contig(dst, 'F', ndim) * * if direct_copy: # <<<<<<<<<<<<<< @@ -63054,7 +63137,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ } - /* "View.MemoryView":1310 + /* "View.MemoryView":1312 * src = tmp * * if not broadcasting: # <<<<<<<<<<<<<< @@ -63063,7 +63146,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ } - /* "View.MemoryView":1326 + /* "View.MemoryView":1328 * return 0 * * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< @@ -63077,25 +63160,25 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_t_8 = (__pyx_t_2 != 0); if (__pyx_t_8) { - /* "View.MemoryView":1329 + /* "View.MemoryView":1331 * * * transpose_memslice(&src) # <<<<<<<<<<<<<< * transpose_memslice(&dst) * */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1329, __pyx_L1_error) + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1331, __pyx_L1_error) - /* "View.MemoryView":1330 + /* "View.MemoryView":1332 * * transpose_memslice(&src) * transpose_memslice(&dst) # <<<<<<<<<<<<<< * * refcount_copying(&dst, dtype_is_object, ndim, False) */ - __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1330, __pyx_L1_error) + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1332, __pyx_L1_error) - /* "View.MemoryView":1326 + /* "View.MemoryView":1328 * return 0 * * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< @@ -63104,7 +63187,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ } - /* "View.MemoryView":1332 + /* "View.MemoryView":1334 * transpose_memslice(&dst) * * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< @@ -63113,7 +63196,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); - /* "View.MemoryView":1333 + /* "View.MemoryView":1335 * * refcount_copying(&dst, dtype_is_object, ndim, False) * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<< @@ -63122,7 +63205,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize); - /* "View.MemoryView":1334 + /* "View.MemoryView":1336 * refcount_copying(&dst, dtype_is_object, ndim, False) * copy_strided_to_strided(&src, &dst, ndim, itemsize) * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< @@ -63131,7 +63214,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); - /* "View.MemoryView":1336 + /* "View.MemoryView":1338 * refcount_copying(&dst, dtype_is_object, ndim, True) * * free(tmpdata) # <<<<<<<<<<<<<< @@ -63140,7 +63223,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ */ free(__pyx_v_tmpdata); - /* "View.MemoryView":1337 + /* "View.MemoryView":1339 * * free(tmpdata) * return 0 # <<<<<<<<<<<<<< @@ -63150,7 +63233,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_r = 0; goto __pyx_L0; - /* "View.MemoryView":1268 + /* "View.MemoryView":1270 * * @cname('__pyx_memoryview_copy_contents') * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< @@ -63174,7 +63257,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ return __pyx_r; } -/* "View.MemoryView":1340 +/* "View.MemoryView":1342 * * @cname('__pyx_memoryview_broadcast_leading') * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< @@ -63189,7 +63272,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic int __pyx_t_2; int __pyx_t_3; - /* "View.MemoryView":1344 + /* "View.MemoryView":1346 * int ndim_other) nogil: * cdef int i * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<< @@ -63198,7 +63281,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic */ __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim); - /* "View.MemoryView":1346 + /* "View.MemoryView":1348 * cdef int offset = ndim_other - ndim * * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< @@ -63208,7 +63291,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { __pyx_v_i = __pyx_t_1; - /* "View.MemoryView":1347 + /* "View.MemoryView":1349 * * for i in range(ndim - 1, -1, -1): * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<< @@ -63217,7 +63300,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic */ (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]); - /* "View.MemoryView":1348 + /* "View.MemoryView":1350 * for i in range(ndim - 1, -1, -1): * mslice.shape[i + offset] = mslice.shape[i] * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<< @@ -63226,7 +63309,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic */ (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]); - /* "View.MemoryView":1349 + /* "View.MemoryView":1351 * mslice.shape[i + offset] = mslice.shape[i] * mslice.strides[i + offset] = mslice.strides[i] * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<< @@ -63236,7 +63319,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]); } - /* "View.MemoryView":1351 + /* "View.MemoryView":1353 * mslice.suboffsets[i + offset] = mslice.suboffsets[i] * * for i in range(offset): # <<<<<<<<<<<<<< @@ -63248,7 +63331,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "View.MemoryView":1352 + /* "View.MemoryView":1354 * * for i in range(offset): * mslice.shape[i] = 1 # <<<<<<<<<<<<<< @@ -63257,7 +63340,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic */ (__pyx_v_mslice->shape[__pyx_v_i]) = 1; - /* "View.MemoryView":1353 + /* "View.MemoryView":1355 * for i in range(offset): * mslice.shape[i] = 1 * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<< @@ -63266,7 +63349,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic */ (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]); - /* "View.MemoryView":1354 + /* "View.MemoryView":1356 * mslice.shape[i] = 1 * mslice.strides[i] = mslice.strides[0] * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< @@ -63276,7 +63359,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L; } - /* "View.MemoryView":1340 + /* "View.MemoryView":1342 * * @cname('__pyx_memoryview_broadcast_leading') * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< @@ -63287,7 +63370,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic /* function exit code */ } -/* "View.MemoryView":1362 +/* "View.MemoryView":1364 * * @cname('__pyx_memoryview_refcount_copying') * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< @@ -63298,7 +63381,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) { int __pyx_t_1; - /* "View.MemoryView":1366 + /* "View.MemoryView":1368 * * * if dtype_is_object: # <<<<<<<<<<<<<< @@ -63308,7 +63391,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i __pyx_t_1 = (__pyx_v_dtype_is_object != 0); if (__pyx_t_1) { - /* "View.MemoryView":1367 + /* "View.MemoryView":1369 * * if dtype_is_object: * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<< @@ -63317,7 +63400,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i */ __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc); - /* "View.MemoryView":1366 + /* "View.MemoryView":1368 * * * if dtype_is_object: # <<<<<<<<<<<<<< @@ -63326,7 +63409,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i */ } - /* "View.MemoryView":1362 + /* "View.MemoryView":1364 * * @cname('__pyx_memoryview_refcount_copying') * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< @@ -63337,7 +63420,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i /* function exit code */ } -/* "View.MemoryView":1371 +/* "View.MemoryView":1373 * * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< @@ -63352,7 +63435,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da #endif __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); - /* "View.MemoryView":1374 + /* "View.MemoryView":1376 * Py_ssize_t *strides, int ndim, * bint inc) with gil: * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<< @@ -63361,7 +63444,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da */ __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc); - /* "View.MemoryView":1371 + /* "View.MemoryView":1373 * * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< @@ -63376,7 +63459,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da #endif } -/* "View.MemoryView":1377 +/* "View.MemoryView":1379 * * @cname('__pyx_memoryview_refcount_objects_in_slice') * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< @@ -63393,7 +63476,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss int __pyx_t_4; __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0); - /* "View.MemoryView":1381 + /* "View.MemoryView":1383 * cdef Py_ssize_t i * * for i in range(shape[0]): # <<<<<<<<<<<<<< @@ -63405,7 +63488,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "View.MemoryView":1382 + /* "View.MemoryView":1384 * * for i in range(shape[0]): * if ndim == 1: # <<<<<<<<<<<<<< @@ -63415,7 +63498,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss __pyx_t_4 = ((__pyx_v_ndim == 1) != 0); if (__pyx_t_4) { - /* "View.MemoryView":1383 + /* "View.MemoryView":1385 * for i in range(shape[0]): * if ndim == 1: * if inc: # <<<<<<<<<<<<<< @@ -63425,7 +63508,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss __pyx_t_4 = (__pyx_v_inc != 0); if (__pyx_t_4) { - /* "View.MemoryView":1384 + /* "View.MemoryView":1386 * if ndim == 1: * if inc: * Py_INCREF(( data)[0]) # <<<<<<<<<<<<<< @@ -63434,7 +63517,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss */ Py_INCREF((((PyObject **)__pyx_v_data)[0])); - /* "View.MemoryView":1383 + /* "View.MemoryView":1385 * for i in range(shape[0]): * if ndim == 1: * if inc: # <<<<<<<<<<<<<< @@ -63444,7 +63527,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss goto __pyx_L6; } - /* "View.MemoryView":1386 + /* "View.MemoryView":1388 * Py_INCREF(( data)[0]) * else: * Py_DECREF(( data)[0]) # <<<<<<<<<<<<<< @@ -63456,7 +63539,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss } __pyx_L6:; - /* "View.MemoryView":1382 + /* "View.MemoryView":1384 * * for i in range(shape[0]): * if ndim == 1: # <<<<<<<<<<<<<< @@ -63466,7 +63549,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss goto __pyx_L5; } - /* "View.MemoryView":1388 + /* "View.MemoryView":1390 * Py_DECREF(( data)[0]) * else: * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< @@ -63475,7 +63558,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss */ /*else*/ { - /* "View.MemoryView":1389 + /* "View.MemoryView":1391 * else: * refcount_objects_in_slice(data, shape + 1, strides + 1, * ndim - 1, inc) # <<<<<<<<<<<<<< @@ -63486,7 +63569,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss } __pyx_L5:; - /* "View.MemoryView":1391 + /* "View.MemoryView":1393 * ndim - 1, inc) * * data += strides[0] # <<<<<<<<<<<<<< @@ -63496,7 +63579,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0])); } - /* "View.MemoryView":1377 + /* "View.MemoryView":1379 * * @cname('__pyx_memoryview_refcount_objects_in_slice') * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< @@ -63508,7 +63591,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss __Pyx_RefNannyFinishContext(); } -/* "View.MemoryView":1397 +/* "View.MemoryView":1399 * * @cname('__pyx_memoryview_slice_assign_scalar') * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< @@ -63518,7 +63601,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) { - /* "View.MemoryView":1400 + /* "View.MemoryView":1402 * size_t itemsize, void *item, * bint dtype_is_object) nogil: * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< @@ -63527,7 +63610,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst */ __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0); - /* "View.MemoryView":1401 + /* "View.MemoryView":1403 * bint dtype_is_object) nogil: * refcount_copying(dst, dtype_is_object, ndim, False) * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<< @@ -63536,7 +63619,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst */ __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item); - /* "View.MemoryView":1403 + /* "View.MemoryView":1405 * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, * itemsize, item) * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< @@ -63545,7 +63628,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst */ __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1); - /* "View.MemoryView":1397 + /* "View.MemoryView":1399 * * @cname('__pyx_memoryview_slice_assign_scalar') * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< @@ -63556,7 +63639,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst /* function exit code */ } -/* "View.MemoryView":1407 +/* "View.MemoryView":1409 * * @cname('__pyx_memoryview__slice_assign_scalar') * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< @@ -63573,7 +63656,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; - /* "View.MemoryView":1411 + /* "View.MemoryView":1413 * size_t itemsize, void *item) nogil: * cdef Py_ssize_t i * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<< @@ -63582,7 +63665,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t */ __pyx_v_stride = (__pyx_v_strides[0]); - /* "View.MemoryView":1412 + /* "View.MemoryView":1414 * cdef Py_ssize_t i * cdef Py_ssize_t stride = strides[0] * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<< @@ -63591,7 +63674,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t */ __pyx_v_extent = (__pyx_v_shape[0]); - /* "View.MemoryView":1414 + /* "View.MemoryView":1416 * cdef Py_ssize_t extent = shape[0] * * if ndim == 1: # <<<<<<<<<<<<<< @@ -63601,7 +63684,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); if (__pyx_t_1) { - /* "View.MemoryView":1415 + /* "View.MemoryView":1417 * * if ndim == 1: * for i in range(extent): # <<<<<<<<<<<<<< @@ -63613,7 +63696,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "View.MemoryView":1416 + /* "View.MemoryView":1418 * if ndim == 1: * for i in range(extent): * memcpy(data, item, itemsize) # <<<<<<<<<<<<<< @@ -63622,7 +63705,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t */ (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize)); - /* "View.MemoryView":1417 + /* "View.MemoryView":1419 * for i in range(extent): * memcpy(data, item, itemsize) * data += stride # <<<<<<<<<<<<<< @@ -63632,7 +63715,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t __pyx_v_data = (__pyx_v_data + __pyx_v_stride); } - /* "View.MemoryView":1414 + /* "View.MemoryView":1416 * cdef Py_ssize_t extent = shape[0] * * if ndim == 1: # <<<<<<<<<<<<<< @@ -63642,7 +63725,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t goto __pyx_L3; } - /* "View.MemoryView":1419 + /* "View.MemoryView":1421 * data += stride * else: * for i in range(extent): # <<<<<<<<<<<<<< @@ -63655,7 +63738,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "View.MemoryView":1420 + /* "View.MemoryView":1422 * else: * for i in range(extent): * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< @@ -63664,7 +63747,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t */ __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item); - /* "View.MemoryView":1422 + /* "View.MemoryView":1424 * _slice_assign_scalar(data, shape + 1, strides + 1, * ndim - 1, itemsize, item) * data += stride # <<<<<<<<<<<<<< @@ -63676,7 +63759,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t } __pyx_L3:; - /* "View.MemoryView":1407 + /* "View.MemoryView":1409 * * @cname('__pyx_memoryview__slice_assign_scalar') * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< @@ -63774,12 +63857,12 @@ static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSE PyObject *__pyx_v___pyx_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; + PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -63788,114 +63871,118 @@ static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSE /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result - * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<< + * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) */ - __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0); - if (__pyx_t_1) { + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__22, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { /* "(tree fragment)":5 * cdef object __pyx_result - * if __pyx_checksum != 0xb068931: + * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< - * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) * __pyx_result = Enum.__new__(__pyx_type) */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_2); - __pyx_v___pyx_PickleError = __pyx_t_2; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError); + __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v___pyx_PickleError = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "(tree fragment)":6 - * if __pyx_checksum != 0xb068931: + * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< * __pyx_result = Enum.__new__(__pyx_type) * if __pyx_state is not None: */ - __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_INCREF(__pyx_v___pyx_PickleError); - __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); + __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); + __Pyx_DECREF_SET(__pyx_t_1, function); } } - __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(2, 6, __pyx_L1_error) /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result - * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<< + * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) */ } /* "(tree fragment)":7 * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); + __Pyx_DECREF_SET(__pyx_t_1, function); } } - __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v___pyx_result = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v___pyx_type); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v___pyx_result = __pyx_t_4; + __pyx_t_4 = 0; /* "(tree fragment)":8 - * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) * __pyx_result = Enum.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) * return __pyx_result */ - __pyx_t_1 = (__pyx_v___pyx_state != Py_None); - __pyx_t_6 = (__pyx_t_1 != 0); - if (__pyx_t_6) { + __pyx_t_3 = (__pyx_v___pyx_state != Py_None); + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { /* "(tree fragment)":9 * __pyx_result = Enum.__new__(__pyx_type) @@ -63905,12 +63992,12 @@ static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSE * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error) - __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "(tree fragment)":8 - * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) * __pyx_result = Enum.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) @@ -63938,10 +64025,10 @@ static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSE /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -65117,7 +65204,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1}, {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0}, {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, - {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0}, + {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0}, {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0}, @@ -65258,12 +65345,12 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 900, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 3474, __pyx_L1_error) __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 945, __pyx_L1_error) - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 148, __pyx_L1_error) - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 151, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 149, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 152, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 2, __pyx_L1_error) - __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 404, __pyx_L1_error) - __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 613, __pyx_L1_error) - __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 832, __pyx_L1_error) + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 406, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 615, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 834, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -65284,7 +65371,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":945 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":945 * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -65295,7 +65382,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "../../anaconda3/envs/acv-dev/lib/python3.9/site-packages/numpy/__init__.pxd":951 + /* "../anaconda3/envs/acvpy310/lib/python3.10/site-packages/numpy/__init__.pxd":951 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -65306,58 +65393,58 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "View.MemoryView":133 + /* "View.MemoryView":134 * * if not self.ndim: * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< * * if itemsize <= 0: */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(2, 133, __pyx_L1_error) + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(2, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "View.MemoryView":136 + /* "View.MemoryView":137 * * if itemsize <= 0: * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< * * if not isinstance(format, bytes): */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 136, __pyx_L1_error) + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - /* "View.MemoryView":148 + /* "View.MemoryView":149 * * if not self._shape: * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< * * */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 148, __pyx_L1_error) + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - /* "View.MemoryView":176 + /* "View.MemoryView":177 * self.data = malloc(self.len) * if not self.data: * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< * * if self.dtype_is_object: */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 176, __pyx_L1_error) + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - /* "View.MemoryView":192 + /* "View.MemoryView":193 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * if not (flags & bufmode): * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< * info.buf = self.data * info.len = self.len */ - __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 192, __pyx_L1_error) + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); @@ -65380,58 +65467,58 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); - /* "View.MemoryView":418 + /* "View.MemoryView":420 * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<< * * have_slices, index = _unellipsify(index, self.view.ndim) */ - __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 418, __pyx_L1_error) + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); - /* "View.MemoryView":495 + /* "View.MemoryView":497 * result = struct.unpack(self.view.format, bytesitem) * except struct.error: * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< * else: * if len(self.view.format) == 1: */ - __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 495, __pyx_L1_error) + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); - /* "View.MemoryView":520 + /* "View.MemoryView":522 * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<< * * if flags & PyBUF_ND: */ - __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 520, __pyx_L1_error) + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); - /* "View.MemoryView":570 + /* "View.MemoryView":572 * if self.view.strides == NULL: * * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 570, __pyx_L1_error) + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); - /* "View.MemoryView":577 + /* "View.MemoryView":579 * def suboffsets(self): * if self.view.suboffsets == NULL: * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ - __pyx_tuple__15 = PyTuple_New(1); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 577, __pyx_L1_error) + __pyx_tuple__15 = PyTuple_New(1); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); @@ -65457,25 +65544,25 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); - /* "View.MemoryView":682 + /* "View.MemoryView":684 * if item is Ellipsis: * if not seen_ellipsis: * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< * seen_ellipsis = True * else: */ - __pyx_slice__18 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__18)) __PYX_ERR(2, 682, __pyx_L1_error) + __pyx_slice__18 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__18)) __PYX_ERR(2, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__18); __Pyx_GIVEREF(__pyx_slice__18); - /* "View.MemoryView":703 + /* "View.MemoryView":705 * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< * * */ - __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 703, __pyx_L1_error) + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 705, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); @@ -65497,6 +65584,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); + __pyx_tuple__22 = PyTuple_Pack(3, __pyx_int_184977713, __pyx_int_136983863, __pyx_int_112105877); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); /* "cyext_acv_nopa.pyx":449 * return np.array(sdp) @@ -65505,75 +65595,75 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * s = list(iterable) * return itertools.chain.from_iterable(itertools.combinations(s, r) for r in range(len(s) + 1)) */ - __pyx_tuple__22 = PyTuple_Pack(4, __pyx_n_s_iterable, __pyx_n_s_s, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 449, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); - __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_acv_explainers_cyext_acv_cyext_a, __pyx_n_s_powerset, 449, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_tuple__23 = PyTuple_Pack(4, __pyx_n_s_iterable, __pyx_n_s_s, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_acv_explainers_cyext_acv_cyext_a, __pyx_n_s_powerset, 449, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 449, __pyx_L1_error) - /* "View.MemoryView":286 + /* "View.MemoryView":287 * return self.name * * cdef generic = Enum("") # <<<<<<<<<<<<<< * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(2, 286, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); - /* "View.MemoryView":287 + /* "View.MemoryView":288 * * cdef generic = Enum("") * cdef strided = Enum("") # default # <<<<<<<<<<<<<< * cdef indirect = Enum("") * */ - __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); - /* "View.MemoryView":288 + /* "View.MemoryView":289 * cdef generic = Enum("") * cdef strided = Enum("") # default * cdef indirect = Enum("") # <<<<<<<<<<<<<< * * */ - __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); - /* "View.MemoryView":291 + /* "View.MemoryView":292 * * * cdef contiguous = Enum("") # <<<<<<<<<<<<<< * cdef indirect_contiguous = Enum("") * */ - __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 291, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(2, 292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); - /* "View.MemoryView":292 + /* "View.MemoryView":293 * * cdef contiguous = Enum("") * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< * * */ - __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(2, 292, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(2, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); /* "(tree fragment)":1 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ - __pyx_tuple__29 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(2, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); - __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(2, 1, __pyx_L1_error) + __pyx_tuple__30 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(2, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -65595,6 +65685,8 @@ if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_112105877 = PyInt_FromLong(112105877L); if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_136983863 = PyInt_FromLong(136983863L); if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; @@ -65664,21 +65756,21 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_ptype_14cyext_acv_nopa___pyx_scope_struct_1_genexpr = &__pyx_type_14cyext_acv_nopa___pyx_scope_struct_1_genexpr; __pyx_vtabptr_array = &__pyx_vtable_array; __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview; - if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 106, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type___pyx_array.tp_print = 0; #endif - if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 106, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 106, __pyx_L1_error) __pyx_array_type = &__pyx_type___pyx_array; - if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 279, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 280, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type___pyx_MemviewEnum.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 279, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 280, __pyx_L1_error) __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum; __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview; __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer; @@ -65688,30 +65780,30 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed; __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object; __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object; - if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 331, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type___pyx_memoryview.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 331, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 331, __pyx_L1_error) __pyx_memoryview_type = &__pyx_type___pyx_memoryview; __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; - if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error) + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 967, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type___pyx_memoryviewslice.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 967, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 967, __pyx_L1_error) __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; __Pyx_RefNannyFinishContext(); return 0; @@ -66086,90 +66178,90 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":209 + /* "View.MemoryView":210 * info.obj = self * * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< * * def __dealloc__(array self): */ - __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 209, __pyx_L1_error) + __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 209, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 210, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_array_type); - /* "View.MemoryView":286 + /* "View.MemoryView":287 * return self.name * * cdef generic = Enum("") # <<<<<<<<<<<<<< * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 286, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(generic); __Pyx_DECREF_SET(generic, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":287 + /* "View.MemoryView":288 * * cdef generic = Enum("") * cdef strided = Enum("") # default # <<<<<<<<<<<<<< * cdef indirect = Enum("") * */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 287, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(strided); __Pyx_DECREF_SET(strided, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":288 + /* "View.MemoryView":289 * cdef generic = Enum("") * cdef strided = Enum("") # default * cdef indirect = Enum("") # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 288, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(indirect); __Pyx_DECREF_SET(indirect, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":291 + /* "View.MemoryView":292 * * * cdef contiguous = Enum("") # <<<<<<<<<<<<<< * cdef indirect_contiguous = Enum("") * */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 291, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(contiguous); __Pyx_DECREF_SET(contiguous, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":292 + /* "View.MemoryView":293 * * cdef contiguous = Enum("") * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 292, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(indirect_contiguous); __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "View.MemoryView":316 + /* "View.MemoryView":317 * * DEF THREAD_LOCKS_PREALLOCATED = 8 * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<< @@ -66178,7 +66270,7 @@ if (!__Pyx_RefNanny) { */ __pyx_memoryview_thread_locks_used = 0; - /* "View.MemoryView":317 + /* "View.MemoryView":318 * DEF THREAD_LOCKS_PREALLOCATED = 8 * cdef int __pyx_memoryview_thread_locks_used = 0 * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<< @@ -66195,29 +66287,29 @@ if (!__Pyx_RefNanny) { __pyx_t_3[7] = PyThread_allocate_lock(); memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3, sizeof(__pyx_memoryview_thread_locks[0]) * (8)); - /* "View.MemoryView":549 + /* "View.MemoryView":551 * info.obj = self * * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 549, __pyx_L1_error) + __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 549, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 551, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_memoryview_type); - /* "View.MemoryView":995 + /* "View.MemoryView":997 * return self.from_object * * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 995, __pyx_L1_error) + __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 997, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 995, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 997, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_memoryviewslice_type); @@ -66678,7 +66770,7 @@ __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview, static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN { va_list vargs; char msg[200]; -#ifdef HAVE_STDARG_PROTOTYPES +#if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES) va_start(vargs, fmt); #else va_start(vargs); @@ -67520,7 +67612,7 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq return (equals == Py_EQ); } else { int result; -#if CYTHON_USE_UNICODE_INTERNALS +#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; @@ -68252,17 +68344,35 @@ static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; + PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; + PyObject *getstate = NULL; +#if CYTHON_USE_PYTYPE_LOOKUP + getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); +#else + getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); + if (!getstate && PyErr_Occurred()) { + goto __PYX_BAD; + } +#endif + if (getstate) { #if CYTHON_USE_PYTYPE_LOOKUP - if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; + object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); #else - if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; + object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); + if (!object_getstate && PyErr_Occurred()) { + goto __PYX_BAD; + } #endif + if (object_getstate != getstate) { + goto __PYX_GOOD; + } + } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else @@ -68307,6 +68417,8 @@ static int __Pyx_setup_reduce(PyObject* type_obj) { #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); + Py_XDECREF(object_getstate); + Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); @@ -68503,6 +68615,12 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { #include "compile.h" #include "frameobject.h" #include "traceback.h" +#if PY_VERSION_HEX >= 0x030b00a6 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { @@ -68566,14 +68684,24 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); - if (!py_code) goto bad; + if (!py_code) { + /* If the code object creation fails, then we should clear the + fetched exception references and propagate the new exception */ + Py_XDECREF(ptype); + Py_XDECREF(pvalue); + Py_XDECREF(ptraceback); + goto bad; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( @@ -71807,6 +71935,12 @@ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name /* CoroutineBase */ #include #include +#if PY_VERSION_HEX >= 0x030b00a6 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) { PyObject *et, *ev, *tb; @@ -72794,11 +72928,33 @@ static int __pyx_Generator_init(void) { /* CheckBinaryVersion */ static int __Pyx_check_binary_version(void) { - char ctversion[4], rtversion[4]; - PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); - PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); - if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char ctversion[5]; + int same=1, i, found_dot; + const char* rt_from_call = Py_GetVersion(); + PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + found_dot = 0; + for (i = 0; i < 4; i++) { + if (!ctversion[i]) { + same = (rt_from_call[i] < '0' || rt_from_call[i] > '9'); + break; + } + if (rt_from_call[i] != ctversion[i]) { + same = 0; + break; + } + } + if (!same) { + char rtversion[5] = {'\0'}; char message[200]; + for (i=0; i<4; ++i) { + if (rt_from_call[i] == '.') { + if (found_dot) break; + found_dot = 1; + } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') { + break; + } + rtversion[i] = rt_from_call[i]; + } PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", diff --git a/acv_explainers/utils.py b/acv_explainers/utils.py index f5c9f07..8961492 100644 --- a/acv_explainers/utils.py +++ b/acv_explainers/utils.py @@ -15,7 +15,19 @@ from sklearn.preprocessing import OrdinalEncoder # from bigholes import HoleFinder from tqdm import tqdm +from tqdm import tqdm +from numpy.random import rand +from numpy.random import seed +import acv_explainers +import numpy as np +from sklearn.linear_model import LogisticRegression +from lightgbm import LGBMClassifier +from sklearn.ensemble import IsolationForest +import pickle + +import warnings +warnings.filterwarnings('ignore') def plot_feature_importance(importance, names, model_type, xlabel='SHAP values', title=' '): @@ -1290,7 +1302,6 @@ def return_edges(list_rec): def mc_approx_rules(rules, rules_data, S_star, strategy='random', maxitr=1000, interiorOnly=False, threshold=None, verbose=False): - # strategy = 'random' # or 'even' or 'sequential' # maxitr = 1000 # how many queries to do since last best found before satisfied # whether to consider only rectangles that are bounded on all sides by points rather than limits of the space @@ -1321,3 +1332,857 @@ def mc_approx_rules(rules, rules_data, S_star, strategy='random', maxitr=1000, i approx_rec[a, S_star[a], 1] = hallOfFame[-1].U return approx_rec + +def return_xy_cnt(x, y_target, S_bar_set, x_train, y_train, w): + """ + return the observations with y=y_target that fall in the projected leaf of x + when we condition given S=S_bar of x. + """ + + x_train_cnt = [] + for i, wi in enumerate(w): + if wi != 0 and y_train[i] == y_target: + x_train_cnt.append(x_train[i].copy()) + + if len(x_train_cnt) == 0: + x_train_cnt = np.array(x).reshape(1, -1) + y_train_cnt = np.array(y_target).reshape(1, -1) + else: + x_train_cnt = np.array(x_train_cnt) + # x_train_cnt[:, S_bar_set] = x[S_bar_set] + y_train_cnt = np.array(x_train_cnt.shape[0] * [y_target]) + + return x_train_cnt, y_train_cnt + + +def return_leaf_cnt(ac_explainer, S_star, x_train_cnt, y_train_cnt, x_train, y_train, pi=0.9): + """ + return the original leaves of the observations with y=y_target that fall in the projected leaf + when we condition given S=S_bar of x. + """ + sdp, rules = ac_explainer.compute_sdp_rule(x_train_cnt, y_train_cnt, + x_train, y_train, + x_train_cnt.shape[0] * [list(range(x_train.shape[1]))] + ) + if np.sum(sdp >= pi) != 0: + rules_unique = np.unique(rules[sdp >= pi], axis=0) + else: + rules_unique = np.expand_dims(rules[np.argmax(sdp)], axis=0) + + r_buf = rules_unique.copy() + for i in range(rules_unique.shape[0]): + list_ric = [r.copy() for r in r_buf if not np.allclose(r, rules_unique[i])] + find_union(rules_unique[i], list_ric, S=S_star) + + return rules_unique + + +def remove_in(ra): + """ + remove A if A subset of B in the list of compatible leaves + """ + for i in range(ra.shape[0]): + for j in range(ra.shape[0]): + if i != j and np.prod([(ra[i, s, 1] <= ra[j, s, 1]) * (ra[i, s, 0] >= ra[j, s, 0]) + for s in range(ra.shape[1])], axis=0).astype(bool): + ra[i] = ra[j] + return np.unique(ra, axis=0) + + +def get_compatible_leaf(acvtree, x, y_target, S_star, S_bar_set, w, x_train, y_train, pi=0.9, acc_level=0.9): + """ + Compute the compatible leaves and order given their accuracy + """ + x_train_cnt, y_train_cnt = return_xy_cnt(x, y_target, S_bar_set, x_train, y_train, w) + + compatible_leaves = return_leaf_cnt(acvtree, S_star, x_train_cnt, y_train_cnt, x_train, y_train, pi) + compatible_leaves = np.unique(compatible_leaves, axis=0) + compatible_leaves = remove_in(compatible_leaves) + # compatible_leaves = np.rint(compatible_leaves) + compatible_leaves = np.round(compatible_leaves, 2) + + partition_leaf = compatible_leaves.copy() + d = partition_leaf.shape[1] + nb_leaf = partition_leaf.shape[0] + leaves_acc = [] + suf_leaf = [] + + for i in range(nb_leaf): + x_in = np.prod([(x_train[:, s] <= partition_leaf[i, s, 1]) * (x_train[:, s] > partition_leaf[i, s, 0]) + for s in range(d)], axis=0).astype(bool) + y_in = y_train[x_in] + acc = np.mean(y_in == y_target) + + leaves_acc.append(acc) + + if acc >= acc_level: + suf_leaf.append(partition_leaf[i]) + + best_id = np.argmax(leaves_acc) + + return suf_leaf, partition_leaf, leaves_acc, partition_leaf[best_id], leaves_acc[best_id] + + +def return_counterfactuals(ac_explainer, suf_leaf, S_star, S_bar_set, x, y, x_train, y_train, pi_level): + """ + Compute the SDP of each C_S and return the ones that has sdp >= pi_level + """ + counterfactuals = [] + counterfactuals_sdp = [] + counterfactuals_w = [] + + for leaf in suf_leaf: + + cond = np.ones(shape=(1, x_train.shape[1], 2)) + cond[:, :, 0] = -1e+10 + cond[:, :, 1] = 1e+10 + + for s in S_bar_set: + cond[:, s, 0] = x[:, s] + cond[:, s, 1] = x[:, s] + + cond[:, S_star] = leaf[S_star] + sdp, w = ac_explainer.compute_ddp_cond_weights(x, y, x_train, y_train, S=[S_bar_set], cond=cond, + pi_level=pi_level) + if sdp >= pi_level: + counterfactuals.append(cond) + counterfactuals_sdp.append(sdp) + counterfactuals_w.append(w) + + return np.unique(counterfactuals, axis=0), np.unique(counterfactuals_sdp, axis=0), \ + np.unique(counterfactuals_w, axis=0) + + +def return_global_counterfactuals(ac_explainer, data, y_data, s_star, n_star, x_train, y_train, w, acc_level, pi_level): + """ + stack all to compute the C_S for each observations + """ + N = data.shape[0] + suf_leaves = [] + counterfactuals_samples = [] + counterfactuals_samples_sdp = [] + counterfactuals_samples_w = [] + + for i in tqdm(range(N)): + suf_leaf, _, _, _, _ = get_compatible_leaf(ac_explainer, data[i], 1 - y_data[i], s_star[i], n_star[i], w[i], + x_train, y_train, pi=pi_level, acc_level=acc_level) + suf_leaves.append(suf_leaf) + # print(suf_leaf) + # print(np.unique(suf_leaf, axis=0).shape, len(suf_leaf)) + counterfactuals, counterfactuals_sdp, w_cond = \ + return_counterfactuals(ac_explainer, suf_leaf, s_star[i], n_star[i], data[i].reshape(1, -1), + y_data[i].reshape(1, -1), x_train, y_train, pi_level) + + counterfactuals_samples.append(counterfactuals) + counterfactuals_samples_sdp.append(counterfactuals_sdp) + counterfactuals_samples_w.append(w_cond) + + return counterfactuals_samples, counterfactuals_samples_sdp, counterfactuals_samples_w + + +# Fonction global explanations + +def return_ge_counterfactuals(ac_explainer, suf_leaf, S_star, S_bar_set, x, y, x_train, y_train, cond_s, pi_level): + counterfactuals = [] + counterfactuals_sdp = [] + counterfactuals_w = [] + + for leaf in suf_leaf: + + cond = cond_s.copy() + cond[:, S_star] = leaf[S_star] + + sdp, w = ac_explainer.compute_ddp_cond_weights(x, y, x_train, y_train, S=[[-6]], cond=cond) + if sdp >= pi_level: + counterfactuals.append(cond) + counterfactuals_sdp.append(sdp) + counterfactuals_w.append(w) + + return counterfactuals, counterfactuals_sdp, counterfactuals_w + + +def return_ge_global_counterfactuals(ac_explainer, data, y_data, s_star, n_star, x_train, y_train, w, acc_level, cond, + pi_level): + N = data.shape[0] + suf_leaves = [] + counterfactuals_samples = [] + counterfactuals_samples_sdp = [] + counterfactuals_samples_w = [] + + for i in tqdm(range(N)): + suf_leaf, _, _, _, _ = get_compatible_leaf(ac_explainer, data[i], 1 - y_data[i], s_star[i], n_star[i], w[i], + x_train, y_train, pi=pi_level, acc_level=acc_level) + suf_leaves.append(suf_leaf) + + counterfactuals, counterfactuals_sdp, w_cond = return_ge_counterfactuals(ac_explainer, suf_leaf, s_star[i], + n_star[i], + data[i].reshape(1, -1), + y_data[i].reshape(1, -1), x_train, + y_train, + np.expand_dims(cond[i], 0), + pi_level) + counterfactuals_samples.append(counterfactuals) + counterfactuals_samples_sdp.append(counterfactuals_sdp) + counterfactuals_samples_w.append(w_cond) + + return counterfactuals_samples, counterfactuals_samples_sdp, counterfactuals_samples_w + + +def print_rule(col_name, r, decision=None, sdp=True, output=None): + for i, col in enumerate(col_name): + if not ((r[i, 0] <= -1e+10 and r[i, 1] >= 1e+10)): + print('If {} in [{}, {}] and '.format(col, r[i, 0], r[i, 1])) + print(' ') + + if sdp == True: + print('Then the output is = {}'.format(output)) + print('SDP Probability = {}'.format(decision)) + else: + print('Then the output is different from {}'.format(output)) + print('Counterfactual DDP Probability = {}'.format(decision)) + + +def generate_candidate(x, S, x_train, cond, n_iterations): + x_poss = [x_train[(cond[i, 0] <= x_train[:, i]) * (x_train[:, i] <= cond[i, 1]), i] for i in S] + + x_cand = np.repeat(x.reshape(1, -1), repeats=n_iterations, axis=0) + for i in range(len(S)): + rdm_id = np.random.randint(0, x_poss[i].shape[0], n_iterations) + x_cand[:, S[i]] = x_poss[i][rdm_id] + + return x_cand + + +def simulated_annealing(outlier_score, x, S, x_train, cond, batch, max_iter, temp, + max_iter_convergence=10): + """ + Generate sample s.t. (X | X_S \in cond) using simulated annealing and outlier score. + Args: + outlier_score (lambda functon): outlier_score(X) return a outlier score. If the value are negative, then the observation is an outlier. + x (numpy.ndarray)): 1-D array, an observation + S (list): contains the indices of the variables on which to condition + x_train (numpy.ndarray)): 2-D array represent the training samples + cond (numpy.ndarray)): 3-D (#variables x 2 x 1) representing the hyper-rectangle on which to condition + batch (int): number of sample by iteration + max_iter (int): number of iteration of the algorithm + temp (double): the temperature of the simulated annealing algorithm + max_iter_convergence (double): minimun number of iteration to stop the algorithm if it find an in-distribution observation + + Returns: + The generated sample, and its outlier score + """ + best = generate_candidate(x, S, x_train, cond, 1) + best_eval = outlier_score(best)[0] + curr, curr_eval = best, best_eval + + move = 0 + for i in range(max_iter): + + x_cand = generate_candidate(curr, S, x_train, cond, batch) + score_candidates = outlier_score(x_cand) + + candidate_eval = np.max(score_candidates) + candidate = x_cand[np.argmax(score_candidates)] + + if candidate_eval > best_eval: + best, best_eval = candidate, candidate_eval + move = 0 + else: + move += 1 + + # check convergence + if best_eval > 0 and move > max_iter_convergence: + break + + diff = candidate_eval - curr_eval + t = temp / np.log(float(i + 1)) + metropolis = np.exp(-diff / t) + + if diff > 0 or rand() < metropolis: + curr, curr_eval = candidate, candidate_eval + + return best, best_eval + + +dataset = 'none' + + +def save_model(model, name='{}'.format(dataset)): + with open('{}.pickle'.format(name), 'wb') as f: + pickle.dump(model, f) + + +def load_model(name='{}'.format(dataset)): + with open('{}.pickle'.format(name), 'rb') as f: + loaded_obj = pickle.load(f) + return loaded_obj + + +class RunExperiments: + + def __init__(self, acv_explainer, x_train, x_test, y_train, y_test, columns_name, model=None): + self.model = None + self.columns_name = columns_name + self.acv_explainer = acv_explainer + self.x_train = x_train + self.x_test = x_test + self.y_train = y_train + self.y_test = y_test + self.ddp_importance_local, self.ddp_index_local, self.size_local, self.ddp_local = None, None, None, None + self.S_star_local, self.S_bar_set_local = None, None + self.ddp_local, self.w_local = None, None + self.counterfactuals_samples_local, self.counterfactuals_samples_sdp_local, \ + self.counterfactuals_samples_w_local = None, None, None + self.isolation = None, None + self.dist_local = None + self.score_local = None + self.errs_local = None + self.errs_local_original = None + self.accuracy_local = None + self.accuracy_local_original = None + self.coverage_local = None + self.sdp_importance_se, self.sdp_index_se, self.size_se, self.sdp_se = None, None, None, None + self.S_star_se, self.N_star_se = None, None + self.sdp_rules, self.rules, self.sdp_all, self.rules_data, self.w_rules = None, None, None, None, None + + self.ddp_importance_regional, self.ddp_index_regional, self.size_regional, self.ddp_regional = None, None, None, None + self.S_star_regional, self.S_bar_set_regional = None, None + self.counterfactuals_samples_regional, self.counterfactuals_samples_sdp_regional, \ + self.counterfactuals_samples_w_regional = None, None, None + self.dist_regional = None + self.score_regional = None + self.errs_regional = None + self.errs_regional_original = None + self.accuracy_regional = None + self.accuracy_regional_original = None + self.coverage_regional = None + + def run_local_divergent_set(self, x, y, t=20, stop=True, pi_level=0.8): + print('### Computing the local divergent set of (x, y)') + + self.ddp_importance_local, self.ddp_index_local, self.size_local, self.ddp_local = \ + self.acv_explainer.importance_ddp_rf(x, y, self.x_train, self.y_train, t=t, + stop=stop, pi_level=pi_level) + + self.S_star_local, self.S_bar_set_local = \ + acv_explainers.utils.get_active_null_coalition_list(self.ddp_index_local, self.size_local) + self.ddp_local, self.w_local = self.acv_explainer.compute_ddp_weights(x, y, self.x_train, self.y_train, + S=self.S_bar_set_local) + + def run_local_counterfactual_rules(self, x, y, acc_level=0.8, pi_level=0.8): + print('### Computing the local counterfactual rules of (x, y)') + + self.counterfactuals_samples_local, self.counterfactuals_samples_sdp_local, \ + self.counterfactuals_samples_w_local = return_global_counterfactuals(self.acv_explainer, x, y, + self.S_star_local, self.S_bar_set_local, + self.x_train, self.y_train, self.w_local, + acc_level=acc_level, + pi_level=pi_level) + + def run_sampling_local_counterfactuals(self, x, y, batch=1000, max_iter=1000, temp=0.5): + print('### Sampling using the local counterfactual rules of (x, y)') + + self.isolation = IsolationForest() + self.isolation.fit(self.x_train) + outlier_score = lambda x: self.isolation.decision_function(x) + + self.dist_local = [] + self.score_local = [] + self.errs_local = [] + self.errs_local_original = [] + for i in tqdm(range(x.shape[0])): + if len(self.counterfactuals_samples_local[i]) != 0: + a, sco = simulated_annealing(outlier_score, x[i], self.S_star_local[i], self.x_train, + self.counterfactuals_samples_local[i][ + np.argmax(self.counterfactuals_samples_sdp_local[i])][0], + batch, max_iter, temp) + self.dist_local.append(np.squeeze(a)) + self.score_local.append(sco) + self.errs_local.append( + self.acv_explainer.predict(self.dist_local[-1].reshape(1, -1)) != self.acv_explainer.predict( + x[i].reshape(1, -1))) + if self.model != None: + self.errs_local_original.append( + self.model.predict(self.dist_local[-1].reshape(1, -1)) != self.model.predict( + x[i].reshape(1, -1))) + + self.accuracy_local = np.mean(self.errs_local) + self.accuracy_local_original = np.mean(self.errs_local_original) + self.coverage_local = len(self.errs_local) / x.shape[0] + + def run_sufficient_rules(self, x_rule, y_rule, pi_level=0.9): + print('### Computing the Sufficient Explanations and the Sufficient Rules') + self.x_rules, self.y_rules = x_rule, y_rule + self.sdp_importance_se, self.sdp_index_se, self.size_se, self.sdp_se = \ + self.acv_explainer.importance_sdp_rf(x_rule, y_rule, + self.x_train, self.y_train, + stop=False, + pi_level=pi_level) + + self.S_star_se, self.N_star_se = get_active_null_coalition_list(self.sdp_index_se, self.size_se) + self.sdp_rules, self.rules, self.sdp_all, self.rules_data, self.w_rules = self.acv_explainer.compute_sdp_maxrules( + x_rule, y_rule, + self.x_train, self.y_train, self.S_star_se, verbose=True) + + def run_regional_divergent_set(self, stop=True, pi_level=0.8): + print('### Computing the regional divergent set of (x, y)') + + self.ddp_importance_regional, self.ddp_index_regional, self.size_regional, self.ddp_regional = \ + self.acv_explainer.importance_ddp_intv(self.x_rules, self.y_rules, + self.x_train, self.y_train, + self.rules, + stop=stop, + pi_level=pi_level) + + self.S_star_regional, self.S_bar_set_regional = \ + acv_explainers.utils.get_active_null_coalition_list(self.ddp_index_regional, self.size_regional) + self.ddp_regional, self.w_regional = self.acv_explainer.compute_ddp_weights(self.x_rules, self.y_rules, + self.x_train, self.y_train, + S=self.S_bar_set_regional) + + def run_regional_counterfactual_rules(self, acc_level=0.8, pi_level=0.8): + print('### Computing the regional counterfactual rules of (x, y)') + + self.counterfactuals_samples_regional, self.counterfactuals_samples_sdp_regional, \ + self.counterfactuals_samples_w_regional = \ + return_ge_global_counterfactuals(self.acv_explainer, self.x_rules, self.y_rules, + self.S_star_regional, self.S_bar_set_regional, + self.x_train, self.y_train, self.w_regional, acc_level, self.rules, + pi_level) + + def run_sampling_regional_counterfactuals(self, max_obs=2, batch=1000, max_iter=1000, temp=0.5): + print('### Sampling using the regional counterfactual rules') + + outlier_score = lambda x: self.isolation.decision_function(x) + + self.dist_regional = [] + self.score_regional = [] + self.errs_regional = [] + self.errs_regional_original = [] + nb = 0 + for i in range(self.x_rules.shape[0]): + if len(self.counterfactuals_samples_regional[i]) != 0: + x_in = np.prod([(self.x_test[:, s] <= self.rules[i, s, 1]) * (self.x_test[:, s] > self.rules[i, s, 0]) + for s in range(self.x_train.shape[1])], axis=0).astype(bool) + nb += np.sum(x_in) if np.sum(x_in) <= max_obs else max_obs + print('observations in rule = {}'.format(np.sum(x_in))) + if np.sum(x_in) > 0: + for xi in tqdm(self.x_test[x_in][:max_obs]): + a, sco = simulated_annealing(outlier_score, xi, self.S_star_regional[i], self.x_train, + self.counterfactuals_samples_regional[i][ + np.argmax(self.counterfactuals_samples_sdp_regional[i])][0], + batch, max_iter, temp) + self.dist_regional.append(np.squeeze(a)) + self.score_regional.append(sco) + self.errs_regional.append(self.acv_explainer.predict( + self.dist_regional[-1].reshape(1, -1)) != self.acv_explainer.predict(xi.reshape(1, -1))) + if self.model != None: + self.errs_regional_original.append(self.model.predict( + self.dist_regional[-1].reshape(1, -1)) != self.model.predict(xi.reshape(1, -1))) + + self.accuracy_regional = np.mean(self.errs_regional) + self.accuracy_regional_original = np.mean(self.errs_regional_original) + self.coverage_regional = len(self.errs_regional) / nb + + def run_sampling_regional_counterfactuals_alltests(self, max_obs=2, batch=1000, max_iter=1000, temp=0.5): + print('### Sampling using the regional counterfactual rules') + + outlier_score = lambda x: self.isolation.decision_function(x) + + self.dist_regional = [] + self.score_regional = [] + self.errs_regional = [] + self.errs_regional_original = [] + x_test_pb = [] + + for i in range(self.x_rules.shape[0]): + x_in = np.prod([(self.x_test[:, s] <= self.rules[i, s, 1]) * (self.x_test[:, s] > self.rules[i, s, 0]) + for s in range(self.x_train.shape[1])], axis=0) + if len(self.counterfactuals_samples_regional[i]) != 0: + x_in = np.max(self.counterfactuals_samples_sdp_regional[i]) * x_in + else: + x_in = 0 * x_in + x_test_pb.append(x_in) + + x_test_pb = np.array(x_test_pb) + best_counterfactuals = np.argmax(x_test_pb, axis=0) + + for i in tqdm(range(self.x_test.shape[0])): + xi = self.x_test[i] + best_id = best_counterfactuals[i] + if len(self.counterfactuals_samples_regional[best_id]) != 0: + a, sco = simulated_annealing(outlier_score, xi, self.S_star_regional[best_id], self.x_train, + self.counterfactuals_samples_regional[best_id][ + np.argmax(self.counterfactuals_samples_sdp_regional[best_id])][0], + batch, max_iter, temp) + self.dist_regional.append(np.squeeze(a)) + self.score_regional.append(sco) + self.errs_regional.append(self.acv_explainer.predict( + self.dist_regional[-1].reshape(1, -1)) != self.acv_explainer.predict(xi.reshape(1, -1))) + + if self.model != None: + self.errs_regional_original.append(self.model.predict( + self.dist_regional[-1].reshape(1, -1)) != self.model.predict(xi.reshape(1, -1))) + + self.accuracy_regional = np.mean(self.errs_regional) + self.accuracy_regional_original = np.mean(self.errs_regional_original) + self.coverage_regional = len(self.errs_regional) / self.x_test.shape[0] + + def show_global_counterfactuals(self): + + for idt in range(self.rules.shape[0]): + print('Example {}'.format(idt)) + r = self.rules[idt] + + print_rule(self.columns_name, r, self.sdp_rules[idt], True, self.y_rules[idt]) + + print(' ') + print(' ') + print(' ') + for l in range(len(self.counterfactuals_samples_sdp_regional[idt])): + print('Example {} - Counterfactual {}'.format(idt, l)) + print_rule(self.columns_name, self.counterfactuals_samples_regional[idt][l][0], + self.counterfactuals_samples_sdp_regional[idt][l], False, False) + print(' ') + print(' ') + + def show_local_counterfactuals(self, x, y): + + for idt in range(x.shape[0]): + print(self.columns_name) + print('Example {} = {}'.format(idt, x[idt])) + + print(' ') + print(' ') + print(' ') + for l in range(len(self.counterfactuals_samples_sdp_local[idt])): + print('Example {} - Counterfactual {}'.format(idt, l)) + print_rule(self.columns_name, self.counterfactuals_samples_local[idt][l][0], + self.counterfactuals_samples_sdp_local[idt][l], False, False) + print(' ') + print(' ') + + +def return_xy_cnt_reg(x, y_target, down, up, S_bar_set, x_train, y_train, w): + """ + return the observations with y=y_target that fall in the projected leaf of x + when we condition given S=S_bar of x. + """ + + x_train_cnt = [] + y_train_cnt = [] + for i, wi in enumerate(w): + if wi != 0 and down <= y_train[i] <= up: + x_train_cnt.append(x_train[i].copy()) + y_train_cnt.append(y_train[i].copy()) + + x_train_cnt = np.array(x_train_cnt) + y_train_cnt = np.array(y_train_cnt) + + return x_train_cnt, y_train_cnt + + +def return_leaf_cnt_reg(ac_explainer, S_star, x_train_cnt, y_train_cnt, down, up, x_train, y_train, pi): + """ + return the original leaves of the observations with y=y_target that fall in the projected leaf + when we condition given S=S_bar of x. + """ + size = x_train_cnt.shape[0] + sdp, rules = ac_explainer.compute_cdp_rule(x_train_cnt, y_train_cnt, np.array(size * [down]), np.array(size * [up]), + x_train, y_train, + size * [list(range(x_train.shape[1]))] + ) + # print(sdp) + if np.sum(sdp >= pi) != 0: + rules_unique = np.unique(rules[sdp >= pi], axis=0) + else: + rules_unique = np.expand_dims(rules[np.argmax(sdp)], axis=0) + + r_buf = rules_unique.copy() + for i in range(rules_unique.shape[0]): + list_ric = [r.copy() for r in r_buf if not np.allclose(r, rules_unique[i])] + find_union(rules_unique[i], list_ric, S=S_star) + + return rules_unique + + +def remove_in(ra): + """ + remove A if A subset of B in the list of compatible leaves + """ + for i in range(ra.shape[0]): + for j in range(ra.shape[0]): + if i != j and np.prod([(ra[i, s, 1] <= ra[j, s, 1]) * (ra[i, s, 0] >= ra[j, s, 0]) + for s in range(ra.shape[1])], axis=0).astype(bool): + ra[i] = ra[j] + return np.unique(ra, axis=0) + + +def get_compatible_leaf_reg(acvtree, x, y_target, down, up, S_star, S_bar_set, w, x_train, y_train, pi, acc_level): + """ + Compute the compatible leaves and order given their accuracy + """ + x_train_cnt, y_train_cnt = return_xy_cnt_reg(x, y_target, down, up, S_bar_set, x_train, y_train, w) + compatible_leaves = return_leaf_cnt_reg(acvtree, S_star, x_train_cnt, y_train_cnt, down, up, x_train, y_train, pi) + compatible_leaves = np.unique(compatible_leaves, axis=0) + compatible_leaves = remove_in(compatible_leaves) + compatible_leaves = np.round(compatible_leaves, 2) + + partition_leaf = compatible_leaves.copy() + d = partition_leaf.shape[1] + nb_leaf = partition_leaf.shape[0] + leaves_acc = [] + suf_leaf = [] + + for i in range(nb_leaf): + x_in = np.prod([(x_train[:, s] <= partition_leaf[i, s, 1]) * (x_train[:, s] > partition_leaf[i, s, 0]) + for s in range(d)], axis=0).astype(bool) + + y_in = y_train[x_in] + acc = np.mean((down <= y_in) * (y_in <= up)) + leaves_acc.append(acc) + + if acc >= acc_level: + suf_leaf.append(partition_leaf[i]) + + best_id = np.argmax(leaves_acc) + return suf_leaf, partition_leaf, leaves_acc, partition_leaf[best_id], leaves_acc[best_id] + + +def return_counterfactuals_reg(ac_explainer, suf_leaf, S_star, S_bar_set, x, y, down, up, x_train, y_train, pi_level): + """ + Compute the SDP of each C_S and return the ones that has sdp >= pi_level + """ + counterfactuals = [] + counterfactuals_sdp = [] + counterfactuals_w = [] + + for leaf in suf_leaf: + + cond = np.ones(shape=(1, x_train.shape[1], 2)) + cond[:, :, 0] = -1e+10 + cond[:, :, 1] = 1e+10 + + for s in S_bar_set: + cond[:, s, 0] = x[:, s] + cond[:, s, 1] = x[:, s] + + cond[:, S_star] = leaf[S_star] + + size = x.shape[0] + sdp, w = ac_explainer.compute_cdp_cond_weights(x, y, np.array(size * [down]), np.array(size * [up]), x_train, + y_train, S=[S_bar_set], cond=cond, + pi_level=pi_level) + # print(sdp) + if sdp >= pi_level: + counterfactuals.append(cond) + counterfactuals_sdp.append(sdp) + counterfactuals_w.append(w) + + return np.unique(counterfactuals, axis=0), np.unique(counterfactuals_sdp, axis=0), \ + np.unique(counterfactuals_w, axis=0) + + +def return_global_counterfactuals_reg(ac_explainer, data, y_data, down, up, s_star, n_star, x_train, y_train, w, + acc_level, pi_level): + """ + stack all to compute the C_S for each observations + """ + N = data.shape[0] + suf_leaves = [] + counterfactuals_samples = [] + counterfactuals_samples_sdp = [] + counterfactuals_samples_w = [] + + for i in tqdm(range(N)): + suf_leaf, _, _, _, _ = get_compatible_leaf_reg(ac_explainer, data[i], 1 - y_data[i], down[i], up[i], s_star[i], + n_star[i], w[i], + x_train, y_train, pi=pi_level, acc_level=acc_level) + suf_leaves.append(suf_leaf) + # print(suf_leaf) + # print(np.unique(suf_leaf, axis=0).shape, len(suf_leaf)) + counterfactuals, counterfactuals_sdp, w_cond = \ + return_counterfactuals_reg(ac_explainer, suf_leaf, s_star[i], n_star[i], data[i].reshape(1, -1), + y_data[i].reshape(1, -1), down[i], up[i], x_train, y_train, pi_level) + + counterfactuals_samples.append(counterfactuals) + counterfactuals_samples_sdp.append(counterfactuals_sdp) + counterfactuals_samples_w.append(w_cond) + # print(counterfactuals_samples) + return counterfactuals_samples, counterfactuals_samples_sdp, counterfactuals_samples_w + + +def return_possible_values(rule, rule_data, sdp_all, pi_level): + d = rule.shape[0] + adj_rules = np.array([rule_data[i] for i in range(sdp_all.shape[0]) if sdp_all[i] >= pi_level]) + + left_by_var = [] + right_by_var = [] + + for var in range(d): + left = set([adj_rules[i, var, 0] for i in range(adj_rules.shape[0]) if adj_rules[i, var, 0] <= rule[var, 0]]) + right = set([adj_rules[i, var, 1] for i in range(adj_rules.shape[0]) if adj_rules[i, var, 1] >= rule[var, 1]]) + + left.add(rule[var, 0]) + right.add(rule[var, 1]) + + left_by_var.append(list(left)) + right_by_var.append(list(right)) + return left_by_var, right_by_var + + +def rdm_sample_fromlist(list_values): + return list_values[np.random.randint(0, len(list_values))] + + +def generate_newrule(rule, left_by_var, right_by_var, p_best=0.6): + d = rule.shape[0] + rule_c = rule.copy() + if np.random.rand() > p_best: + for i in range(d): + rule_c[i, 0] = rdm_sample_fromlist(left_by_var[i]) + rule_c[i, 1] = rdm_sample_fromlist(right_by_var[i]) + else: + for i in range(d): + left = [left_by_var[i][j] for j in range(len(left_by_var[i])) if left_by_var[i][j] <= rule_c[i, 0]] + right = [right_by_var[i][j] for j in range(len(right_by_var[i])) if right_by_var[i][j] >= rule_c[i, 1]] + + rule_c[i, 0] = rdm_sample_fromlist(left) + rule_c[i, 1] = rdm_sample_fromlist(right) + + return rule_c + + +def check_rule(rule, x_train, bad_sample): + x_in = np.prod([(x_train[:, s] <= rule[s, 1]) * (x_train[:, s] >= rule[s, 0]) + for s in range(x_train.shape[1])], axis=0) + return np.sum(x_in * bad_sample) == 0 + + +def generate_valid_rule(rule, left_by_var, right_by_var, x_train, bad_sample, p_best=0.9, n_try=100): + valid = False + it = 0 + while valid == False and it <= n_try: + gen_rule = generate_newrule(rule, left_by_var, right_by_var, p_best) + valid = check_rule(gen_rule, x_train, bad_sample) + it += 1 + if valid: + return gen_rule + else: + return rule + + +def generate_rules(rule, left_by_var, right_by_var, x_train, bad_sample, p_best=0.6, n_try=100, n_gen=10): + rules = [generate_valid_rule(rule, left_by_var, right_by_var, x_train, bad_sample, p_best, n_try) for i in + range(n_gen)] + return rules + + +def convert_boundvalues(rules, max_values, min_values): + for i in range(rules.shape[0]): + if rules[i, 0] <= -1e+10: + rules[i, 0] = min_values[i] + if rules[i, 1] <= -1e+10: + rules[i, 1] = min_values[i] + if rules[i, 0] >= 1e+10: + rules[i, 0] = max_values[i] + if rules[i, 1] >= 1e+10: + rules[i, 1] = max_values[i] + return rules + + +def volume_rectangle(rec, max_values, min_values): + d = rec.shape[0] + rec_c = rec.copy() + rec_c = convert_boundvalues(rec_c, max_values, min_values) + v = 1 + for i in range(d): + v *= (rec_c[i, 1] - rec_c[i, 0]) + return v + + +def volume_rectangles(recs, max_values, min_values): + return [volume_rectangle(recs[i], max_values, min_values) for i in range(len(recs))] + + +def max_dens(recs, x_train, bad_sample): + d = x_train.shape[1] + x_in = np.prod([(x_train[:, s] <= recs[s, 1]) * (x_train[:, s] > recs[s, 0]) + for s in range(d)], axis=0) + return np.sum(x_in * (1 - bad_sample)) / np.sum(1 - bad_sample) + + +def max_denss(recs, x_train, bad_sample): + return [max_dens(recs[i], x_train, bad_sample) for i in range(len(recs))] + + +def rules_simulated_annealing(value_function, rule, left_by_var, right_by_var, x_train, bad_sample, p_best=0.9, + n_try=100, + batch=100, max_iter=200, temp=1, + max_iter_convergence=50): + max_values = [np.max(x_train[:, i]) for i in range(x_train.shape[1])] + min_values = [np.min(x_train[:, i]) for i in range(x_train.shape[1])] + + best = generate_rules(rule, left_by_var, right_by_var, x_train, bad_sample, p_best, n_try, n_gen=1) + best_eval = value_function(best, max_values, min_values)[0] + curr, curr_eval = np.squeeze(best[0]), best_eval + + move = 0 + for i in range(max_iter): + + x_cand = generate_rules(curr, left_by_var, right_by_var, x_train, bad_sample, p_best, n_try, n_gen=batch) + score_candidates = value_function(x_cand, max_values, min_values) + + candidate_eval = np.max(score_candidates) + candidate = x_cand[np.argmax(score_candidates)] + + if candidate_eval > best_eval: + best, best_eval = candidate, candidate_eval + move = 0 + else: + move += 1 + + # check convergence + if move > max_iter_convergence: + break + + diff = candidate_eval - curr_eval + t = temp / np.log(float(i + 1)) + metropolis = np.exp(-diff / t) + + if diff > 0 or rand() < metropolis: + curr, curr_eval = candidate, candidate_eval + + return best, best_eval + + +def rules_by_annealing(value_function, rules, rules_data, sdp_all, x_train, pi_level=0.9, p_best=0.6, n_try=50, + batch=100, max_iter=200, temp=1, max_iter_convergence=50): + sr, sr_eval = [], [] + for idx in tqdm(range(rules.shape[0])): + rule = rules[idx] + rule_data = rules_data[idx] + bad_sample = 1. - (sdp_all[idx] >= pi_level) + sdp_rule = sdp_all[idx] + + left_by_var, right_by_var = return_possible_values(rule, rule_data, sdp_rule, pi_level) + best, best_eval = rules_simulated_annealing(value_function, rule, left_by_var, right_by_var, x_train, + bad_sample, + p_best, n_try, + batch, max_iter, temp, max_iter_convergence) + sr.append(np.squeeze(best)) + sr_eval.append(best_eval) + return np.array(sr), sr_eval + + +def remove_in_wsdp(ra, sa): + """ + remove A if A subset of B in the list of compatible leaves + """ + for i in range(ra.shape[0]): + for j in range(ra.shape[0]): + if i != j and np.prod([(ra[i, s, 1] <= ra[j, s, 1]) * (ra[i, s, 0] >= ra[j, s, 0]) + for s in range(ra.shape[1])], axis=0).astype(bool): + ra[i] = ra[j] + sa[i] = sa[j] + return np.unique(ra, axis=0), np.unique(sa, axis=0) diff --git a/acv_explainers/utils_cr.py b/acv_explainers/utils_cr.py new file mode 100644 index 0000000..e90cbca --- /dev/null +++ b/acv_explainers/utils_cr.py @@ -0,0 +1,809 @@ +import numpy as np +from tqdm import tqdm +# from .utils import * +from .utils import find_union, rand, pickle, get_active_null_coalition_list, IsolationForest +import acv_explainers + +def return_xy_cnt(x, y_target, x_train, y_train, w): + """ + return the observations with y=y_target that fall in the projected **leaf** of x + when we condition given S=S_bar of x. + """ + + x_train_cnt = [] + for i, wi in enumerate(w): + if wi != 0 and y_train[i] == y_target: + x_train_cnt.append(x_train[i].copy()) + + if len(x_train_cnt) == 0: + x_train_cnt = x_train[y_train == y_target][:10] + y_train_cnt = y_train[y_train == y_target][:10] + else: + x_train_cnt = np.array(x_train_cnt) + y_train_cnt = np.array(x_train_cnt.shape[0] * [y_target]) + + return x_train_cnt, y_train_cnt + + +def return_leaf_cnt(ac_explainer, S_star, x_train_cnt, y_train_cnt, x_train, y_train, pi=0.9, p_best=0.85, n_try=100, + batch=100, max_iter=100, temp=1, max_iter_convergence=100): + """ + return the original leaves of the observations with y=y_target that fall in the projected **leaf** + when we condition given S=S_bar of x. + """ + sdp, rules = ac_explainer.compute_sdp_rule(x_train_cnt, y_train_cnt, + x_train, y_train, + x_train_cnt.shape[0] * [list(range(x_train.shape[1]))] + ) + if np.sum(sdp >= pi) != 0: + rules_unique = np.unique(rules[sdp >= pi], axis=0) + else: + argsort = np.argsort(-sdp) + rules_unique = rules[argsort[:5]] + + r_buf = rules_unique.copy() + # TODO: check if 5 is sufficient + for i in range(rules_unique.shape[0]): + list_ric = [r.copy() for r in r_buf if not np.allclose(r, rules_unique[i])] + # find_union(rules_unique[i], list_ric, S=S_star) + sr, _ = rules_by_annealing(volume_rectangles, np.expand_dims(rules_unique[i], axis=0), + np.expand_dims(list_ric, axis=0), x_train, + p_best=p_best, n_try=n_try, + batch=batch, max_iter=max_iter, temp=temp, max_iter_convergence=max_iter_convergence) + rules_unique[i] = np.squeeze(sr[-1]) + return rules_unique + + +def remove_in(ra): + """ + remove A if A subset of B in the list of compatible leaves + """ + for i in range(ra.shape[0]): + for j in range(ra.shape[0]): + if i != j and np.prod([(ra[i, s, 1] <= ra[j, s, 1]) * (ra[i, s, 0] >= ra[j, s, 0]) + for s in range(ra.shape[1])], axis=0).astype(bool): + ra[i] = ra[j] + return np.unique(ra, axis=0) + + +def get_compatible_leaf(acvtree, x, y_target, S_star, S_bar_set, w, x_train, y_train, pi=0.9, acc_level=0.9, + p_best=0.85, n_try=100, + batch=100, max_iter=100, temp=1, max_iter_convergence=100 + ): + """ + Retrieve the compatible leaves and order them given their accuracy + """ + x_train_cnt, y_train_cnt = return_xy_cnt(x, y_target, x_train, y_train, w) + compatible_leaves = return_leaf_cnt(acvtree, S_star, x_train_cnt, y_train_cnt, x_train, y_train, pi, + p_best=p_best, n_try=n_try, + batch=batch, max_iter=max_iter, temp=temp, + max_iter_convergence=max_iter_convergence + ) + + compatible_leaves = np.unique(compatible_leaves, axis=0) + compatible_leaves = remove_in(compatible_leaves) + # compatible_leaves = np.rint(compatible_leaves) + compatible_leaves = np.round(compatible_leaves, 2) + + partition_leaf = compatible_leaves.copy() + d = partition_leaf.shape[1] + nb_leaf = partition_leaf.shape[0] + leaves_acc = [] + suf_leaf = [] + + for i in range(nb_leaf): + x_in = np.prod([(x_train[:, s] <= partition_leaf[i, s, 1]) * (x_train[:, s] >= partition_leaf[i, s, 0]) + for s in range(d)], axis=0).astype(bool) + y_in = y_train[x_in] + acc = np.mean(y_in == y_target) + leaves_acc.append(acc) + + if acc >= acc_level: + suf_leaf.append(partition_leaf[i]) + # TODO: check if it's good idea in general + best_id = np.argmax(leaves_acc) + if len(suf_leaf) == 0: + suf_leaf.append(partition_leaf[best_id]) + + return suf_leaf, partition_leaf, leaves_acc, partition_leaf[best_id], leaves_acc[best_id] + + +def return_counterfactuals(ac_explainer, suf_leaf, S_star, S_bar_set, x, y, x_train, y_train, pi_level): + """ + Compute the SDP of each C_S and return the ones that has sdp >= pi_level + """ + counterfactuals = [] + counterfactuals_sdp = [] + counterfactuals_w = [] + sdp_buf = [] + for leaf in suf_leaf: + + cond = np.ones(shape=(1, x_train.shape[1], 2)) + cond[:, :, 0] = -1e+10 + cond[:, :, 1] = 1e+10 + + for s in S_bar_set: + cond[:, s, 0] = x[:, s] + cond[:, s, 1] = x[:, s] + + cond[:, S_star] = leaf[S_star] + # Condition on S_bar and otherwise used the rules of C_S + size = x.shape[0] + sdp, w = ac_explainer.compute_cdp_cond_weights(x, y, np.array(size * [0.]), np.array(size * [0.]), + x_train, y_train, S=[S_bar_set], cond=cond, + pi_level=pi_level) + sdp_buf.append(sdp) + + if sdp >= pi_level: + counterfactuals.append(cond) + counterfactuals_sdp.append(sdp) + counterfactuals_w.append(w) + + if len(counterfactuals) == 0: + cond = np.ones(shape=(1, x_train.shape[1], 2)) + cond[:, :, 0] = -1e+10 + cond[:, :, 1] = 1e+10 + best_id = np.argmax(sdp_buf) + + for s in S_bar_set: + cond[:, s, 0] = x[:, s] + cond[:, s, 1] = x[:, s] + + cond[:, S_star] = suf_leaf[best_id][S_star] + size = x.shape[0] + sdp, w = ac_explainer.compute_cdp_cond_weights(x, y, np.array(size * [0.]), np.array(size * [0.]), + x_train, y_train, S=[S_bar_set], cond=cond, + pi_level=pi_level) + counterfactuals.append(cond) + counterfactuals_sdp.append(sdp) + counterfactuals_w.append(w) + + return np.array(counterfactuals).reshape(-1, x_train.shape[1], 2), np.array(counterfactuals_sdp).reshape(-1), np.array(counterfactuals_w).reshape(-1, x_train.shape[0]) + + +def return_global_counterfactuals(ac_explainer, data, y_data, s_star, n_star, x_train, y_train, w, acc_level, pi_level, + p_best=0.85, n_try=100, + batch=100, max_iter=100, temp=1, max_iter_convergence=100 + ): + """ + stack all the observations to compute the C_S for each observations: return the local CR + """ + N = data.shape[0] + suf_leaves = [] + counterfactuals_samples = [] + counterfactuals_samples_sdp = [] + counterfactuals_samples_w = [] + + for i in tqdm(range(N)): + suf_leaf, _, _, _, _ = get_compatible_leaf(ac_explainer, data[i], y_data[i], s_star[i], n_star[i], w[i], + x_train, y_train, pi=pi_level, acc_level=acc_level, + p_best=p_best, n_try=n_try, + batch=batch, max_iter=max_iter, temp=temp, + max_iter_convergence=max_iter_convergence + ) + suf_leaves.append(suf_leaf) + counterfactuals, counterfactuals_sdp, w_cond = \ + return_counterfactuals(ac_explainer, suf_leaf, s_star[i], n_star[i], data[i].reshape(1, -1), + y_data[i].reshape(1, -1), x_train, y_train, pi_level) + + counterfactuals, counterfactuals_sdp, w_cond = remove_in_wsdp(counterfactuals, counterfactuals_sdp, w_cond) + + counterfactuals_samples.append(counterfactuals) + counterfactuals_samples_sdp.append(counterfactuals_sdp) + counterfactuals_samples_w.append(w_cond) + + return counterfactuals_samples, counterfactuals_samples_sdp, counterfactuals_samples_w + + +# Fonction global explanations +def return_ge_counterfactuals(ac_explainer, suf_leaf, S_star, S_bar_set, x, y, x_train, y_train, cond_s, pi_level): + counterfactuals = [] + counterfactuals_sdp = [] + counterfactuals_w = [] + sdp_buf = [] + + for leaf in suf_leaf: + + cond = cond_s.copy() + cond[:, S_star] = leaf[S_star] + # condition only based on the rules cond + size = x.shape[0] + sdp, w = ac_explainer.compute_cdp_cond_weights(x, y, np.array(size * [0.]), np.array(size * [0.]), + x_train, y_train, S=[[-6]], cond=cond) + sdp_buf.append(sdp) + + if sdp >= pi_level: + counterfactuals.append(cond) + counterfactuals_sdp.append(sdp) + counterfactuals_w.append(w) + + if len(counterfactuals) == 0: + best_id = np.argmax(sdp_buf) + + cond = cond_s.copy() + cond[:, S_star] = suf_leaf[best_id][S_star] + + size = x.shape[0] + sdp, w = ac_explainer.compute_cdp_cond_weights(x, y, np.array(size * [0.]), np.array(size * [0.]), + x_train, y_train, S=[[-6]], cond=cond) + counterfactuals.append(cond) + counterfactuals_sdp.append(sdp) + counterfactuals_w.append(w) + + return np.array(counterfactuals).reshape(-1, x_train.shape[1], 2), np.array(counterfactuals_sdp).reshape(-1), np.array(counterfactuals_w).reshape(-1, x_train.shape[0]) + + +def return_ge_global_counterfactuals(ac_explainer, data, y_data, s_star, n_star, x_train, y_train, w, acc_level, cond, + pi_level, p_best=0.85, n_try=100, + batch=100, max_iter=100, temp=1, max_iter_convergence=100): + N = data.shape[0] + suf_leaves = [] + counterfactuals_samples = [] + counterfactuals_samples_sdp = [] + counterfactuals_samples_w = [] + + for i in tqdm(range(N)): + suf_leaf, _, _, _, _ = get_compatible_leaf(ac_explainer, data[i], y_data[i], s_star[i], n_star[i], w[i], + x_train, y_train, pi=pi_level, acc_level=acc_level, + p_best=p_best, n_try=n_try, + batch=batch, max_iter=max_iter, temp=temp, + max_iter_convergence=max_iter_convergence + ) + suf_leaves.append(suf_leaf) + + counterfactuals, counterfactuals_sdp, w_cond = return_ge_counterfactuals(ac_explainer, suf_leaf, s_star[i], + n_star[i], + data[i].reshape(1, -1), + y_data[i].reshape(1, -1), x_train, + y_train, + np.expand_dims(cond[i], 0), + pi_level) + + counterfactuals, counterfactuals_sdp, w_cond = remove_in_wsdp(counterfactuals, counterfactuals_sdp, w_cond) + + counterfactuals_samples.append(counterfactuals) + counterfactuals_samples_sdp.append(counterfactuals_sdp) + counterfactuals_samples_w.append(w_cond) + + return counterfactuals_samples, counterfactuals_samples_sdp, counterfactuals_samples_w + + +def print_rule(col_name, r, decision=None, sdp=True, output=None): + for i, col in enumerate(col_name): + if not ((r[i, 0] <= -1e+10 and r[i, 1] >= 1e+10)): + print('If {} in [{}, {}] and '.format(col, r[i, 0], r[i, 1])) + print(' ') + + if sdp == True: + print('Then the output is = {}'.format(output)) + print('SDP Probability = {}'.format(decision)) + else: + print('Then the output is {}'.format(output)) + print('Counterfactual CDP Probability = {}'.format(decision)) + + +def generate_candidate(x, S, x_train, cond, n_iterations): + x_poss = [x_train[(cond[i, 0] <= x_train[:, i]) * (x_train[:, i] <= cond[i, 1]), i] for i in S] + + x_cand = np.repeat(x.reshape(1, -1), repeats=n_iterations, axis=0) + for i in range(len(S)): + # TODO: check if it's a good idea + if x_poss[i].shape[0] == 0: + x_cand[:, S[i]] = cond[S[i], 0] + else: + rdm_id = np.random.randint(0, x_poss[i].shape[0], n_iterations) + x_cand[:, S[i]] = x_poss[i][rdm_id] + + return x_cand + + +def simulated_annealing(outlier_score, x, S, x_train, cond, batch, max_iter, temp, + max_iter_convergence=10): + """ + Generate sample s.t. (X | X_S \in cond) using simulated annealing and outlier score. + Args: + outlier_score (lambda functon): outlier_score(X) return a outlier score. If the value are negative, then the observation is an outlier. + x (numpy.ndarray)): 1-D array, an observation + S (list): contains the indices of the variables on which to condition + x_train (numpy.ndarray)): 2-D array represent the training samples + cond (numpy.ndarray)): 3-D (#variables x 2 x 1) representing the hyper-rectangle on which to condition + batch (int): number of sample by iteration + max_iter (int): number of iteration of the algorithm + temp (double): the temperature of the simulated annealing algorithm + max_iter_convergence (double): minimun number of iteration to stop the algorithm if it find an in-distribution observation + + Returns: + The generated sample, and its outlier score + """ + best = generate_candidate(x, S, x_train, cond, 1) + best_eval = outlier_score(best)[0] + curr, curr_eval = best, best_eval + + move = 0 + for i in range(max_iter): + + x_cand = generate_candidate(curr, S, x_train, cond, batch) + score_candidates = outlier_score(x_cand) + + candidate_eval = np.max(score_candidates) + candidate = x_cand[np.argmax(score_candidates)] + + if candidate_eval > best_eval: + best, best_eval = candidate, candidate_eval + move = 0 + else: + move += 1 + + # check convergence + if best_eval > 0 and move > max_iter_convergence: + break + + diff = candidate_eval - curr_eval + t = temp / np.log(float(i + 1)) + metropolis = np.exp(-diff / t) + + if diff > 0 or rand() < metropolis: + curr, curr_eval = candidate, candidate_eval + + return best, best_eval + +def save_model(model, name='{}'.format('dataset')): + with open('{}.pickle'.format(name), 'wb') as f: + pickle.dump(model, f) + + +def load_model(name='{}'.format('dataset')): + with open('{}.pickle'.format(name), 'rb') as f: + loaded_obj = pickle.load(f) + return loaded_obj + +#------------------------------REGRESSION +def return_xy_cnt_reg(x, y_target, down, up, S_bar_set, x_train, y_train, w): + """ + return the observations with y in (down, up) that fall in the projected leaf of x + when we condition given S=S_bar of x. + """ + + x_train_cnt = [] + y_train_cnt = [] + for i, wi in enumerate(w): + if wi != 0 and down <= y_train[i] <= up: + x_train_cnt.append(x_train[i].copy()) + y_train_cnt.append(y_train[i].copy()) + + if len(x_train_cnt) == 0: + x_train_cnt = x_train[(down <= y_train) * (y_train <= up)][:10] + y_train_cnt = y_train[(down <= y_train) * (y_train <= up)][:10] + + x_train_cnt = np.array(x_train_cnt) + y_train_cnt = np.array(y_train_cnt) + return x_train_cnt, y_train_cnt + + +def return_leaf_cnt_reg(ac_explainer, S_star, x_train_cnt, y_train_cnt, down, up, x_train, y_train, pi, + p_best=0.85, n_try=100, + batch=100, max_iter=100, temp=1, max_iter_convergence=100 + ): + """ + return the original leaves with sdp >= pi of the observations with y in (down, up) that fall in the projected leaf + when we condition given S=S_bar of x. + """ + size = x_train_cnt.shape[0] + sdp, rules = ac_explainer.compute_cdp_rule(x_train_cnt, y_train_cnt, + np.array(size * [down]), np.array(size * [up]), + x_train, y_train, + size * [list(range(x_train.shape[1]))] + ) + if np.sum(sdp >= pi) != 0: + rules_unique = np.unique(rules[sdp >= pi], axis=0) + else: + argsort = np.argsort(-sdp) + rules_unique = rules[argsort[:5]] + + # TODO: check if 5 is sufficient + r_buf = rules_unique.copy() + for i in range(rules_unique.shape[0]): + list_ric = [r.copy() for r in r_buf if not np.allclose(r, rules_unique[i])] + # find_union(rules_unique[i], list_ric, S=S_star) + sr, _ = rules_by_annealing(volume_rectangles, + np.expand_dims(rules_unique[i], axis=0), + np.expand_dims(list_ric, axis=0), x_train, + p_best=p_best, n_try=n_try, + batch=batch, max_iter=max_iter, temp=temp, + max_iter_convergence=max_iter_convergence + ) + rules_unique[i] = np.squeeze(sr[-1]) + return rules_unique + + +def get_compatible_leaf_reg(acvtree, x, y_target, down, up, S_star, S_bar_set, w, x_train, y_train, pi, acc_level, + p_best=0.85, n_try=100, + batch=100, max_iter=100, temp=1, max_iter_convergence=100 + ): + """ + Compute the compatible leaves and order given their accuracy + """ + x_train_cnt, y_train_cnt = return_xy_cnt_reg(x, y_target, down, up, S_bar_set, x_train, y_train, w) + compatible_leaves = return_leaf_cnt_reg(acvtree, S_star, x_train_cnt, y_train_cnt, down, up, x_train, y_train, pi, + p_best=p_best, n_try=n_try, + batch=batch, max_iter=max_iter, temp=temp, + max_iter_convergence=max_iter_convergence + ) + compatible_leaves = np.unique(compatible_leaves, axis=0) + compatible_leaves = remove_in(compatible_leaves) + compatible_leaves = np.round(compatible_leaves, 2) + + partition_leaf = compatible_leaves.copy() + d = partition_leaf.shape[1] + nb_leaf = partition_leaf.shape[0] + leaves_acc = [] + suf_leaf = [] + + for i in range(nb_leaf): + x_in = np.prod([(x_train[:, s] <= partition_leaf[i, s, 1]) * (x_train[:, s] >= partition_leaf[i, s, 0]) + for s in range(d)], axis=0).astype(bool) + + y_in = y_train[x_in] + acc = np.mean((down <= y_in) * (y_in <= up)) + leaves_acc.append(acc) + + if acc >= acc_level: + suf_leaf.append(partition_leaf[i]) + + best_id = np.argmax(leaves_acc) + if len(suf_leaf) == 0: + suf_leaf.append(partition_leaf[best_id]) + + return suf_leaf, partition_leaf, leaves_acc, partition_leaf[best_id], leaves_acc[best_id] + + +def return_counterfactuals_reg(ac_explainer, suf_leaf, S_star, S_bar_set, x, y, down, up, x_train, y_train, pi_level): + """ + Compute the SDP of each C_S and return the ones that has sdp >= pi_level + """ + counterfactuals = [] + counterfactuals_sdp = [] + counterfactuals_w = [] + sdp_buf = [] + for leaf in suf_leaf: + + cond = np.ones(shape=(1, x_train.shape[1], 2)) + cond[:, :, 0] = -1e+10 + cond[:, :, 1] = 1e+10 + + for s in S_bar_set: + cond[:, s, 0] = x[:, s] + cond[:, s, 1] = x[:, s] + + cond[:, S_star] = leaf[S_star] + size = x.shape[0] + sdp, w = ac_explainer.compute_cdp_cond_weights(x, y, np.array(size * [down]), np.array(size * [up]), + x_train, y_train, S=[S_bar_set], cond=cond, + pi_level=pi_level) + sdp_buf.append(sdp) + + if sdp >= pi_level: + counterfactuals.append(cond) + counterfactuals_sdp.append(sdp) + counterfactuals_w.append(w) + + if len(counterfactuals) == 0: + + best_id = np.argmax(sdp_buf) + cond = np.ones(shape=(1, x_train.shape[1], 2)) + cond[:, :, 0] = -1e+10 + cond[:, :, 1] = 1e+10 + + for s in S_bar_set: + cond[:, s, 0] = x[:, s] + cond[:, s, 1] = x[:, s] + + cond[:, S_star] = suf_leaf[best_id][S_star] + size = x.shape[0] + sdp, w = ac_explainer.compute_cdp_cond_weights(x, y, np.array(size * [down]), np.array(size * [up]), + x_train, y_train, S=[S_bar_set], cond=cond, + pi_level=pi_level) + counterfactuals.append(cond) + counterfactuals_sdp.append(sdp) + counterfactuals_w.append(w) + + return np.array(counterfactuals).reshape(-1, x_train.shape[1], 2), np.array(counterfactuals_sdp).reshape(-1), np.array(counterfactuals_w).reshape(-1, x_train.shape[0]) + + +def return_global_counterfactuals_reg(ac_explainer, data, y_data, down, up, s_star, n_star, x_train, y_train, w, + acc_level, pi_level, p_best=0.85, n_try=100, + batch=100, max_iter=100, temp=1, max_iter_convergence=100): + """ + stack all to compute the C_S for each observations + """ + N = data.shape[0] + suf_leaves = [] + counterfactuals_samples = [] + counterfactuals_samples_sdp = [] + counterfactuals_samples_w = [] + + for i in tqdm(range(N)): + suf_leaf, _, _, _, _ = get_compatible_leaf_reg(ac_explainer, data[i], y_data[i], down[i], up[i], + s_star[i], n_star[i], w[i], x_train, y_train, + pi=pi_level, acc_level=acc_level, + p_best=p_best, n_try=n_try, + batch=batch, max_iter=max_iter, temp=temp, + max_iter_convergence=max_iter_convergence + ) + suf_leaves.append(suf_leaf) + + counterfactuals, counterfactuals_sdp, w_cond = \ + return_counterfactuals_reg(ac_explainer, suf_leaf, s_star[i], n_star[i], data[i].reshape(1, -1), + y_data[i].reshape(1, -1), down[i], up[i], x_train, y_train, pi_level) + + counterfactuals, counterfactuals_sdp, w_cond = remove_in_wsdp(counterfactuals, counterfactuals_sdp, w_cond) + + counterfactuals_samples.append(counterfactuals) + counterfactuals_samples_sdp.append(counterfactuals_sdp) + counterfactuals_samples_w.append(w_cond) + return counterfactuals_samples, counterfactuals_samples_sdp, counterfactuals_samples_w + + +def return_ge_counterfactuals_reg(ac_explainer, suf_leaf, S_star, S_bar_set, x, y, down, up, x_train, y_train, cond_s, + pi_level): + counterfactuals = [] + counterfactuals_sdp = [] + counterfactuals_w = [] + sdp_buf = [] + for leaf in suf_leaf: + + cond = cond_s.copy() + cond[:, S_star] = leaf[S_star] + + sdp, w = ac_explainer.compute_cdp_cond_weights(x, y, down, up, x_train, y_train, S=[[-6]], cond=cond) + sdp_buf.append(sdp) + + if sdp >= pi_level: + counterfactuals.append(cond) + counterfactuals_sdp.append(sdp) + counterfactuals_w.append(w) + + if len(counterfactuals) == 0: + best_id = np.argmax(sdp_buf) + + cond = cond_s.copy() + cond[:, S_star] = suf_leaf[best_id][S_star] + + sdp, w = ac_explainer.compute_cdp_cond_weights(x, y, down, up, x_train, y_train, S=[[-6]], cond=cond) + + counterfactuals.append(cond) + counterfactuals_sdp.append(sdp) + counterfactuals_w.append(w) + + return np.array(counterfactuals).reshape(-1, x_train.shape[1], 2), np.array(counterfactuals_sdp).reshape(-1), np.array(counterfactuals_w).reshape(-1, x_train.shape[0]) + + +def return_ge_global_counterfactuals_reg(ac_explainer, data, y_data, down, up, s_star, n_star, x_train, y_train, w, + acc_level, cond, + pi_level, p_best=0.85, n_try=100, + batch=100, max_iter=100, temp=1, max_iter_convergence=100): + N = data.shape[0] + suf_leaves = [] + counterfactuals_samples = [] + counterfactuals_samples_sdp = [] + counterfactuals_samples_w = [] + + for i in tqdm(range(N)): + suf_leaf, _, _, _, _ = get_compatible_leaf_reg(ac_explainer, data[i], y_data[i], down[i], up[i], + s_star[i], n_star[i], w[i], x_train, y_train, + pi=pi_level, acc_level=acc_level, + p_best=p_best, n_try=n_try, + batch=batch, max_iter=max_iter, temp=temp, + max_iter_convergence=max_iter_convergence + ) + suf_leaves.append(suf_leaf) + + counterfactuals, counterfactuals_sdp, w_cond = return_ge_counterfactuals_reg(ac_explainer, suf_leaf, s_star[i], + n_star[i], + data[i].reshape(1, -1), + y_data[i].reshape(1, -1), + down[i].reshape(-1), + up[i].reshape(-1), + x_train, y_train, + np.expand_dims(cond[i], 0), + pi_level) + + counterfactuals, counterfactuals_sdp, w_cond = remove_in_wsdp(counterfactuals, counterfactuals_sdp, w_cond) + + counterfactuals_samples.append(counterfactuals) + counterfactuals_samples_sdp.append(counterfactuals_sdp) + counterfactuals_samples_w.append(w_cond) + + return counterfactuals_samples, counterfactuals_samples_sdp, counterfactuals_samples_w + + +def return_possible_values(rule, rule_data): + d = rule.shape[0] + adj_rules = rule_data.copy() + + left_by_var = [] + right_by_var = [] + for var in range(d): + left = set([adj_rules[i, var, 0] for i in range(adj_rules.shape[0]) if adj_rules[i, var, 0] < rule[var, 0]]) + right = set([adj_rules[i, var, 1] for i in range(adj_rules.shape[0]) if adj_rules[i, var, 1] > rule[var, 1]]) + + left.add(rule[var, 0]) + right.add(rule[var, 1]) + + left_by_var.append(list(left)) + right_by_var.append(list(right)) + return left_by_var, right_by_var + + +def rdm_sample_fromlist(list_values): + return list_values[np.random.randint(0, len(list_values))] + + +def generate_newrule(rule, left_by_var, right_by_var, p_best=0.6): + d = rule.shape[0] + rule_c = rule.copy() + if np.random.rand() > p_best: + for i in range(d): + rule_c[i, 0] = rdm_sample_fromlist(left_by_var[i]) + rule_c[i, 1] = rdm_sample_fromlist(right_by_var[i]) + else: + for i in range(d): + left = [left_by_var[i][j] for j in range(len(left_by_var[i])) if left_by_var[i][j] <= rule_c[i, 0]] + right = [right_by_var[i][j] for j in range(len(right_by_var[i])) if right_by_var[i][j] >= rule_c[i, 1]] + + rule_c[i, 0] = rdm_sample_fromlist(left) + rule_c[i, 1] = rdm_sample_fromlist(right) + + return rule_c + + +def check_rule(rule, x_train, bad_sample): + x_in = np.prod([(x_train[:, s] <= rule[s, 1]) * (x_train[:, s] >= rule[s, 0]) + for s in range(x_train.shape[1])], axis=0) + return np.sum(x_in * bad_sample) == 0 + + +def generate_valid_rule(rule, left_by_var, right_by_var, x_train, bad_sample, p_best=0.9, n_try=100): + valid = False + it = 0 + while valid == False and it <= n_try: + gen_rule = generate_newrule(rule, left_by_var, right_by_var, p_best) + valid = check_rule(gen_rule, x_train, bad_sample) + it += 1 + if valid: + return gen_rule + else: + return rule + + +def generate_rules(rule, left_by_var, right_by_var, x_train, bad_sample, p_best=0.6, n_try=100, n_gen=100): + rules = [generate_valid_rule(rule, left_by_var, right_by_var, x_train, bad_sample, p_best, n_try) for i in range(n_gen)] + return rules + + +def convert_boundvalues(rules, max_values, min_values): + for i in range(rules.shape[0]): + if rules[i, 0] <= -1e+10: + rules[i, 0] = min_values[i] + if rules[i, 1] <= -1e+10: + rules[i, 1] = min_values[i] + if rules[i, 0] >= 1e+10: + rules[i, 0] = max_values[i] + if rules[i, 1] >= 1e+10: + rules[i, 1] = max_values[i] + return rules + + +def volume_rectangle(rec, max_values, min_values): + d = rec.shape[0] + rec_c = rec.copy() + rec_c = convert_boundvalues(rec_c, max_values, min_values) + v = 1 + for i in range(d): + v *= (rec_c[i, 1] - rec_c[i, 0]) + return v + + +def volume_rectangles(recs, max_values, min_values): + return [volume_rectangle(recs[i], max_values, min_values) for i in range(len(recs))] + + +def max_dens(recs, x_train, bad_sample): + d = x_train.shape[1] + x_in = np.prod([(x_train[:, s] <= recs[s, 1]) * (x_train[:, s] >= recs[s, 0]) + for s in range(d)], axis=0) + return np.sum(x_in * (1 - bad_sample)) / np.sum(1 - bad_sample) + + +def max_denss(recs, x_train, bad_sample): + return [max_dens(recs[i], x_train, bad_sample) for i in range(len(recs))] + + +def rules_simulated_annealing(value_function, rule, left_by_var, right_by_var, x_train, bad_sample, p_best=0.6, + n_try=100, + batch=100, max_iter=100, temp=1, + max_iter_convergence=50): + max_values = [np.max(x_train[:, i]) for i in range(x_train.shape[1])] + min_values = [np.min(x_train[:, i]) for i in range(x_train.shape[1])] + + best = generate_rules(rule, left_by_var, right_by_var, x_train, bad_sample, p_best, n_try, n_gen=1) + best_eval = value_function(best, max_values, min_values)[0] + curr, curr_eval = np.squeeze(best[0]), best_eval + + move = 0 + for i in range(max_iter): + + x_cand = generate_rules(curr, left_by_var, right_by_var, x_train, bad_sample, p_best, n_try, n_gen=batch) + score_candidates = value_function(x_cand, max_values, min_values) + + candidate_eval = np.max(score_candidates) + candidate = x_cand[np.argmax(score_candidates)] + + if candidate_eval > best_eval: + best, best_eval = candidate, candidate_eval + move = 0 + else: + move += 1 + + # check convergence + if move > max_iter_convergence: + break + + diff = candidate_eval - curr_eval + t = temp / np.log(float(i + 1)) + metropolis = np.exp(-diff / t) + + if diff > 0 or rand() < metropolis: + curr, curr_eval = candidate, candidate_eval + + return best, best_eval + + +def rules_by_annealing(value_function, rules, rules_data, x_train, p_best=0.85, n_try=100, + batch=100, max_iter=100, temp=1, max_iter_convergence=100): + sr, sr_eval = [], [] + d = x_train.shape[1] + + for idx in range(rules.shape[0]): + rule = rules[idx] + rule_data = rules_data[idx] + + x_in = np.prod([(x_train[:, s] <= rule[s, 1]) * (x_train[:, s] >= rule[s, 0]) + for s in range(d)], axis=0) + + for r in rule_data: + x_in += np.prod([(x_train[:, s] <= r[s, 1]) * (x_train[:, s] >= r[s, 0]) + for s in range(d)], axis=0) + + bad_sample = 1. - (x_in > 0) + # print('bad', bad_sample) + left_by_var, right_by_var = return_possible_values(rule, rule_data) + best, best_eval = rules_simulated_annealing(value_function, rule, left_by_var, right_by_var, x_train, + bad_sample, + p_best, n_try, + batch, max_iter, temp, max_iter_convergence) + sr.append(best) + sr_eval.append(best_eval) + return np.array(sr), sr_eval + + +def remove_in_wsdp(ra, sa, wa): + """ + remove A if A subset of B in the list of compatible leaves + """ + ra_b = ra.copy() + sa_b = sa.copy() + wa_b = wa.copy() + remove_list = [] + for i in range(ra.shape[0]): + for j in range(ra.shape[0]): + if i != j and np.prod([(ra[i, s, 1] <= ra[j, s, 1]) * (ra[i, s, 0] >= ra[j, s, 0]) + for s in range(ra.shape[1])], axis=0).astype(bool): + # ra[i] = ra[j] + # sa[i] = sa[j] + # wa[i] = wa[j] + remove_list.append(j) + ra_b = np.delete(ra_b, remove_list, axis=0) + sa_b = np.delete(sa_b, remove_list, axis=0) + wa_b = np.delete(wa_b, remove_list, axis=0) + return ra_b, sa_b, wa_b diff --git a/requirements.txt b/requirements.txt index 634fab2..aa9b298 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,7 +12,7 @@ catboost imodels keras tensorflow -skranger==0.7.0 +skranger streamlit anchor-exp shap \ No newline at end of file diff --git a/setup.py b/setup.py index d6b5615..df08439 100644 --- a/setup.py +++ b/setup.py @@ -2,8 +2,8 @@ from Cython.Distutils import build_ext from Cython.Build import cythonize import numpy -# from setuptools import setup, Extension # for pypi build -from distutils.core import setup, Extension # python setup +from setuptools import setup, Extension # for pypi build +# from distutils.core import setup, Extension # python setup c_ext = Extension('cext_acv', sources=['acv_explainers/cext_acv/_cext.cc']) cy_ext = Extension('cyext_acv', ['acv_explainers/cyext_acv/cyext_acv.pyx'], extra_compile_args=['-fopenmp'], @@ -22,7 +22,7 @@ setup(name='acv-exp', author='Salim I. Amoukou', author_email='salim.ibrahim-amoukou@universite-paris-saclay.fr', - version='1.2.2', + version='1.2.3', description='ACV is a library that provides robust and accurate explanations for machine learning models or data', long_description=long_description, long_description_content_type="text/markdown", @@ -32,7 +32,7 @@ ext_modules=cythonize([c_ext, cy_ext, cy_extnopa, cy_extcache]), setup_requires=['numpy<1.22'], install_requires=['numpy<1.22', 'scipy', 'scikit-learn', 'matplotlib', 'pandas', 'tqdm', 'ipython', 'seaborn', - 'streamlit', 'skranger == 0.7.0'], + 'streamlit', 'skranger'], extras_require={'test': ['xgboost', 'lightgbm', 'catboost', 'pyspark', 'shap', 'rpy2 == 2.9.4', 'pytest']}, packages=['acv_explainers', 'experiments', 'acv_app', 'acv_app.colors'], license='MIT', diff --git a/tests/test_acx.py b/tests/test_acx.py index 0bb3580..a3a47be 100644 --- a/tests/test_acx.py +++ b/tests/test_acx.py @@ -35,4 +35,51 @@ def test_acx_global_rules(): ac_xplainer.fit(data, y) sdp, rules, sdp_all, rules_data, w = ac_xplainer.compute_sdp_maxrules(x_test, y_test, data, y, S=[[0, 1, 9] for i in range(x_test.shape[0])]) ac_xplainer.fit_global_rules(x, y_x, rules, rules_s_star=[[0, 1, 9] for i in range(rules.shape[0])]) - ac_xplainer.predict_global_rules(x) \ No newline at end of file + ac_xplainer.predict_global_rules(x) + + +def test_run_sufficient_rules(): + import numpy as np + from sklearn.datasets import load_breast_cancer + from sklearn.model_selection import train_test_split + from acv_explainers import ACXplainer + from acv_explainers.utils import get_active_null_coalition_list + + seed = 2022 + X, y = load_breast_cancer(return_X_y=True, as_frame=True) + X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.20, random_state=seed) + + ### Train the model + + X_train = X_train.values[:50] + y_train = y_train.values[:50] + + acv_xplainer = ACXplainer(classifier=True, n_estimators=18, max_depth=15) + acv_xplainer.fit(X_train, y_train) + + ### 1- Compute Sufficient Explanations + + sdp_importance, sdp_index, size, sdp = acv_xplainer.importance_sdp_rf(X_train, y_train.astype(np.double), + X_train, y_train.astype(np.double), + stop=False, + pi_level=0.9) + + S_star, N_star = get_active_null_coalition_list(sdp_index, size) + + ### 2- Compute Sufficient Rules + + sdp, rules, sdp_all, rules_data, w = acv_xplainer.compute_sdp_maxrules(X_train, y_train.astype(np.double), + X_train, y_train.astype(np.double), S_star, + verbose=True) + + ### 3- Compute Global Sufficient Rules (G-SR) + + acv_xplainer.fit_global_rules(X_train, y_train, rules, S_star) + + ### 4- All Sufficient Explanations + + max_size = 5 + sufficient_expl, sdp_expl, sdp_global = acv_xplainer.sufficient_expl_rf(X_train[:max_size], y_train[:max_size], + X_train, y_train, pi_level=0.8) + + acv_xplainer.compute_local_sdp(X_train.shape[1], sufficient_expl) \ No newline at end of file