[SYSTEMML-1259] Replace append with cbind for matrices Replace matrix append calls with cbind calls.
Closes #391. Project: http://git-wip-us.apache.org/repos/asf/incubator-systemml/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-systemml/commit/1385cf1c Tree: http://git-wip-us.apache.org/repos/asf/incubator-systemml/tree/1385cf1c Diff: http://git-wip-us.apache.org/repos/asf/incubator-systemml/diff/1385cf1c Branch: refs/heads/master Commit: 1385cf1cabd1fed449dbc48cdbc89eb5926c4575 Parents: d58c787 Author: Deron Eriksson <[email protected]> Authored: Tue Feb 14 16:14:16 2017 -0800 Committer: Deron Eriksson <[email protected]> Committed: Tue Feb 14 16:14:16 2017 -0800 ---------------------------------------------------------------------- docs/dml-language-reference.md | 1 - scripts/algorithms/ALS_topk_predict.dml | 6 ++-- scripts/algorithms/Cox.dml | 4 +-- scripts/algorithms/GLM-predict.dml | 2 +- scripts/algorithms/GLM.dml | 6 ++-- scripts/algorithms/KM.dml | 30 ++++++++--------- scripts/algorithms/LinearRegCG.dml | 4 +-- scripts/algorithms/LinearRegDS.dml | 4 +-- scripts/algorithms/MultiLogReg.dml | 6 ++-- scripts/algorithms/StepGLM.dml | 28 ++++++++-------- scripts/algorithms/StepLinearRegDS.dml | 26 +++++++-------- scripts/algorithms/decision-tree.dml | 34 ++++++++++---------- scripts/algorithms/l2-svm.dml | 4 +-- scripts/algorithms/m-svm.dml | 6 ++-- scripts/algorithms/naive-bayes-predict.dml | 4 +-- .../algorithms/obsolete/naive-bayes-parfor.dml | 6 ++-- scripts/algorithms/random-forest.dml | 34 ++++++++++---------- scripts/datagen/genLinearRegressionData.dml | 2 +- scripts/datagen/genRandData4DecisionTree2.dml | 2 +- .../datagen/genRandData4LinearRegression.dml | 2 +- .../datagen/genRandData4LogisticRegression.dml | 2 +- scripts/datagen/genRandData4MultiClassSVM.dml | 2 +- scripts/datagen/genRandData4StratStats.dml | 6 ++-- scripts/datagen/genRandData4SurvAnalysis.dml | 2 +- scripts/datagen/genRandData4Transform.dml | 6 ++-- scripts/staging/knn.dml | 10 +++--- scripts/utils/splitXY-dummy.dml | 2 +- scripts/utils/splitXY.dml | 2 +- src/test/scripts/applications/glm/GLM.dml | 6 ++-- src/test/scripts/applications/glm/GLM.pydml | 6 ++-- src/test/scripts/applications/l2svm/L2SVM.dml | 2 +- src/test/scripts/applications/l2svm/L2SVM.pydml | 2 +- src/test/scripts/applications/m-svm/m-svm.dml | 4 +-- src/test/scripts/applications/m-svm/m-svm.pydml | 4 +-- .../naive-bayes-parfor/naive-bayes.dml | 4 +-- .../naive-bayes-parfor/naive-bayes.pydml | 4 +-- .../parfor/parfor_cv_multiclasssvm0.dml | 12 +++---- .../parfor/parfor_cv_multiclasssvm1.dml | 12 +++---- .../parfor/parfor_cv_multiclasssvm4.dml | 12 +++---- .../validation/CV_LogisticRegression.dml | 10 +++--- .../validation/CV_MultiClassSVM.dml | 12 +++---- .../validation/CV_MultiClassSVM.sasha.dml | 12 +++---- .../validation/LinearLogisticRegression.dml | 6 ++-- .../applications/validation/MultiClassSVM.dml | 8 ++--- .../genRandData4LogisticRegression.dml | 2 +- .../validation/genRandData4MultiClassSVM.dml | 2 +- .../functions/append/AppendChainTest.dml | 4 +-- .../functions/append/AppendMatrixTest.dml | 2 +- .../functions/append/AppendVectorTest.dml | 2 +- .../functions/append/basic_string_append.dml | 4 +-- .../scripts/functions/compress/LinregCG.dml | 2 +- src/test/scripts/functions/gdfo/LinregCG.dml | 2 +- src/test/scripts/functions/gdfo/LinregDS.dml | 2 +- .../functions/jmlc/reuse-glm-predict.dml | 2 +- src/test/scripts/functions/jmlc/transform4.dml | 4 +-- src/test/scripts/functions/jmlc/transform5.dml | 4 +-- .../functions/parfor/parfor_repeatedopt3.dml | 4 +-- .../piggybacking/Piggybacking1_append.dml | 2 +- .../scripts/functions/recompile/append_nnz.dml | 2 +- .../functions/recompile/if_branch_removal.dml | 8 ++--- .../recompile/multiple_function_calls5.dml | 2 +- .../recompile/remove_empty_potpourri4.dml | 2 +- .../transform/TransformEncodeDecode.dml | 2 +- .../scripts/functions/unary/matrix/QRsolve.dml | 2 +- 64 files changed, 207 insertions(+), 208 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/docs/dml-language-reference.md ---------------------------------------------------------------------- diff --git a/docs/dml-language-reference.md b/docs/dml-language-reference.md index 22ec0d9..fca2b9b 100644 --- a/docs/dml-language-reference.md +++ b/docs/dml-language-reference.md @@ -639,7 +639,6 @@ The builtin function `sum` operates on a matrix (say A of dimensionality (m x n) Function | Description | Parameters | Example -------- | ----------- | ---------- | ------- -append() | Adds the second argument as additional columns to the first argument (note that the first argument is not over-written). Append is meant to be used in situations where one cannot use left-indexing. <br/> **NOTE: append() has been replaced by cbind(), so its use is discouraged.** | Input: (X <matrix>, Y <matrix>) <br/>Output: <matrix> <br/> X and Y are matrices (with possibly multiple columns), where the number of rows in X and Y must be the same. Output is a matrix with exactly the same number of rows as X and Y. Let n1 and n2 denote the number of columns of matrix X and Y, respectively. The returned matrix has n1+n2 columns, where the first n1 columns contain X and the last n2 columns contain Y. | A = matrix(1, rows=2,cols=5) <br/> B = matrix(1, rows=2,cols=3) <br/> C = append(A,B) <br/> print("Dimensions of C: " + nrow(C) + " X " + ncol(C)) <br/> The output of above example is: <br/> Dimensions of C: 2 X 8 cbind() | Column-wise matrix concatenation. Concatenates the second matrix as additional columns to the first matrix | Input: (X <matrix>, Y <matrix>) <br/>Output: <matrix> <br/> X and Y are matrices, where the number of rows in X and the number of rows in Y are the same. | A = matrix(1, rows=2,cols=3) <br/> B = matrix(2, rows=2,cols=3) <br/> C = cbind(A,B) <br/> print("Dimensions of C: " + nrow(C) + " X " + ncol(C)) <br/> Output: <br/> Dimensions of C: 2 X 6 matrix() | Matrix constructor (assigning all the cells to numeric literals). | Input: (<init>, rows=<value>, cols=<value>) <br/> init: numeric literal; <br/> rows/cols: number of rows/cols (expression) <br/> Output: matrix | # 10x10 matrix initialized to 0 <br/> A = matrix (0, rows=10, cols=10) | Matrix constructor (reshaping an existing matrix). | Input: (<existing matrix>, rows=<value>, cols=<value>, byrow=TRUE) <br/> Output: matrix | A = matrix (0, rows=10, cols=10) <br/> B = matrix (A, rows=100, cols=1) http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/scripts/algorithms/ALS_topk_predict.dml ---------------------------------------------------------------------- diff --git a/scripts/algorithms/ALS_topk_predict.dml b/scripts/algorithms/ALS_topk_predict.dml index b331218..ebc9425 100644 --- a/scripts/algorithms/ALS_topk_predict.dml +++ b/scripts/algorithms/ALS_topk_predict.dml @@ -117,9 +117,9 @@ for (i in 1:K){ V_top_indices = V_top_indices * (V_top_values > 0); -# append users as a first column -V_top_indices = append (X[,1], V_top_indices); -V_top_values = append (X[,1], V_top_values); +# cbind users as a first column +V_top_indices = cbind (X[,1], V_top_indices); +V_top_values = cbind (X[,1], V_top_values); # writing top K elements write (V_top_indices, fileY, format = fmtO); http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/scripts/algorithms/Cox.dml ---------------------------------------------------------------------- diff --git a/scripts/algorithms/Cox.dml b/scripts/algorithms/Cox.dml index b3fe29f..a021109 100644 --- a/scripts/algorithms/Cox.dml +++ b/scripts/algorithms/Cox.dml @@ -138,9 +138,9 @@ if (fileR != " ") { # factors available ones = matrix (1, rows = nrow (F), cols = 1); F_filter = table (ones, F, 1, ncol (X_orig)); F_filter = removeEmpty (target = F_filter * col_seq, margin = "cols"); - TE_F = t(append (t (TE), F_filter)); + TE_F = t(cbind (t (TE), F_filter)); } else if (fileF != " ") { # all features scale - TE_F = t(append (t (TE), t(F))); + TE_F = t(cbind (t (TE), t(F))); } else { # no features available TE_F = TE; } http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/scripts/algorithms/GLM-predict.dml ---------------------------------------------------------------------- diff --git a/scripts/algorithms/GLM-predict.dml b/scripts/algorithms/GLM-predict.dml index 90d1f6b..e24b16f 100644 --- a/scripts/algorithms/GLM-predict.dml +++ b/scripts/algorithms/GLM-predict.dml @@ -401,7 +401,7 @@ glm_means_and_vars = # MULTINOMIAL LOGIT DISTRIBUTION elt = exp (linear_terms); ones_pts = matrix (1, rows = num_points, cols = 1); - elt = append (elt, ones_pts); + elt = cbind (elt, ones_pts); ones_ctg = matrix (1, rows = ncol (elt), cols = 1); means = elt / (rowSums (elt) %*% t(ones_ctg)); vars = means * (means %*% (1 - diag (ones_ctg))); http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/scripts/algorithms/GLM.dml ---------------------------------------------------------------------- diff --git a/scripts/algorithms/GLM.dml b/scripts/algorithms/GLM.dml index 9cad79f..2524d71 100644 --- a/scripts/algorithms/GLM.dml +++ b/scripts/algorithms/GLM.dml @@ -184,7 +184,7 @@ ones_r = 1 + zeros_r; if (intercept_status == 1 | intercept_status == 2) # add the intercept column { - X = append (X, ones_r); + X = cbind (X, ones_r); num_features = ncol (X); } @@ -234,7 +234,7 @@ if (max_iteration_CG == 0) { if (distribution_type == 2 & ncol(Y) == 1) { is_Y_negative = (Y == bernoulli_No_label); - Y = append (1 - is_Y_negative, is_Y_negative); + Y = cbind (1 - is_Y_negative, is_Y_negative); count_Y_negative = sum (is_Y_negative); if (count_Y_negative == 0) { stop ("GLM Input Error: all Y-values encode Bernoulli YES-label, none encode NO-label"); @@ -445,7 +445,7 @@ if (termination_code == 1) { ssX_beta = diag (scale_X) %*% beta; ssX_beta [num_features, ] = ssX_beta [num_features, ] + t(shift_X) %*% beta; if (intercept_status == 2) { - beta_out = append (ssX_beta, beta); + beta_out = cbind (ssX_beta, beta); } else { beta_out = ssX_beta; } http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/scripts/algorithms/KM.dml ---------------------------------------------------------------------- diff --git a/scripts/algorithms/KM.dml b/scripts/algorithms/KM.dml index d648c50..26f42d6 100644 --- a/scripts/algorithms/KM.dml +++ b/scripts/algorithms/KM.dml @@ -163,11 +163,11 @@ if (2 + n_group_cols + n_stratum_cols > ncol (X)) { if (GI_1_1 == 0 & SI_1_1 == 0) { Is = TE; } else if (GI_1_1 == 0) { - Is = append (TE, SI); + Is = cbind (TE, SI); } else if (SI_1_1 == 0) { - Is = append (TE, GI); + Is = cbind (TE, GI); } else { - Is = append (TE, append (GI, SI)); + Is = cbind (TE, cbind (GI, SI)); } X = X %*% table (Is, seq (1, 2 + n_group_cols + n_stratum_cols), ncol (X), 2 + n_group_cols + n_stratum_cols); @@ -201,9 +201,9 @@ if (n_group_cols > 0) { Gi = matrix (1, rows = num_records, cols = 1); } if (n_stratum_cols > 0) { - X = append (append (X[,1:2],Gi), X[,(3 + g):ncol (X)]); + X = cbind (cbind (X[,1:2],Gi), X[,(3 + g):ncol (X)]); } else { # no strata - X = append (X[,1:2],Gi); + X = cbind (X[,1:2],Gi); } } @@ -237,16 +237,16 @@ if (n_stratum_cols > 0) { } else { # there is only one stratum Si = matrix (1, rows = num_records, cols = 1); } - X = append (X[,1:3],Si); + X = cbind (X[,1:3],Si); } if (n_group_cols == 0 & n_stratum_cols == 0) { - X = append (X, matrix (1, rows = num_records, cols = 2)); + X = cbind (X, matrix (1, rows = num_records, cols = 2)); SB = matrix (1, rows = 1, cols = 1); } else if (n_group_cols == 0) { - X = append (X[,1:2], append (matrix (1, rows = num_records, cols = 1), X[,3])); + X = cbind (X[,1:2], cbind (matrix (1, rows = num_records, cols = 1), X[,3])); } else if (n_stratum_cols == 0) { - X = append (X, matrix (1, rows = num_records, cols = 1)); + X = cbind (X, matrix (1, rows = num_records, cols = 1)); SB = matrix (1, rows = 1, cols = 1); } @@ -586,21 +586,21 @@ M = replace (target = M, pattern = "Infinity", replacement = "NaN"); # pull out non-empty rows from TEST if (n_group_cols > 0 & n_stratum_cols > 0) { - M = append (append (G_cols, S_cols), M); + M = cbind (cbind (G_cols, S_cols), M); if (test_type != "none") { - TEST = append (G_cols_original, TEST); + TEST = cbind (G_cols_original, TEST); } } else if (n_group_cols > 0) { - M = append (G_cols, M); + M = cbind (G_cols, M); if (test_type != "none") { - TEST = append (G_cols_original, TEST); + TEST = cbind (G_cols_original, TEST); } } else if (n_stratum_cols > 0) { - M = append (S_cols, M); + M = cbind (S_cols, M); } # pull out non-empty columns from KM -KM = t (append (t (KM), KM_cols_select) * KM_cols_select); +KM = t (cbind (t (KM), KM_cols_select) * KM_cols_select); KM = removeEmpty (target = KM, margin = "cols"); KM = removeEmpty (target = KM, margin = "rows"); KM = KM[1:(nrow (KM) - 1),]; http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/scripts/algorithms/LinearRegCG.dml ---------------------------------------------------------------------- diff --git a/scripts/algorithms/LinearRegCG.dml b/scripts/algorithms/LinearRegCG.dml index 5e7bb36..25e5862 100644 --- a/scripts/algorithms/LinearRegCG.dml +++ b/scripts/algorithms/LinearRegCG.dml @@ -110,7 +110,7 @@ zero_cell = matrix (0, rows = 1, cols = 1); m_ext = m; if (intercept_status == 1 | intercept_status == 2) # add the intercept column { - X = append (X, ones_n); + X = cbind (X, ones_n); m_ext = ncol (X); } @@ -274,7 +274,7 @@ if (fileO != " ") { print ("Writing the output matrix..."); if (intercept_status == 2) { - beta_out = append (beta, beta_unscaled); + beta_out = cbind (beta, beta_unscaled); } else { beta_out = beta; } http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/scripts/algorithms/LinearRegDS.dml ---------------------------------------------------------------------- diff --git a/scripts/algorithms/LinearRegDS.dml b/scripts/algorithms/LinearRegDS.dml index eb85c60..2f55b41 100644 --- a/scripts/algorithms/LinearRegDS.dml +++ b/scripts/algorithms/LinearRegDS.dml @@ -92,7 +92,7 @@ zero_cell = matrix (0, rows = 1, cols = 1); m_ext = m; if (intercept_status == 1 | intercept_status == 2) # add the intercept column { - X = append (X, ones_n); + X = cbind (X, ones_n); m_ext = ncol (X); } @@ -216,7 +216,7 @@ if (fileO != " ") { print ("Writing the output matrix..."); if (intercept_status == 2) { - beta_out = append (beta, beta_unscaled); + beta_out = cbind (beta, beta_unscaled); } else { beta_out = beta; } http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/scripts/algorithms/MultiLogReg.dml ---------------------------------------------------------------------- diff --git a/scripts/algorithms/MultiLogReg.dml b/scripts/algorithms/MultiLogReg.dml index eaef4a1..55ef0e1 100644 --- a/scripts/algorithms/MultiLogReg.dml +++ b/scripts/algorithms/MultiLogReg.dml @@ -100,7 +100,7 @@ D = ncol (X); # Introduce the intercept, shift and rescale the columns of X if needed if (intercept_status == 1 | intercept_status == 2) # add the intercept column { - X = append (X, matrix (1, rows = N, cols = 1)); + X = cbind (X, matrix (1, rows = N, cols = 1)); D = ncol (X); } @@ -152,7 +152,7 @@ lambda = (scale_lambda %*% matrix (1, rows = 1, cols = K)) * regularization; delta = 0.5 * sqrt (D) / max (sqrt (rowSums_X_sq)); B = matrix (0, rows = D, cols = K); ### LT = X %*% (SHIFT/SCALE TRANSFORM) %*% B; - ### LT = append (LT, matrix (0, rows = N, cols = 1)); + ### LT = cbind (LT, matrix (0, rows = N, cols = 1)); ### LT = LT - rowMaxs (LT) %*% matrix (1, rows = 1, cols = K+1); P = matrix (1, rows = N, cols = K+1); ### exp_LT = exp (LT); P = P / (K + 1); ### P = exp_LT / (rowSums (exp_LT) %*% matrix (1, rows = 1, cols = K+1)); @@ -253,7 +253,7 @@ while (! converge) ssX_B_new = B_new; } - LT = append ((X %*% ssX_B_new), matrix (0, rows = N, cols = 1)); + LT = cbind ((X %*% ssX_B_new), matrix (0, rows = N, cols = 1)); if (fileLog != " ") { log_str = append (log_str, "LINEAR_TERM_MIN," + iter + "," + min (LT)); log_str = append (log_str, "LINEAR_TERM_MAX," + iter + "," + max (LT)); http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/scripts/algorithms/StepGLM.dml ---------------------------------------------------------------------- diff --git a/scripts/algorithms/StepGLM.dml b/scripts/algorithms/StepGLM.dml index edc1346..e598cb8 100644 --- a/scripts/algorithms/StepGLM.dml +++ b/scripts/algorithms/StepGLM.dml @@ -101,7 +101,7 @@ Y = read (fileY); if (distribution_type == 2 & ncol(Y) == 1) { is_Y_negative = (Y == bernoulli_No_label); - Y = append (1 - is_Y_negative, is_Y_negative); + Y = cbind (1 - is_Y_negative, is_Y_negative); count_Y_negative = sum (is_Y_negative); if (count_Y_negative == 0) { stop ("StepGLM Input Error: all Y-values encode Bernoulli YES-label, none encode NO-label"); @@ -175,7 +175,7 @@ if (dir == "forward") { if (as.scalar(columns_fixed[1,i]) == 0) { # Construct the feature matrix - X = append (X_global, X_orig[,i]); + X = cbind (X_global, X_orig[,i]); [AIC_2] = glm (X, Y, intercept_status, num_features, columns_fixed_ordered, " "); AICs[1,i] = AIC_2; @@ -191,16 +191,16 @@ if (dir == "forward") { } } - # Append best found features (i.e., columns) to X_global + # cbind best found features (i.e., columns) to X_global if (as.scalar(columns_fixed[1,column_best]) == 0) { # new best feature found print ("Best AIC " + AIC_best + " achieved with feature: " + column_best); columns_fixed[1,column_best] = 1; - columns_fixed_ordered = append (columns_fixed_ordered, as.matrix(column_best)); + columns_fixed_ordered = cbind (columns_fixed_ordered, as.matrix(column_best)); if (ncol(columns_fixed_ordered) == num_features) { # all features examined - X_global = append (X_global, X_orig[,column_best]); + X_global = cbind (X_global, X_orig[,column_best]); continue = FALSE; } else { - X_global = append (X_global, X_orig[,column_best]); + X_global = cbind (X_global, X_orig[,column_best]); } } else { continue = FALSE; @@ -262,7 +262,7 @@ glm = function (Matrix[Double] X, Matrix[Double] Y, Int intercept_status, Double # Introduce the intercept, shift and rescale the columns of X if needed if (intercept_status == 1 | intercept_status == 2) { # add the intercept column - X = append (X, ones_r); + X = cbind (X, ones_r); num_features = ncol (X); } @@ -484,7 +484,7 @@ glm = function (Matrix[Double] X, Matrix[Double] Y, Int intercept_status, Double ssX_beta = diag (scale_X) %*% beta; ssX_beta [num_features, ] = ssX_beta [num_features, ] + t(shift_X) %*% beta; if (intercept_status == 2) { - beta_out = append (ssX_beta, beta); + beta_out = cbind (ssX_beta, beta); } else { beta_out = ssX_beta; } @@ -568,7 +568,7 @@ glm = function (Matrix[Double] X, Matrix[Double] Y, Int intercept_status, Double if (intercept_status != 0) { - Selected_ext = append (Selected, as.matrix (last)); + Selected_ext = cbind (Selected, as.matrix (last)); P1 = table (seq (1, ncol (Selected_ext)), t(Selected_ext)); if (intercept_status == 2) { @@ -580,8 +580,8 @@ glm = function (Matrix[Double] X, Matrix[Double] Y, Int intercept_status, Double if (max_selected < num_features_orig) { - P2_ssX_beta = append (P2_ssX_beta, matrix (0, rows=1, cols=(num_features_orig - max_selected))); - P2_beta = append (P2_beta, matrix (0, rows=1, cols=(num_features_orig - max_selected))); + P2_ssX_beta = cbind (P2_ssX_beta, matrix (0, rows=1, cols=(num_features_orig - max_selected))); + P2_beta = cbind (P2_beta, matrix (0, rows=1, cols=(num_features_orig - max_selected))); P2_ssX_beta[1, num_features_orig+1] = P2_ssX_beta[1, max_selected + 1]; P2_ssX_beta[1, max_selected + 1] = 0; @@ -590,7 +590,7 @@ glm = function (Matrix[Double] X, Matrix[Double] Y, Int intercept_status, Double P2_beta[1, max_selected + 1] = 0; } - beta_out = append (t(P2_ssX_beta), t(P2_beta)); + beta_out = cbind (t(P2_ssX_beta), t(P2_beta)); } else { @@ -598,7 +598,7 @@ glm = function (Matrix[Double] X, Matrix[Double] Y, Int intercept_status, Double P2_beta = colSums (P1_beta); if (max_selected < num_features_orig) { - P2_beta = append (P2_beta, matrix (0, rows=1, cols=(num_features_orig - max_selected))); + P2_beta = cbind (P2_beta, matrix (0, rows=1, cols=(num_features_orig - max_selected))); P2_beta[1, num_features_orig+1] = P2_beta[1, max_selected + 1] ; P2_beta[1, max_selected + 1] = 0; } @@ -612,7 +612,7 @@ glm = function (Matrix[Double] X, Matrix[Double] Y, Int intercept_status, Double P2_beta = colSums (P1_beta); if (max_selected < num_features_orig) { - P2_beta = append (P2_beta, matrix (0, rows=1, cols=(num_features_orig - max_selected))); + P2_beta = cbind (P2_beta, matrix (0, rows=1, cols=(num_features_orig - max_selected))); } beta_out = t(P2_beta); http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/scripts/algorithms/StepLinearRegDS.dml ---------------------------------------------------------------------- diff --git a/scripts/algorithms/StepLinearRegDS.dml b/scripts/algorithms/StepLinearRegDS.dml index 8c643c3..2efb2bb 100644 --- a/scripts/algorithms/StepLinearRegDS.dml +++ b/scripts/algorithms/StepLinearRegDS.dml @@ -155,7 +155,7 @@ if (dir == "forward") { if (as.scalar(columns_fixed[1,i]) == 0) { # Construct the feature matrix - X = append (X_global, X_orig[,i]); + X = cbind (X_global, X_orig[,i]); [AIC_2] = linear_regression (X, y, m_orig, columns_fixed_ordered, " "); AICs[1,i] = AIC_2; @@ -171,16 +171,16 @@ if (dir == "forward") { } } - # Append best found features (i.e., columns) to X_global + # cbind best found features (i.e., columns) to X_global if (as.scalar(columns_fixed[1,column_best]) == 0) { # new best feature found print ("Best AIC " + AIC_best + " achieved with feature: " + column_best); columns_fixed[1,column_best] = 1; - columns_fixed_ordered = append (columns_fixed_ordered, as.matrix(column_best)); + columns_fixed_ordered = cbind (columns_fixed_ordered, as.matrix(column_best)); if (ncol(columns_fixed_ordered) == m_orig) { # all features examined - X_global = append (X_global, X_orig[,column_best]); + X_global = cbind (X_global, X_orig[,column_best]); continue = FALSE; } else { - X_global = append (X_global, X_orig[,column_best]); + X_global = cbind (X_global, X_orig[,column_best]); } } else { continue = FALSE; @@ -210,7 +210,7 @@ linear_regression = function (Matrix[Double] X, Matrix[Double] y, Double m_orig, # Introduce the intercept, shift and rescale the columns of X if needed if (intercept_status == 1 | intercept_status == 2) { # add the intercept column ones_n = matrix (1, rows = n, cols = 1); - X = append (X, ones_n); + X = cbind (X, ones_n); m = m - 1; } m_ext = ncol(X); @@ -321,7 +321,7 @@ linear_regression = function (Matrix[Double] X, Matrix[Double] y, Double m_orig, # Prepare the output matrix print ("Writing the output matrix..."); if (intercept_status == 2) { - beta_out = append (beta, beta_unscaled); + beta_out = cbind (beta, beta_unscaled); } else { beta_out = beta; } @@ -335,7 +335,7 @@ linear_regression = function (Matrix[Double] X, Matrix[Double] y, Double m_orig, if (intercept_status != 0) { - Selected_ext = append (Selected, as.matrix (last)); + Selected_ext = cbind (Selected, as.matrix (last)); P1 = table (seq (1, ncol (Selected_ext)), t(Selected_ext)); if (intercept_status == 2) { @@ -346,8 +346,8 @@ linear_regression = function (Matrix[Double] X, Matrix[Double] y, Double m_orig, P2_beta_unscaled = colSums(P1_beta_unscaled); if (max_selected < m_orig) { - P2_beta = append (P2_beta, matrix (0, rows=1, cols=(m_orig - max_selected))); - P2_beta_unscaled = append (P2_beta_unscaled, matrix (0, rows=1, cols=(m_orig - max_selected))); + P2_beta = cbind (P2_beta, matrix (0, rows=1, cols=(m_orig - max_selected))); + P2_beta_unscaled = cbind (P2_beta_unscaled, matrix (0, rows=1, cols=(m_orig - max_selected))); P2_beta[1, m_orig+1] = P2_beta[1, max_selected + 1]; P2_beta[1, max_selected + 1] = 0; @@ -355,7 +355,7 @@ linear_regression = function (Matrix[Double] X, Matrix[Double] y, Double m_orig, P2_beta_unscaled[1, m_orig+1] = P2_beta_unscaled[1, max_selected + 1]; P2_beta_unscaled[1, max_selected + 1] = 0; } - beta_out = append (t(P2_beta), t(P2_beta_unscaled)); + beta_out = cbind (t(P2_beta), t(P2_beta_unscaled)); } else { @@ -363,7 +363,7 @@ linear_regression = function (Matrix[Double] X, Matrix[Double] y, Double m_orig, P2_beta = colSums (P1_beta); if (max_selected < m_orig) { - P2_beta = append (P2_beta, matrix (0, rows=1, cols=(m_orig - max_selected))); + P2_beta = cbind (P2_beta, matrix (0, rows=1, cols=(m_orig - max_selected))); P2_beta[1, m_orig+1] = P2_beta[1, max_selected + 1] ; P2_beta[1, max_selected + 1] = 0; } @@ -377,7 +377,7 @@ linear_regression = function (Matrix[Double] X, Matrix[Double] y, Double m_orig, P2_beta = colSums (P1_beta); if (max_selected < m_orig) { - P2_beta = append (P2_beta, matrix (0, rows=1, cols=(m_orig - max_selected))); + P2_beta = cbind (P2_beta, matrix (0, rows=1, cols=(m_orig - max_selected))); } beta_out = t(P2_beta); http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/scripts/algorithms/decision-tree.dml ---------------------------------------------------------------------- diff --git a/scripts/algorithms/decision-tree.dml b/scripts/algorithms/decision-tree.dml index 72fbc57..57728f8 100644 --- a/scripts/algorithms/decision-tree.dml +++ b/scripts/algorithms/decision-tree.dml @@ -348,7 +348,7 @@ while ((num_cur_nodes_large + num_cur_nodes_small) > 0 & level < depth) { # sort cur feature by impurity cur_distinct_values = seq (1, nrow (cur_label_counts)); - cur_distinct_values_impurity = append (cur_distinct_values, impurity); + cur_distinct_values_impurity = cbind (cur_distinct_values, impurity); cur_feature_sorted = order (target = cur_distinct_values_impurity, by = 2, decreasing = FALSE); P = table (cur_distinct_values, cur_feature_sorted); # permutation matrix label_counts_sorted = P %*% cur_label_counts; @@ -587,14 +587,14 @@ while ((num_cur_nodes_large + num_cur_nodes_small) > 0 & level < depth) { ##### PREPARE MODEL FOR LARGE NODES if (num_cur_nodes_large > 0) { cur_Q_large = removeEmpty (target = cur_Q_large, margin = "cols"); - if (as.scalar (cur_Q_large[1,1]) != 0) Q_large = append (Q_large, cur_Q_large); + if (as.scalar (cur_Q_large[1,1]) != 0) Q_large = cbind (Q_large, cur_Q_large); cur_NC_large = removeEmpty (target = cur_NC_large, margin = "cols"); - if (as.scalar (cur_NC_large[1,1]) != 0) NC_large = append (NC_large, cur_NC_large); + if (as.scalar (cur_NC_large[1,1]) != 0) NC_large = cbind (NC_large, cur_NC_large); cur_F_large = removeEmpty (target = cur_F_large, margin = "cols"); - if (as.scalar (cur_F_large[1,1]) != 0) F_large = append (F_large, cur_F_large); + if (as.scalar (cur_F_large[1,1]) != 0) F_large = cbind (F_large, cur_F_large); cur_S_large = removeEmpty (target = cur_S_large, margin = "cols"); - if (as.scalar (cur_S_large[1,1]) != 0) S_large = append (S_large, cur_S_large); + if (as.scalar (cur_S_large[1,1]) != 0) S_large = cbind (S_large, cur_S_large); num_cur_nodes_large_pre = 2 * num_cur_nodes_large; if (as.scalar (cur_Q_large[1,1]) == 0) { @@ -760,7 +760,7 @@ while ((num_cur_nodes_large + num_cur_nodes_small) > 0 & level < depth) { } # sort cur feature by impurity cur_distinct_values = seq (1, nrow (cur_label_counts)); - cur_distinct_values_impurity = append (cur_distinct_values, impurity); + cur_distinct_values_impurity = cbind (cur_distinct_values, impurity); cur_feature_sorted = order (target = cur_distinct_values_impurity, by = 2, decreasing = FALSE); P = table (cur_distinct_values, cur_feature_sorted); # permutation matrix label_counts_sorted = P %*% cur_label_counts; @@ -979,10 +979,10 @@ while ((num_cur_nodes_large + num_cur_nodes_small) > 0 & level < depth) { } cur_Q = removeEmpty (target = cur_Q, margin = "cols"); - Q = append (Q, cur_Q); - NC = append (NC, cur_NC); - F = append (F, cur_F); - S = append (S, cur_S); + Q = cbind (Q, cur_Q); + NC = cbind (NC, cur_NC); + F = cbind (F, cur_F); + S = cbind (S, cur_S); num_cur_nodes_pre = 2 * num_cur_nodes; if (as.scalar (cur_Q[1,1]) == 0) { @@ -1002,14 +1002,14 @@ while ((num_cur_nodes_large + num_cur_nodes_small) > 0 & level < depth) { ##### PREPARE MODEL FOR SMALL NODES if (num_cur_nodes_small > 0) { # small nodes already processed cur_Q_small = removeEmpty (target = cur_Q_small, margin = "cols"); - if (as.scalar (cur_Q_small[1,1]) != 0) Q_small = append (Q_small, cur_Q_small); + if (as.scalar (cur_Q_small[1,1]) != 0) Q_small = cbind (Q_small, cur_Q_small); cur_NC_small = removeEmpty (target = cur_NC_small, margin = "cols"); - if (as.scalar (cur_NC_small[1,1]) != 0) NC_small = append (NC_small, cur_NC_small); + if (as.scalar (cur_NC_small[1,1]) != 0) NC_small = cbind (NC_small, cur_NC_small); cur_F_small = removeEmpty (target = cur_F_small, margin = "cols"); - if (as.scalar (cur_F_small[1,1]) != 0) F_small = append (F_small, cur_F_small); + if (as.scalar (cur_F_small[1,1]) != 0) F_small = cbind (F_small, cur_F_small); cur_S_small = removeEmpty (target = cur_S_small, margin = "cols"); - if (as.scalar (cur_S_small[1,1]) != 0) S_small = append (S_small, cur_S_small); + if (as.scalar (cur_S_small[1,1]) != 0) S_small = cbind (S_small, cur_S_small); num_cur_nodes_small = 0; # reset } @@ -1155,7 +1155,7 @@ if (no_large_internal_node) { } else if (no_small_internal_node) { M1 = M1_large; } else { - M1 = append (M1_large, M1_small); + M1 = cbind (M1_large, M1_small); } if (no_large_leaf_node) { @@ -1163,10 +1163,10 @@ if (no_large_leaf_node) { } else if (no_small_internal_node) { M2 = M2_large; } else { - M2 = append (M2_large, M2_small); + M2 = cbind (M2_large, M2_small); } -M = append (M1, M2); +M = cbind (M1, M2); M = t (order (target = t (M), by = 1)); # removing redundant subtrees http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/scripts/algorithms/l2-svm.dml ---------------------------------------------------------------------- diff --git a/scripts/algorithms/l2-svm.dml b/scripts/algorithms/l2-svm.dml index 1117c71..a33d199 100644 --- a/scripts/algorithms/l2-svm.dml +++ b/scripts/algorithms/l2-svm.dml @@ -86,7 +86,7 @@ dimensions = ncol(X) if (intercept == 1) { ones = matrix(1, rows=num_samples, cols=1) - X = append(X, ones); + X = cbind(X, ones); } num_rows_in_w = dimensions @@ -157,7 +157,7 @@ extra_model_params[2,1] = negative_label extra_model_params[3,1] = intercept extra_model_params[4,1] = dimensions -w = t(append(t(w), t(extra_model_params))) +w = t(cbind(t(w), t(extra_model_params))) write(w, $model, format=cmdLine_fmt) logFile = $Log http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/scripts/algorithms/m-svm.dml ---------------------------------------------------------------------- diff --git a/scripts/algorithms/m-svm.dml b/scripts/algorithms/m-svm.dml index 04f8a76..8d3d5f3 100644 --- a/scripts/algorithms/m-svm.dml +++ b/scripts/algorithms/m-svm.dml @@ -82,7 +82,7 @@ num_features = ncol(X) if (intercept == 1) { ones = matrix(1, rows=num_samples, cols=1); - X = append(X, ones); + X = cbind(X, ones); } num_rows_in_w = num_features @@ -97,7 +97,7 @@ parfor(iter_class in 1:num_classes){ w_class = matrix(0, rows=num_features, cols=1) if (intercept == 1) { zero_matrix = matrix(0, rows=1, cols=1); - w_class = t(append(t(w_class), zero_matrix)); + w_class = t(cbind(t(w_class), zero_matrix)); } g_old = t(X) %*% Y_local @@ -164,7 +164,7 @@ parfor(iter_class in 1:num_classes){ extra_model_params = matrix(0, rows=2, cols=ncol(w)) extra_model_params[1, 1] = intercept extra_model_params[2, 1] = dimensions -w = t(append(t(w), t(extra_model_params))) +w = t(cbind(t(w), t(extra_model_params))) write(w, $model, format=cmdLine_fmt) debug_str = "# Class, Iter, Obj" http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/scripts/algorithms/naive-bayes-predict.dml ---------------------------------------------------------------------- diff --git a/scripts/algorithms/naive-bayes-predict.dml b/scripts/algorithms/naive-bayes-predict.dml index b687bfa..3050c4b 100644 --- a/scripts/algorithms/naive-bayes-predict.dml +++ b/scripts/algorithms/naive-bayes-predict.dml @@ -45,8 +45,8 @@ conditionals = read($conditionals) numRows = nrow(D) ones = matrix(1, rows=numRows, cols=1) -D_w_ones = append(D, ones) -model = append(conditionals, prior) +D_w_ones = cbind(D, ones) +model = cbind(conditionals, prior) log_probs = D_w_ones %*% t(log(model)) http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/scripts/algorithms/obsolete/naive-bayes-parfor.dml ---------------------------------------------------------------------- diff --git a/scripts/algorithms/obsolete/naive-bayes-parfor.dml b/scripts/algorithms/obsolete/naive-bayes-parfor.dml index b961455..115172d 100644 --- a/scripts/algorithms/obsolete/naive-bayes-parfor.dml +++ b/scripts/algorithms/obsolete/naive-bayes-parfor.dml @@ -81,8 +81,8 @@ class_prior = class_counts / numRows; # Compute accuracy on training set ones = matrix(1, rows=numRows, cols=1) -D_w_ones = append(D, ones) -model = append(class_conditionals, class_prior) +D_w_ones = cbind(D, ones) +model = cbind(class_conditionals, class_prior) log_probs = D_w_ones %*% t(log(model)) pred = rowIndexMax(log_probs) acc = sum(pred == C) / numRows * 100 @@ -93,7 +93,7 @@ write(acc_str, $accuracy) extra_model_params = matrix(0, rows=1, cols=1) extra_model_params[1, 1] = numFeatures -class_prior = t(append(t(class_prior), extra_model_params)) +class_prior = t(cbind(t(class_prior), extra_model_params)) # write out the model write(class_prior, $prior, format=cmdLine_fmt); http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/scripts/algorithms/random-forest.dml ---------------------------------------------------------------------- diff --git a/scripts/algorithms/random-forest.dml b/scripts/algorithms/random-forest.dml index 6fd501e..3cdb034 100644 --- a/scripts/algorithms/random-forest.dml +++ b/scripts/algorithms/random-forest.dml @@ -413,7 +413,7 @@ while ((num_cur_nodes_large + num_cur_nodes_small) > 0 & level < depth) { # sort cur feature by impurity cur_distinct_values = seq (1, nrow (cur_label_counts)); - cur_distinct_values_impurity = append (cur_distinct_values, impurity); + cur_distinct_values_impurity = cbind (cur_distinct_values, impurity); cur_feature_sorted = order (target = cur_distinct_values_impurity, by = 2, decreasing = FALSE); P = table (cur_distinct_values, cur_feature_sorted); # permutation matrix label_counts_sorted = P %*% cur_label_counts; @@ -671,14 +671,14 @@ while ((num_cur_nodes_large + num_cur_nodes_small) > 0 & level < depth) { ##### PREPARE MODEL FOR LARGE NODES if (num_cur_nodes_large > 0) { cur_Q_large = removeEmpty (target = cur_Q_large, margin = "cols"); - if (as.scalar (cur_Q_large[1,1]) != 0) Q_large = append (Q_large, cur_Q_large); + if (as.scalar (cur_Q_large[1,1]) != 0) Q_large = cbind (Q_large, cur_Q_large); cur_NC_large = removeEmpty (target = cur_NC_large, margin = "cols"); - if (as.scalar (cur_NC_large[1,1]) != 0) NC_large = append (NC_large, cur_NC_large); + if (as.scalar (cur_NC_large[1,1]) != 0) NC_large = cbind (NC_large, cur_NC_large); cur_F_large = removeEmpty (target = cur_F_large, margin = "cols"); - if (as.scalar (cur_F_large[1,1]) != 0) F_large = append (F_large, cur_F_large); + if (as.scalar (cur_F_large[1,1]) != 0) F_large = cbind (F_large, cur_F_large); cur_S_large = removeEmpty (target = cur_S_large, margin = "cols"); - if (as.scalar (cur_S_large[1,1]) != 0) S_large = append (S_large, cur_S_large); + if (as.scalar (cur_S_large[1,1]) != 0) S_large = cbind (S_large, cur_S_large); num_cur_nodes_large_pre = 2 * num_cur_nodes_large; if (as.scalar (cur_Q_large[1,1]) == 0) { @@ -891,7 +891,7 @@ while ((num_cur_nodes_large + num_cur_nodes_small) > 0 & level < depth) { # sort cur feature by impurity cur_distinct_values = seq (1, nrow (cur_label_counts)); - cur_distinct_values_impurity = append (cur_distinct_values, impurity); + cur_distinct_values_impurity = cbind (cur_distinct_values, impurity); cur_feature_sorted = order (target = cur_distinct_values_impurity, by = 2, decreasing = FALSE); P = table (cur_distinct_values, cur_feature_sorted); # permutation matrix label_counts_sorted = P %*% cur_label_counts; @@ -1128,10 +1128,10 @@ while ((num_cur_nodes_large + num_cur_nodes_small) > 0 & level < depth) { } cur_Q = removeEmpty (target = cur_Q, margin = "cols"); - Q = append (Q, cur_Q); - NC = append (NC, cur_NC); - F = append (F, cur_F); - S = append (S, cur_S); + Q = cbind (Q, cur_Q); + NC = cbind (NC, cur_NC); + F = cbind (F, cur_F); + S = cbind (S, cur_S); num_cur_nodes_pre = 2 * num_cur_nodes; if (as.scalar (cur_Q[1,1]) == 0) { @@ -1151,14 +1151,14 @@ while ((num_cur_nodes_large + num_cur_nodes_small) > 0 & level < depth) { ##### PREPARE MODEL FOR SMALL NODES if (num_cur_nodes_small > 0) { # small nodes already processed cur_Q_small = removeEmpty (target = cur_Q_small, margin = "cols"); - if (as.scalar (cur_Q_small[1,1]) != 0) Q_small = append (Q_small, cur_Q_small); + if (as.scalar (cur_Q_small[1,1]) != 0) Q_small = cbind (Q_small, cur_Q_small); cur_NC_small = removeEmpty (target = cur_NC_small, margin = "cols"); - if (as.scalar (cur_NC_small[1,1]) != 0) NC_small = append (NC_small, cur_NC_small); + if (as.scalar (cur_NC_small[1,1]) != 0) NC_small = cbind (NC_small, cur_NC_small); cur_F_small = removeEmpty (target = cur_F_small, margin = "cols"); # - if (as.scalar (cur_F_small[1,1]) != 0) F_small = append (F_small, cur_F_small); + if (as.scalar (cur_F_small[1,1]) != 0) F_small = cbind (F_small, cur_F_small); cur_S_small = removeEmpty (target = cur_S_small, margin = "cols"); # - if (as.scalar (cur_S_small[1,1]) != 0) S_small = append (S_small, cur_S_small); + if (as.scalar (cur_S_small[1,1]) != 0) S_small = cbind (S_small, cur_S_small); num_cur_nodes_small = 0; # reset } @@ -1294,7 +1294,7 @@ if (no_large_internal_node) { } else if (no_small_internal_node) { M1 = M1_large; } else { - M1 = append (M1_large, M1_small); + M1 = cbind (M1_large, M1_small); } if (no_large_leaf_node) { @@ -1302,10 +1302,10 @@ if (no_large_leaf_node) { } else if (no_small_leaf_node) { M2 = M2_large; } else { - M2 = append (M2_large, M2_small); + M2 = cbind (M2_large, M2_small); } -M = append (M1, M2); +M = cbind (M1, M2); M = t (order (target = t (M), by = 1)); # sort by node id M = t (order (target = t (M), by = 2)); # sort by tree id http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/scripts/datagen/genLinearRegressionData.dml ---------------------------------------------------------------------- diff --git a/scripts/datagen/genLinearRegressionData.dml b/scripts/datagen/genLinearRegressionData.dml index 00ac55d..10b094c 100644 --- a/scripts/datagen/genLinearRegressionData.dml +++ b/scripts/datagen/genLinearRegressionData.dml @@ -67,5 +67,5 @@ if ($addNoise == TRUE) { Y = Y + noise } -Z = append(X,Y) +Z = cbind(X,Y) write(Z, $output, format=$format) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/scripts/datagen/genRandData4DecisionTree2.dml ---------------------------------------------------------------------- diff --git a/scripts/datagen/genRandData4DecisionTree2.dml b/scripts/datagen/genRandData4DecisionTree2.dml index e71bedb..7159249 100644 --- a/scripts/datagen/genRandData4DecisionTree2.dml +++ b/scripts/datagen/genRandData4DecisionTree2.dml @@ -37,5 +37,5 @@ XCF = read (XCatFile); specJson = read(transformSpec, data_type="scalar", value_type="string"); X_cat_transformed = transform (target = XCF, spec = specJson, transformPath = transformPath); -X = append (X_scale, X_cat_transformed); +X = cbind (X_scale, X_cat_transformed); write (X, XFile, format = fmt); http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/scripts/datagen/genRandData4LinearRegression.dml ---------------------------------------------------------------------- diff --git a/scripts/datagen/genRandData4LinearRegression.dml b/scripts/datagen/genRandData4LinearRegression.dml index b257804..2ef707f 100644 --- a/scripts/datagen/genRandData4LinearRegression.dml +++ b/scripts/datagen/genRandData4LinearRegression.dml @@ -49,7 +49,7 @@ Y = X %*% w if(b!=0) { b_mat = Rand(rows=1, cols=1, min=b, max=b, pdf="uniform") - w = t(append(t(w), b_mat)) + w = t(cbind(t(w), b_mat)) Y = Y + b } http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/scripts/datagen/genRandData4LogisticRegression.dml ---------------------------------------------------------------------- diff --git a/scripts/datagen/genRandData4LogisticRegression.dml b/scripts/datagen/genRandData4LogisticRegression.dml index 98a7b98..fa2bc68 100644 --- a/scripts/datagen/genRandData4LogisticRegression.dml +++ b/scripts/datagen/genRandData4LogisticRegression.dml @@ -50,7 +50,7 @@ w = w * maxWeight ot=X%*%w if(b!=0) { b_mat = Rand(rows=1, cols=1, min=b, max=b, pdf="uniform") - w = t(append(t(w), b_mat)) + w = t(cbind(t(w), b_mat)) ot = ot + b } http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/scripts/datagen/genRandData4MultiClassSVM.dml ---------------------------------------------------------------------- diff --git a/scripts/datagen/genRandData4MultiClassSVM.dml b/scripts/datagen/genRandData4MultiClassSVM.dml index afa86e8..011b4da 100644 --- a/scripts/datagen/genRandData4MultiClassSVM.dml +++ b/scripts/datagen/genRandData4MultiClassSVM.dml @@ -48,7 +48,7 @@ w = w * maxWeight ot = X%*%w if(b!=0) { b_mat = Rand(rows=1, cols=1, min=b, max=b, pdf="uniform") - w = t(append(t(w), b_mat)) + w = t(cbind(t(w), b_mat)) ot = ot + b } http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/scripts/datagen/genRandData4StratStats.dml ---------------------------------------------------------------------- diff --git a/scripts/datagen/genRandData4StratStats.dml b/scripts/datagen/genRandData4StratStats.dml index 1bca453..fb2aae0 100644 --- a/scripts/datagen/genRandData4StratStats.dml +++ b/scripts/datagen/genRandData4StratStats.dml @@ -132,21 +132,21 @@ RY_records = Rand (rows = num_features, cols = num_records, pdf = "normal"); # t_X = RX_records * stdev_X_within_strata + (RX_strata * stdev_X_between_strata + mean_X) %*% Smap; t_Y = RY_records * stdev_Y_within_strata + (RY_strata * stdev_Y_between_strata + mean_Y) %*% Smap + (t_X * betas); -Data = append (append (min_stratumID - 1 + SID, t(t_X)), t(t_Y)); +Data = cbind (cbind (min_stratumID - 1 + SID, t(t_X)), t(t_Y)); # Set up the NaNs RNaNS = Rand (rows = num_records, cols = 1, min = 1.0, max = 1.0, sparsity = prob_NaN_in_stratum); RNaNX = Rand (rows = num_records, cols = num_features, min = 1.0, max = 1.0, sparsity = prob_NaN_in_X); RNaNY = Rand (rows = num_records, cols = num_features, min = 1.0, max = 1.0, sparsity = prob_NaN_in_Y); -Mask = (append (append (RNaNS, RNaNX), RNaNY)) != 0; +Mask = (cbind (cbind (RNaNS, RNaNX), RNaNY)) != 0; Data = Data + (1.0 - Mask) / (1.0 - Mask); # Output the dataset and the auxiliaries Xcid = t(seq (2, num_features + 1, 1)); Ycid = t(seq (num_features + 2, 2 * num_features + 1, 1)); -Aux = append (append (mean_X, mean_Y), betas); +Aux = cbind (cbind (mean_X, mean_Y), betas); write (Data, fileData, format=fmt); write (Xcid, fileXcid, format=fmt); http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/scripts/datagen/genRandData4SurvAnalysis.dml ---------------------------------------------------------------------- diff --git a/scripts/datagen/genRandData4SurvAnalysis.dml b/scripts/datagen/genRandData4SurvAnalysis.dml index da94a22..276c95c 100644 --- a/scripts/datagen/genRandData4SurvAnalysis.dml +++ b/scripts/datagen/genRandData4SurvAnalysis.dml @@ -118,7 +118,7 @@ T = ceil (T / num_bins); # print ("min(T) " + min(T) + " max(T) " + max(T)); Y[,1] = T; -O = append (Y, X); +O = cbind (Y, X); write (O, fileO, format = fmtO); if (type == "cox") { http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/scripts/datagen/genRandData4Transform.dml ---------------------------------------------------------------------- diff --git a/scripts/datagen/genRandData4Transform.dml b/scripts/datagen/genRandData4Transform.dml index 6a44299..edab7c2 100644 --- a/scripts/datagen/genRandData4Transform.dml +++ b/scripts/datagen/genRandData4Transform.dml @@ -67,10 +67,10 @@ num_scalar_cols = sum(scalar_ind) scalar_X = Rand(rows=num_rows, cols=num_scalar_cols, min=0, max=1, pdf="uniform") if(num_categorical_cols > 0 & num_scalar_cols > 0){ - X = append(scalar_X, categorical_X) + X = cbind(scalar_X, categorical_X) permut_mat = table(seq(1, num_scalar_cols, 1), scalar_col_ids, num_scalar_cols, num_cols) fill_in = matrix(0, rows=num_cols-num_scalar_cols, cols=num_cols) - permut_mat = t(append(t(permut_mat), t(fill_in))) + permut_mat = t(cbind(t(permut_mat), t(fill_in))) X = X %*% permut_mat }else{ if(num_categorical_cols > 0) X = categorical_X @@ -88,7 +88,7 @@ if(prob_missing_col > 0){ missing_col_ids = removeEmpty(target=seq(1, num_cols, 1)*missing_col_ind, margin="rows") missing_values = Rand(rows=num_rows, cols=nrow(missing_col_ids), min=0, max=1, pdf="uniform") missing_values = missing_values < prob_missing_val - X = append(X, missing_values) + X = cbind(X, missing_values) write(missing_col_ids, $out_missing, format="csv") } http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/scripts/staging/knn.dml ---------------------------------------------------------------------- diff --git a/scripts/staging/knn.dml b/scripts/staging/knn.dml index e5cc366..42ac767 100644 --- a/scripts/staging/knn.dml +++ b/scripts/staging/knn.dml @@ -297,7 +297,7 @@ naiveKNNsearchForPredict = function( } else { OL = matrix (0, rows = num_queries, cols = K); parfor (i in 1:num_queries) { - D_sorted=order(target=append(D[,i],L), by=1, decreasing=FALSE, index.return=FALSE); + D_sorted=order(target=cbind(D[,i],L), by=1, decreasing=FALSE, index.return=FALSE); OL[i,] = t(D_sorted[1:K,2]); } } @@ -491,7 +491,7 @@ return( print( "Get k, which value is " + k ); }else{ m_err_for_order = - append( t( m_iter_err_sum ), matrix( seq( k_min,k_max,1 ),k_max-k_min+1,1 ) ); + cbind( t( m_iter_err_sum ), matrix( seq( k_min,k_max,1 ),k_max-k_min+1,1 ) ); m_err_for_order = removeEmpty( target=m_err_for_order * t( m_active_flag == 0 ),margin="rows" ); for( i in 1:nrow( m_err_for_order ) ){ @@ -606,7 +606,7 @@ return( } parfor( i in 1:i_n_column ,check=0){ if( as.scalar( m_feature_selected_flag[1,i] ) != 1 ){ - m_tmp_process_data = append( m_tmp_data,in_m_data[,i] ); + m_tmp_process_data = cbind( m_tmp_data,in_m_data[,i] ); m_neighbor_value = getKNeighbor( m_tmp_process_data,m_tmp_process_data[i_process_begin_item:i_process_end_item,],in_m_data_target,k_value ); m_tmp_err = getErr( @@ -616,9 +616,9 @@ return( } } if( m_this_model_selected_flag == TRUE ){ - m_active_flag_tmp = append( m_feature_selected_flag,matrix( 0,1,1 ) ); + m_active_flag_tmp = cbind( m_feature_selected_flag,matrix( 0,1,1 ) ); }else{ - m_active_flag_tmp = append( m_feature_selected_flag,matrix( 1,1,1 ) ); + m_active_flag_tmp = cbind( m_feature_selected_flag,matrix( 1,1,1 ) ); } s_rows_number = i_process_item#nrow(m_err); http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/scripts/utils/splitXY-dummy.dml ---------------------------------------------------------------------- diff --git a/scripts/utils/splitXY-dummy.dml b/scripts/utils/splitXY-dummy.dml index 2ec420d..c3fe8f4 100644 --- a/scripts/utils/splitXY-dummy.dml +++ b/scripts/utils/splitXY-dummy.dml @@ -56,7 +56,7 @@ else { OX1 = X[,1:S-1] OX2 = X[,S+N:nc] - OX = append (OX1, OX2) + OX = cbind (OX1, OX2) OY = X[,S:S+N-1] } http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/scripts/utils/splitXY.dml ---------------------------------------------------------------------- diff --git a/scripts/utils/splitXY.dml b/scripts/utils/splitXY.dml index 82027a4..7630988 100644 --- a/scripts/utils/splitXY.dml +++ b/scripts/utils/splitXY.dml @@ -51,7 +51,7 @@ else { OX1 = X[,1:y-1] OX2 = X[,y+1:ncol(X)] - OX = append (OX1, OX2) + OX = cbind (OX1, OX2) OY = X[,y] } http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/applications/glm/GLM.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/applications/glm/GLM.dml b/src/test/scripts/applications/glm/GLM.dml index 16008e6..dd5163d 100644 --- a/src/test/scripts/applications/glm/GLM.dml +++ b/src/test/scripts/applications/glm/GLM.dml @@ -184,7 +184,7 @@ ones_r = 1 + zeros_r; if (intercept_status == 1 | intercept_status == 2) # add the intercept column { - X = append (X, ones_r); + X = cbind (X, ones_r); num_features = ncol (X); } @@ -234,7 +234,7 @@ if (max_iteration_CG == 0) { if (distribution_type == 2 & ncol(Y) == 1) { is_Y_negative = ppred (Y, bernoulli_No_label, "=="); - Y = append (1 - is_Y_negative, is_Y_negative); + Y = cbind (1 - is_Y_negative, is_Y_negative); count_Y_negative = sum (is_Y_negative); if (count_Y_negative == 0) { stop ("GLM Input Error: all Y-values encode Bernoulli YES-label, none encode NO-label"); @@ -445,7 +445,7 @@ if (termination_code == 1) { ssX_beta = diag (scale_X) %*% beta; ssX_beta [num_features, ] = ssX_beta [num_features, ] + t(shift_X) %*% beta; if (intercept_status == 2) { - beta_out = append (ssX_beta, beta); + beta_out = cbind (ssX_beta, beta); } else { beta_out = ssX_beta; } http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/applications/glm/GLM.pydml ---------------------------------------------------------------------- diff --git a/src/test/scripts/applications/glm/GLM.pydml b/src/test/scripts/applications/glm/GLM.pydml index 5e7269d..5f8be13 100644 --- a/src/test/scripts/applications/glm/GLM.pydml +++ b/src/test/scripts/applications/glm/GLM.pydml @@ -184,7 +184,7 @@ ones_r = 1 + zeros_r # Introduce the intercept, shift and rescale the columns of X if needed if (intercept_status == 1 | intercept_status == 2): # add the intercept column - X = append (X, ones_r) + X = cbind (X, ones_r) num_features = ncol (X) scale_lambda = full (1, rows = num_features, cols = 1) @@ -228,7 +228,7 @@ if (max_iteration_CG == 0): if (distribution_type == 2 & ncol(Y) == 1): is_Y_negative = ppred (Y, bernoulli_No_label, "==") - Y = append (1 - is_Y_negative, is_Y_negative) + Y = cbind (1 - is_Y_negative, is_Y_negative) count_Y_negative = sum (is_Y_negative) if (count_Y_negative == 0): stop ("GLM Input Error: all Y-values encode Bernoulli YES-label, none encode NO-label") @@ -427,7 +427,7 @@ if (is_supported == 1): ssX_beta = dot(diag (scale_X), beta) ssX_beta [num_features-1, ] = ssX_beta [num_features-1, ] + dot(transpose(shift_X), beta) if (intercept_status == 2): - beta_out = append (ssX_beta, beta) + beta_out = cbind (ssX_beta, beta) else: beta_out = ssX_beta http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/applications/l2svm/L2SVM.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/applications/l2svm/L2SVM.dml b/src/test/scripts/applications/l2svm/L2SVM.dml index 13f2b4c..d546d9a 100644 --- a/src/test/scripts/applications/l2svm/L2SVM.dml +++ b/src/test/scripts/applications/l2svm/L2SVM.dml @@ -58,7 +58,7 @@ dimensions = ncol(X) if (intercept == 1) { ones = matrix(1, rows=num_samples, cols=1) - X = append(X, ones); + X = cbind(X, ones); } num_rows_in_w = dimensions http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/applications/l2svm/L2SVM.pydml ---------------------------------------------------------------------- diff --git a/src/test/scripts/applications/l2svm/L2SVM.pydml b/src/test/scripts/applications/l2svm/L2SVM.pydml index 119ff44..b28e584 100644 --- a/src/test/scripts/applications/l2svm/L2SVM.pydml +++ b/src/test/scripts/applications/l2svm/L2SVM.pydml @@ -58,7 +58,7 @@ dimensions = ncol(X) if (intercept == 1): ones = full(1, rows=num_samples, cols=1) - X = append(X, ones) + X = cbind(X, ones) num_rows_in_w = dimensions if(intercept == 1): http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/applications/m-svm/m-svm.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/applications/m-svm/m-svm.dml b/src/test/scripts/applications/m-svm/m-svm.dml index 7b2828f..439002c 100644 --- a/src/test/scripts/applications/m-svm/m-svm.dml +++ b/src/test/scripts/applications/m-svm/m-svm.dml @@ -56,7 +56,7 @@ if(check_X == 0){ if (intercept == 1) { ones = matrix(1, rows=num_samples, cols=1); - X = append(X, ones); + X = cbind(X, ones); } num_rows_in_w = num_features @@ -71,7 +71,7 @@ if(check_X == 0){ w_class = matrix(0, rows=num_features, cols=1) if (intercept == 1) { zero_matrix = matrix(0, rows=1, cols=1); - w_class = t(append(t(w_class), zero_matrix)); + w_class = t(cbind(t(w_class), zero_matrix)); } g_old = t(X) %*% Y_local http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/applications/m-svm/m-svm.pydml ---------------------------------------------------------------------- diff --git a/src/test/scripts/applications/m-svm/m-svm.pydml b/src/test/scripts/applications/m-svm/m-svm.pydml index 5ae350f..8c01806 100644 --- a/src/test/scripts/applications/m-svm/m-svm.pydml +++ b/src/test/scripts/applications/m-svm/m-svm.pydml @@ -56,7 +56,7 @@ else: if (intercept == 1): ones = full(1, rows=num_samples, cols=1) - X = append(X, ones) + X = cbind(X, ones) num_rows_in_w = num_features if(intercept == 1): @@ -69,7 +69,7 @@ else: w_class = full(0, rows=num_features, cols=1) if (intercept == 1): zero_matrix = full(0, rows=1, cols=1) - w_class = transpose(append(transpose(w_class), zero_matrix)) + w_class = transpose(cbind(transpose(w_class), zero_matrix)) g_old = dot(transpose(X), Y_local) s = g_old http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/applications/naive-bayes-parfor/naive-bayes.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/applications/naive-bayes-parfor/naive-bayes.dml b/src/test/scripts/applications/naive-bayes-parfor/naive-bayes.dml index 77df03b..83ddbf7 100644 --- a/src/test/scripts/applications/naive-bayes-parfor/naive-bayes.dml +++ b/src/test/scripts/applications/naive-bayes-parfor/naive-bayes.dml @@ -63,8 +63,8 @@ class_prior = class_counts / numRows; # Compute accuracy on training set ones = matrix(1, rows=numRows, cols=1) -D_w_ones = append(D, ones) -model = append(class_conditionals, class_prior) +D_w_ones = cbind(D, ones) +model = cbind(class_conditionals, class_prior) log_probs = D_w_ones %*% t(log(model)) pred = rowIndexMax(log_probs) acc = sum(ppred(pred, C, "==")) / numRows * 100 http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/applications/naive-bayes-parfor/naive-bayes.pydml ---------------------------------------------------------------------- diff --git a/src/test/scripts/applications/naive-bayes-parfor/naive-bayes.pydml b/src/test/scripts/applications/naive-bayes-parfor/naive-bayes.pydml index 45e4700..58a23c6 100644 --- a/src/test/scripts/applications/naive-bayes-parfor/naive-bayes.pydml +++ b/src/test/scripts/applications/naive-bayes-parfor/naive-bayes.pydml @@ -62,8 +62,8 @@ class_prior = class_counts / numRows # Compute accuracy on training set ones = full(1, rows=numRows, cols=1) -D_w_ones = append(D, ones) -model = append(class_conditionals, class_prior) +D_w_ones = cbind(D, ones) +model = cbind(class_conditionals, class_prior) log_model = log(model) transpose_log_model = log_model.transpose() log_probs = dot(D_w_ones, transpose_log_model) http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/applications/parfor/parfor_cv_multiclasssvm0.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/applications/parfor/parfor_cv_multiclasssvm0.dml b/src/test/scripts/applications/parfor/parfor_cv_multiclasssvm0.dml index 173826a..9c0ca9c 100644 --- a/src/test/scripts/applications/parfor/parfor_cv_multiclasssvm0.dml +++ b/src/test/scripts/applications/parfor/parfor_cv_multiclasssvm0.dml @@ -57,11 +57,11 @@ for( i in 1:k ) yi = y * vPxi; # Create the labels for the TEST set nXi = X - Xi; # Create the TRAINING set with (k-1)/k of the rows nyi = y - yi; # Create the labels for the TRAINING set - Xyi = append(Xi,yi); #keep alignment on removeEmpty + Xyi = cbind(Xi,yi); #keep alignment on removeEmpty Xyi = removeEmpty( target=Xyi, margin="rows" ); Xi = Xyi[ , 1:n]; yi = Xyi[ , n+1]; - nXyi = append(nXi,nyi); #keep alignment on removeEmpty + nXyi = cbind(nXi,nyi); #keep alignment on removeEmpty nXyi = removeEmpty( target=nXyi, margin="rows" ); nXi = nXyi[ , 1:n]; nyi = nXyi[ , n+1]; @@ -137,7 +137,7 @@ multiClassSVM = function (Matrix[double] X, Matrix[double] Y, Integer intercept, if (intercept == 1) { ones = matrix( 1, rows=num_samples, cols=1 ); - X = append( X, ones); + X = cbind( X, ones); } iter_class = 1 @@ -147,7 +147,7 @@ multiClassSVM = function (Matrix[double] X, Matrix[double] Y, Integer intercept, if (intercept == 1) { zero_matrix = matrix( 0, rows=1, cols=1 ); - w_class = t( append( t( w_class), zero_matrix)); + w_class = t( cbind( t( w_class), zero_matrix)); } g_old = t(X) %*% Y_local @@ -210,7 +210,7 @@ multiClassSVM = function (Matrix[double] X, Matrix[double] Y, Integer intercept, w_class = matrix(0, rows=ncol(X), cols=1) if (intercept == 1) { zero_matrix = matrix(0, rows=1, cols=1); - w_class = t(append(t(w_class), zero_matrix)); + w_class = t(cbind(t(w_class), zero_matrix)); } g_old = t(X) %*% Y_local @@ -264,7 +264,7 @@ multiClassSVM = function (Matrix[double] X, Matrix[double] Y, Integer intercept, iter = iter + 1 } - w = append(w, w_class) + w = cbind(w, w_class) iter_class = iter_class + 1 } ret_W = w http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/applications/parfor/parfor_cv_multiclasssvm1.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/applications/parfor/parfor_cv_multiclasssvm1.dml b/src/test/scripts/applications/parfor/parfor_cv_multiclasssvm1.dml index d8b2218..1dc2a34 100644 --- a/src/test/scripts/applications/parfor/parfor_cv_multiclasssvm1.dml +++ b/src/test/scripts/applications/parfor/parfor_cv_multiclasssvm1.dml @@ -57,11 +57,11 @@ parfor( i in 1:k, par=4, mode=LOCAL, opt=NONE ) yi = y * vPxi; # Create the labels for the TEST set nXi = X - Xi; # Create the TRAINING set with (k-1)/k of the rows nyi = y - yi; # Create the labels for the TRAINING set - Xyi = append(Xi,yi); #keep alignment on removeEmpty + Xyi = cbind(Xi,yi); #keep alignment on removeEmpty Xyi = removeEmpty( target=Xyi, margin="rows" ); Xi = Xyi[ , 1:n]; yi = Xyi[ , n+1]; - nXyi = append(nXi,nyi); #keep alignment on removeEmpty + nXyi = cbind(nXi,nyi); #keep alignment on removeEmpty nXyi = removeEmpty( target=nXyi, margin="rows" ); nXi = nXyi[ , 1:n]; nyi = nXyi[ , n+1]; @@ -137,7 +137,7 @@ multiClassSVM = function (Matrix[double] X, Matrix[double] Y, Integer intercept, if (intercept == 1) { ones = matrix( 1, rows=num_samples, cols=1 ); - X = append( X, ones); + X = cbind( X, ones); } iter_class = 1 @@ -147,7 +147,7 @@ multiClassSVM = function (Matrix[double] X, Matrix[double] Y, Integer intercept, if (intercept == 1) { zero_matrix = matrix( 0, rows=1, cols=1 ); - w_class = t( append( t( w_class), zero_matrix)); + w_class = t( cbind( t( w_class), zero_matrix)); } g_old = t(X) %*% Y_local @@ -210,7 +210,7 @@ multiClassSVM = function (Matrix[double] X, Matrix[double] Y, Integer intercept, w_class = matrix(0, rows=ncol(X), cols=1) if (intercept == 1) { zero_matrix = matrix(0, rows=1, cols=1); - w_class = t(append(t(w_class), zero_matrix)); + w_class = t(cbind(t(w_class), zero_matrix)); } g_old = t(X) %*% Y_local @@ -264,7 +264,7 @@ multiClassSVM = function (Matrix[double] X, Matrix[double] Y, Integer intercept, iter = iter + 1 } - w = append(w, w_class) + w = cbind(w, w_class) iter_class = iter_class + 1 } ret_W = w http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/applications/parfor/parfor_cv_multiclasssvm4.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/applications/parfor/parfor_cv_multiclasssvm4.dml b/src/test/scripts/applications/parfor/parfor_cv_multiclasssvm4.dml index 8e6e4f1..b94f168 100644 --- a/src/test/scripts/applications/parfor/parfor_cv_multiclasssvm4.dml +++ b/src/test/scripts/applications/parfor/parfor_cv_multiclasssvm4.dml @@ -57,11 +57,11 @@ parfor( i in 1:k ) yi = y * vPxi; # Create the labels for the TEST set nXi = X - Xi; # Create the TRAINING set with (k-1)/k of the rows nyi = y - yi; # Create the labels for the TRAINING set - Xyi = append(Xi,yi); #keep alignment on removeEmpty + Xyi = cbind(Xi,yi); #keep alignment on removeEmpty Xyi = removeEmpty( target=Xyi, margin="rows" ); Xi = Xyi[ , 1:n]; yi = Xyi[ , n+1]; - nXyi = append(nXi,nyi); #keep alignment on removeEmpty + nXyi = cbind(nXi,nyi); #keep alignment on removeEmpty nXyi = removeEmpty( target=nXyi, margin="rows" ); nXi = nXyi[ , 1:n]; nyi = nXyi[ , n+1]; @@ -137,7 +137,7 @@ multiClassSVM = function (Matrix[double] X, Matrix[double] Y, Integer intercept, if (intercept == 1) { ones = matrix( 1, rows=num_samples, cols=1 ); - X = append( X, ones); + X = cbind( X, ones); } iter_class = 1 @@ -147,7 +147,7 @@ multiClassSVM = function (Matrix[double] X, Matrix[double] Y, Integer intercept, if (intercept == 1) { zero_matrix = matrix( 0, rows=1, cols=1 ); - w_class = t( append( t( w_class), zero_matrix)); + w_class = t( cbind( t( w_class), zero_matrix)); } g_old = t(X) %*% Y_local @@ -210,7 +210,7 @@ multiClassSVM = function (Matrix[double] X, Matrix[double] Y, Integer intercept, w_class = matrix(0, rows=ncol(X), cols=1) if (intercept == 1) { zero_matrix = matrix(0, rows=1, cols=1); - w_class = t(append(t(w_class), zero_matrix)); + w_class = t(cbind(t(w_class), zero_matrix)); } g_old = t(X) %*% Y_local @@ -264,7 +264,7 @@ multiClassSVM = function (Matrix[double] X, Matrix[double] Y, Integer intercept, iter = iter + 1 } - w = append(w, w_class) + w = cbind(w, w_class) iter_class = iter_class + 1 } ret_W = w http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/applications/validation/CV_LogisticRegression.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/applications/validation/CV_LogisticRegression.dml b/src/test/scripts/applications/validation/CV_LogisticRegression.dml index d91a3f7..191e6d1 100644 --- a/src/test/scripts/applications/validation/CV_LogisticRegression.dml +++ b/src/test/scripts/applications/validation/CV_LogisticRegression.dml @@ -70,11 +70,11 @@ parfor( i in 1:k ) yi = y * vPxi; # Create the labels for the TEST set nXi = X - Xi; # Create the TRAINING set with (k-1)/k of the rows nyi = y - yi; # Create the labels for the TRAINING set - Xyi = append(Xi,yi); #keep alignment on removeEmpty + Xyi = cbind(Xi,yi); #keep alignment on removeEmpty Xyi = removeEmpty( target=Xyi, margin="rows" ); Xi = Xyi[ , 1:n]; yi = Xyi[ , n+1]; - nXyi = append(nXi,nyi); #keep alignment on removeEmpty + nXyi = cbind(nXi,nyi); #keep alignment on removeEmpty nXyi = removeEmpty( target=nXyi, margin="rows" ); nXi = nXyi[ , 1:n]; nyi = nXyi[ , n+1]; @@ -118,10 +118,10 @@ logisticRegression = function (Matrix[double] X, Matrix[double] y, Integer in_in if (intercept == 1) { num_samples = nrow(X); ones = Rand(rows=num_samples, cols=1, min=1, max=1, pdf="uniform"); - X = append(X, ones); + X = cbind(X, ones); zero_matrix = Rand(rows=1, cols=1, min=0.0, max=0.0); - w = t(append(t(w), zero_matrix)); - zeros_D = t(append(t(zeros_D), zero_matrix)); + w = t(cbind(t(w), zero_matrix)); + zeros_D = t(cbind(t(zeros_D), zero_matrix)); } N = nrow(X) http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/applications/validation/CV_MultiClassSVM.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/applications/validation/CV_MultiClassSVM.dml b/src/test/scripts/applications/validation/CV_MultiClassSVM.dml index 218b38b..83e45de 100644 --- a/src/test/scripts/applications/validation/CV_MultiClassSVM.dml +++ b/src/test/scripts/applications/validation/CV_MultiClassSVM.dml @@ -65,11 +65,11 @@ parfor( i in 1:k ) yi = y * vPxi; # Create the labels for the TEST set nXi = X - Xi; # Create the TRAINING set with (k-1)/k of the rows nyi = y - yi; # Create the labels for the TRAINING set - Xyi = append(Xi,yi); #keep alignment on removeEmpty + Xyi = cbind(Xi,yi); #keep alignment on removeEmpty Xyi = removeEmpty( target=Xyi, margin="rows" ); Xi = Xyi[ , 1:n]; yi = Xyi[ , n+1]; - nXyi = append(nXi,nyi); #keep alignment on removeEmpty + nXyi = cbind(nXi,nyi); #keep alignment on removeEmpty nXyi = removeEmpty( target=nXyi, margin="rows" ); nXi = nXyi[ , 1:n]; nyi = nXyi[ , n+1]; @@ -144,7 +144,7 @@ multiClassSVM = function (Matrix[double] X, Matrix[double] Y, Integer intercept, if (intercept == 1) { ones = Rand( rows=num_samples, cols=1, min=1, max=1, pdf="uniform"); - X = append( X, ones); + X = cbind( X, ones); } iter_class = 1 @@ -154,7 +154,7 @@ multiClassSVM = function (Matrix[double] X, Matrix[double] Y, Integer intercept, if (intercept == 1) { zero_matrix = Rand( rows=1, cols=1, min=0.0, max=0.0); - w_class = t( append( t( w_class), zero_matrix)); + w_class = t( cbind( t( w_class), zero_matrix)); } g_old = t(X) %*% Y_local @@ -218,7 +218,7 @@ multiClassSVM = function (Matrix[double] X, Matrix[double] Y, Integer intercept, w_class = Rand(rows=ncol(X), cols=1, min=0, max=0, pdf="uniform") if (intercept == 1) { zero_matrix = Rand(rows=1, cols=1, min=0.0, max=0.0); - w_class = t(append(t(w_class), zero_matrix)); + w_class = t(cbind(t(w_class), zero_matrix)); } g_old = t(X) %*% Y_local @@ -272,7 +272,7 @@ multiClassSVM = function (Matrix[double] X, Matrix[double] Y, Integer intercept, iter = iter + 1 } - w = append(w, w_class) + w = cbind(w, w_class) iter_class = iter_class + 1 } ret_W = w http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/applications/validation/CV_MultiClassSVM.sasha.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/applications/validation/CV_MultiClassSVM.sasha.dml b/src/test/scripts/applications/validation/CV_MultiClassSVM.sasha.dml index a3099d6..e62d411 100644 --- a/src/test/scripts/applications/validation/CV_MultiClassSVM.sasha.dml +++ b/src/test/scripts/applications/validation/CV_MultiClassSVM.sasha.dml @@ -60,11 +60,11 @@ parfor( i in 1:k ) yi = y * vPxi; # Create the labels for the TEST set nXi = X - Xi; # Create the TRAINING set with (k-1)/k of the rows nyi = y - yi; # Create the labels for the TRAINING set - Xyi = append(Xi,yi); #keep alignment on removeEmpty + Xyi = cbind(Xi,yi); #keep alignment on removeEmpty Xyi = removeEmpty( target=Xyi, margin="rows" ); Xi = Xyi[ , 1:n]; yi = Xyi[ , n+1]; - nXyi = append(nXi,nyi); #keep alignment on removeEmpty + nXyi = cbind(nXi,nyi); #keep alignment on removeEmpty nXyi = removeEmpty( target=nXyi, margin="rows" ); nXi = nXyi[ , 1:n]; nyi = nXyi[ , n+1]; @@ -100,7 +100,7 @@ num_features = ncol(X) if (intercept == 1) { ones = Rand(rows=num_samples, cols=1, min=1, max=1, pdf="uniform"); - X = append(X, ones); + X = cbind(X, ones); } iter_class = 1 @@ -109,7 +109,7 @@ Y_local = 2 * ppred(Y, iter_class, "==") - 1 w_class = Rand(rows=num_features, cols=1, min=0, max=0, pdf="uniform") if (intercept == 1) { zero_matrix = Rand(rows=1, cols=1, min=0.0, max=0.0); - w_class = t(append(t(w_class), zero_matrix)); + w_class = t(cbind(t(w_class), zero_matrix)); } g_old = t(X) %*% Y_local @@ -172,7 +172,7 @@ while(iter_class <= num_classes){ w_class = Rand(rows=ncol(X), cols=1, min=0, max=0, pdf="uniform") if (intercept == 1) { zero_matrix = Rand(rows=1, cols=1, min=0.0, max=0.0); - w_class = t(append(t(w_class), zero_matrix)); + w_class = t(cbind(t(w_class), zero_matrix)); } g_old = t(X) %*% Y_local @@ -226,7 +226,7 @@ while(iter_class <= num_classes){ iter = iter + 1 } - w = append(w, w_class) + w = cbind(w, w_class) iter_class = iter_class + 1 } http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/applications/validation/LinearLogisticRegression.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/applications/validation/LinearLogisticRegression.dml b/src/test/scripts/applications/validation/LinearLogisticRegression.dml index 1444bd4..a158ba5 100644 --- a/src/test/scripts/applications/validation/LinearLogisticRegression.dml +++ b/src/test/scripts/applications/validation/LinearLogisticRegression.dml @@ -55,10 +55,10 @@ zeros_D = Rand(rows = D, cols = 1, min = 0.0, max = 0.0); if (intercept == 1) { num_samples = nrow(X); ones = Rand(rows=num_samples, cols=1, min=1, max=1, pdf="uniform"); - X = append(X, ones); + X = cbind(X, ones); zero_matrix = Rand(rows=1, cols=1, min=0.0, max=0.0); - w = t(append(t(w), zero_matrix)); - zeros_D = t(append(t(zeros_D), zero_matrix)); + w = t(cbind(t(w), zero_matrix)); + zeros_D = t(cbind(t(zeros_D), zero_matrix)); } N = nrow(X) http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/applications/validation/MultiClassSVM.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/applications/validation/MultiClassSVM.dml b/src/test/scripts/applications/validation/MultiClassSVM.dml index 8ccaced..b45bffd 100644 --- a/src/test/scripts/applications/validation/MultiClassSVM.dml +++ b/src/test/scripts/applications/validation/MultiClassSVM.dml @@ -51,7 +51,7 @@ num_features = ncol(X) if (intercept == 1) { ones = Rand(rows=num_samples, cols=1, min=1, max=1, pdf="uniform"); - X = append(X, ones); + X = cbind(X, ones); } iter_class = 1 @@ -60,7 +60,7 @@ Y_local = 2 * ppred(Y, iter_class, "==") - 1 w_class = Rand(rows=num_features, cols=1, min=0, max=0, pdf="uniform") if (intercept == 1) { zero_matrix = Rand(rows=1, cols=1, min=0.0, max=0.0); - w_class = t(append(t(w_class), zero_matrix)); + w_class = t(cbind(t(w_class), zero_matrix)); } g_old = t(X) %*% Y_local @@ -123,7 +123,7 @@ while(iter_class <= num_classes){ w_class = Rand(rows=ncol(X), cols=1, min=0, max=0, pdf="uniform") if (intercept == 1) { zero_matrix = Rand(rows=1, cols=1, min=0.0, max=0.0); - w_class = t(append(t(w_class), zero_matrix)); + w_class = t(cbind(t(w_class), zero_matrix)); } g_old = t(X) %*% Y_local @@ -177,7 +177,7 @@ while(iter_class <= num_classes){ iter = iter + 1 } - w = append(w, w_class) + w = cbind(w, w_class) iter_class = iter_class + 1 } http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/applications/validation/genRandData4LogisticRegression.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/applications/validation/genRandData4LogisticRegression.dml b/src/test/scripts/applications/validation/genRandData4LogisticRegression.dml index c7cd4a2..7550a25 100644 --- a/src/test/scripts/applications/validation/genRandData4LogisticRegression.dml +++ b/src/test/scripts/applications/validation/genRandData4LogisticRegression.dml @@ -50,7 +50,7 @@ w = Rand (rows=numFeatures, cols=1, min=-1, max=1, pdf="uniform", seed=0) if (b != 0) { b_mat = Rand (rows=numSamples, cols=1, min=1, max=1); - X = append (X, b_mat); + X = cbind (X, b_mat); numFeatures_plus_one = numFeatures + 1; w = Rand (rows=numFeatures_plus_one, cols=1, min=-1, max=1, pdf="uniform", seed=0); } http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/applications/validation/genRandData4MultiClassSVM.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/applications/validation/genRandData4MultiClassSVM.dml b/src/test/scripts/applications/validation/genRandData4MultiClassSVM.dml index ca09137..d9fe043 100644 --- a/src/test/scripts/applications/validation/genRandData4MultiClassSVM.dml +++ b/src/test/scripts/applications/validation/genRandData4MultiClassSVM.dml @@ -54,7 +54,7 @@ w = w * maxWeight ot = X%*%w if(b!=0) { b_mat = Rand(rows=1, cols=1, min=b, max=b, pdf="uniform") - w = t(append(t(w), b_mat)) + w = t(cbind(t(w), b_mat)) ot = ot + b } http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/functions/append/AppendChainTest.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/functions/append/AppendChainTest.dml b/src/test/scripts/functions/append/AppendChainTest.dml index 69797c7..08b226d 100644 --- a/src/test/scripts/functions/append/AppendChainTest.dml +++ b/src/test/scripts/functions/append/AppendChainTest.dml @@ -22,6 +22,6 @@ A=read($1, rows=$2, cols=$3, format="text") B1=read($4, rows=$2, cols=$5, format="text") B2=read($6, rows=$2, cols=$7, format="text") -C=append(A, B1) -C=append(C, B2) +C=cbind(A, B1) +C=cbind(C, B2) write(C, $8, format="text") http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/functions/append/AppendMatrixTest.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/functions/append/AppendMatrixTest.dml b/src/test/scripts/functions/append/AppendMatrixTest.dml index 219e3c3..adb8742 100644 --- a/src/test/scripts/functions/append/AppendMatrixTest.dml +++ b/src/test/scripts/functions/append/AppendMatrixTest.dml @@ -21,5 +21,5 @@ A=read($1, rows=$2, cols=$3, format="text") B=read($4, rows=$2, cols=$5, format="text") -C=append(A, B) +C=cbind(A, B) write(C, $6, format="text") http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/functions/append/AppendVectorTest.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/functions/append/AppendVectorTest.dml b/src/test/scripts/functions/append/AppendVectorTest.dml index 9bc5df2..06911fd 100644 --- a/src/test/scripts/functions/append/AppendVectorTest.dml +++ b/src/test/scripts/functions/append/AppendVectorTest.dml @@ -21,5 +21,5 @@ A=read($1, rows=$2, cols=$3, format="text") B=read($4, rows=$2, cols=1, format="text") -C=append(A, B) +C=cbind(A, B) write(C, $5, format="text") http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/functions/append/basic_string_append.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/functions/append/basic_string_append.dml b/src/test/scripts/functions/append/basic_string_append.dml index b4bd889..aca3be3 100644 --- a/src/test/scripts/functions/append/basic_string_append.dml +++ b/src/test/scripts/functions/append/basic_string_append.dml @@ -20,8 +20,8 @@ #------------------------------------------------------------- s = "# Name Value"; -s = append(s, "A = " + (7 + $1 + 1)); -s = append(s, "B = " + (3 + $1 + 1)); +s = cbind(s, "A = " + (7 + $1 + 1)); +s = cbind(s, "B = " + (3 + $1 + 1)); print(s); write(s, $2); http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/functions/compress/LinregCG.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/functions/compress/LinregCG.dml b/src/test/scripts/functions/compress/LinregCG.dml index 85a66e4..8a9d990 100644 --- a/src/test/scripts/functions/compress/LinregCG.dml +++ b/src/test/scripts/functions/compress/LinregCG.dml @@ -28,7 +28,7 @@ maxiter = $5; if( intercept == 1 ){ ones = matrix(1, nrow(X), 1); - X = append(X, ones); + X = cbind(X, ones); } r = -(t(X) %*% y); http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/functions/gdfo/LinregCG.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/functions/gdfo/LinregCG.dml b/src/test/scripts/functions/gdfo/LinregCG.dml index 92f15d7..01dcae7 100644 --- a/src/test/scripts/functions/gdfo/LinregCG.dml +++ b/src/test/scripts/functions/gdfo/LinregCG.dml @@ -28,7 +28,7 @@ maxiter = $5; if( intercept == 1 ){ ones = matrix(1, nrow(X), 1); - X = append(X, ones); + X = cbind(X, ones); } r = -(t(X) %*% y); http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/functions/gdfo/LinregDS.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/functions/gdfo/LinregDS.dml b/src/test/scripts/functions/gdfo/LinregDS.dml index 3601830..a985340 100644 --- a/src/test/scripts/functions/gdfo/LinregDS.dml +++ b/src/test/scripts/functions/gdfo/LinregDS.dml @@ -28,7 +28,7 @@ lambda = $4; if( intercept == 1 ){ ones = matrix(1, nrow(X), 1); - X = append(X, ones); + X = cbind(X, ones); I = matrix(1, ncol(X), 1); } http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/functions/jmlc/reuse-glm-predict.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/functions/jmlc/reuse-glm-predict.dml b/src/test/scripts/functions/jmlc/reuse-glm-predict.dml index 01d2101..5a0dc43 100644 --- a/src/test/scripts/functions/jmlc/reuse-glm-predict.dml +++ b/src/test/scripts/functions/jmlc/reuse-glm-predict.dml @@ -340,7 +340,7 @@ glm_means_and_vars = # MULTINOMIAL LOGIT DISTRIBUTION elt = exp (linear_terms); ones_pts = matrix (1, rows = num_points, cols = 1); - elt = append (elt, ones_pts); + elt = cbind (elt, ones_pts); ones_ctg = matrix (1, rows = ncol (elt), cols = 1); means = elt / (rowSums (elt) %*% t(ones_ctg)); vars = means * (means %*% (1 - diag (ones_ctg))); http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/functions/jmlc/transform4.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/functions/jmlc/transform4.dml b/src/test/scripts/functions/jmlc/transform4.dml index c57f8e3..bd7afb9 100644 --- a/src/test/scripts/functions/jmlc/transform4.dml +++ b/src/test/scripts/functions/jmlc/transform4.dml @@ -40,7 +40,7 @@ X2 = X2 * (X2!=77.7); F21 = transformdecode(target=X1, meta=M1, spec=specJson1); F22 = transformdecode(target=X2, meta=M2, spec=specJson2); -#frame append -F2 = append(F21, F22); +#frame cbind +F2 = cbind(F21, F22); write(F2, $F2); http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/functions/jmlc/transform5.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/functions/jmlc/transform5.dml b/src/test/scripts/functions/jmlc/transform5.dml index a36f769..238d542 100644 --- a/src/test/scripts/functions/jmlc/transform5.dml +++ b/src/test/scripts/functions/jmlc/transform5.dml @@ -37,12 +37,12 @@ X2 = transformapply(target=F12, meta=M2, spec=specJson2); X1 = X1 * (X1!=77.7); X2 = X2 * (X2!=77.7); -X1 = append(X1, matrix(0, rows=nrow(X1), cols=1)); +X1 = cbind(X1, matrix(0, rows=nrow(X1), cols=1)); F2 = transformdecode(target=X1, meta=M1, spec=specJson1); F22 = transformdecode(target=X2, meta=M2, spec=specJson2); #frame leftindexing -F2 = append(F2, F2[,2]) +F2 = cbind(F2, F2[,2]) F2[,3] = F22; write(F2, $F2); http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/functions/parfor/parfor_repeatedopt3.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/functions/parfor/parfor_repeatedopt3.dml b/src/test/scripts/functions/parfor/parfor_repeatedopt3.dml index 8254388..4647431 100644 --- a/src/test/scripts/functions/parfor/parfor_repeatedopt3.dml +++ b/src/test/scripts/functions/parfor/parfor_repeatedopt3.dml @@ -31,9 +31,9 @@ while( iter <= 3 ) if( $5==1 ) { vx = matrix(1,rows=nrow(V),cols=1)*iter; - V = append(V, vx); + V = cbind(V, vx); rx = matrix(0,rows=1,cols=1); - R = append(R, rx); + R = cbind(R, rx); } #repeated opt for each while iteration http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/functions/piggybacking/Piggybacking1_append.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/functions/piggybacking/Piggybacking1_append.dml b/src/test/scripts/functions/piggybacking/Piggybacking1_append.dml index 9e35d60..039f3a3 100644 --- a/src/test/scripts/functions/piggybacking/Piggybacking1_append.dml +++ b/src/test/scripts/functions/piggybacking/Piggybacking1_append.dml @@ -23,7 +23,7 @@ A = matrix(1,10,10); v = matrix(2,10,1); v = v+sum(A); -B = append(A,v); +B = cbind(A,v); s = sum(B); http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/functions/recompile/append_nnz.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/functions/recompile/append_nnz.dml b/src/test/scripts/functions/recompile/append_nnz.dml index 9f5b5ea..04cdf5d 100644 --- a/src/test/scripts/functions/recompile/append_nnz.dml +++ b/src/test/scripts/functions/recompile/append_nnz.dml @@ -36,7 +36,7 @@ if (intercept_status == 2) { X = (X + ones_n %*% shift_X_cols); } -X = append (X, ones_n); +X = cbind (X, ones_n); if(1==1){ } http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/functions/recompile/if_branch_removal.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/functions/recompile/if_branch_removal.dml b/src/test/scripts/functions/recompile/if_branch_removal.dml index 68f1eae..389e961 100644 --- a/src/test/scripts/functions/recompile/if_branch_removal.dml +++ b/src/test/scripts/functions/recompile/if_branch_removal.dml @@ -26,21 +26,21 @@ X = read($1, rows=$2, cols=$3); if( $4==1 ) { v = matrix(1,rows=nrow(X),cols=1); - X = append(X, v); + X = cbind(X, v); } # test if-else branches if( $4!=1 ) { v = matrix(1,rows=nrow(X),cols=1); - X = append(X, v); + X = cbind(X, v); } else { v1 = matrix(1,rows=nrow(X),cols=1); - X = append(X, v1); + X = cbind(X, v1); v2 = matrix(1,rows=nrow(X),cols=1); - X = append(X, v2); + X = cbind(X, v2); } write(X, $5); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/functions/recompile/multiple_function_calls5.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/functions/recompile/multiple_function_calls5.dml b/src/test/scripts/functions/recompile/multiple_function_calls5.dml index dc1b420..3245fdf 100644 --- a/src/test/scripts/functions/recompile/multiple_function_calls5.dml +++ b/src/test/scripts/functions/recompile/multiple_function_calls5.dml @@ -43,7 +43,7 @@ foo2 = function(Matrix[Double] Xin) return (Matrix[Double] Xout) V = read($1); R1 = foo1(V); -Vp = append(V,matrix(1,rows=nrow(V),cols=1)) +Vp = cbind(V,matrix(1,rows=nrow(V),cols=1)) R2 = foo1(Vp); R = R1+R2[,1:ncol(V)]; http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/1385cf1c/src/test/scripts/functions/recompile/remove_empty_potpourri4.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/functions/recompile/remove_empty_potpourri4.dml b/src/test/scripts/functions/recompile/remove_empty_potpourri4.dml index d651ed6..5158a38 100644 --- a/src/test/scripts/functions/recompile/remove_empty_potpourri4.dml +++ b/src/test/scripts/functions/recompile/remove_empty_potpourri4.dml @@ -27,7 +27,7 @@ D = matrix(3, rows=1000, cols=1); if(1==1){} -tmp = append(X [, 1 : 2], B) * (C * (1 - D)); +tmp = cbind(X [, 1 : 2], B) * (C * (1 - D)); E = removeEmpty (target = tmp, margin = "rows"); X = removeEmpty (target = X * C, margin = "rows");
