You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemml.apache.org by du...@apache.org on 2016/01/26 02:13:15 UTC

[51/55] [partial] incubator-systemml git commit: [SYSTEMML-482] [SYSTEMML-480] Adding a Git attributes file to enfore Unix-styled line endings, and normalizing all of the line endings.

[SYSTEMML-482] [SYSTEMML-480] Adding a Git attributes file to enfore Unix-styled line endings, and normalizing all of the line endings.

Closes #49.


Project: http://git-wip-us.apache.org/repos/asf/incubator-systemml/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-systemml/commit/816e2db8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-systemml/tree/816e2db8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-systemml/diff/816e2db8

Branch: refs/heads/branch-0.9
Commit: 816e2db839191c480c870b3ff6755de5190a203a
Parents: cf5144e
Author: Mike Dusenberry <mw...@us.ibm.com>
Authored: Fri Jan 22 08:31:35 2016 -0800
Committer: Mike Dusenberry <mw...@us.ibm.com>
Committed: Fri Jan 22 08:31:35 2016 -0800

----------------------------------------------------------------------
 .gitattributes                                  |   13 +
 docs/devdocs/MatrixMultiplicationOperators.txt  |  256 +-
 scripts/algorithms/ALS-DS.dml                   |  338 +--
 scripts/algorithms/ALS_topk_predict.dml         |  252 +-
 scripts/algorithms/Cox-predict.dml              |  362 +--
 scripts/algorithms/Cox.dml                      | 1004 +++----
 scripts/algorithms/GLM-predict.dml              |  888 +++---
 scripts/algorithms/GLM.dml                      | 2334 +++++++--------
 scripts/algorithms/KM.dml                       | 1236 ++++----
 scripts/algorithms/Kmeans-predict.dml           |  678 ++---
 scripts/algorithms/Kmeans.dml                   |  564 ++--
 scripts/algorithms/LinearRegCG.dml              |  572 ++--
 scripts/algorithms/LinearRegDS.dml              |  448 +--
 scripts/algorithms/MultiLogReg.dml              |  730 ++---
 scripts/algorithms/PCA.dml                      |  224 +-
 scripts/algorithms/StepGLM.dml                  | 2390 +++++++--------
 scripts/algorithms/StepLinearRegDS.dml          |  776 ++---
 scripts/algorithms/Univar-Stats.dml             |  300 +-
 scripts/algorithms/bivar-stats.dml              |  796 ++---
 scripts/algorithms/decision-tree-predict.dml    |  284 +-
 scripts/algorithms/l2-svm.dml                   |  318 +-
 scripts/algorithms/m-svm-predict.dml            |  168 +-
 scripts/algorithms/m-svm.dml                    |  348 +--
 scripts/algorithms/random-forest-predict.dml    |  386 +--
 scripts/algorithms/random-forest.dml            | 2750 +++++++++---------
 scripts/algorithms/stratstats.dml               |  792 ++---
 scripts/datagen/genCorrelatedData.dml           |   92 +-
 scripts/datagen/genRandData4ChisquaredTest.dml  |  174 +-
 scripts/datagen/genRandData4DecisionTree1.dml   |   78 +-
 scripts/datagen/genRandData4DecisionTree2.dml   |   80 +-
 scripts/datagen/genRandData4FTest.dml           |  190 +-
 scripts/datagen/genRandData4Kmeans.dml          |  240 +-
 .../datagen/genRandData4LinearRegression.dml    |  122 +-
 scripts/datagen/genRandData4LogReg_LTstats.dml  |  466 +--
 scripts/datagen/genRandData4MultiClassSVM.dml   |  136 +-
 scripts/datagen/genRandData4NMF.dml             |  258 +-
 scripts/datagen/genRandData4NMFBlockwise.dml    |  276 +-
 scripts/datagen/genRandData4SurvAnalysis.dml    |  266 +-
 scripts/datagen/genRandData4Transform.dml       |  192 +-
 scripts/datagen/genRandData4Univariate.dml      |  116 +-
 scripts/staging/PPCA.dml                        |  320 +-
 scripts/staging/regression/lasso/lasso.dml      |  226 +-
 scripts/utils/project.dml                       |  160 +-
 scripts/utils/rowIndexMax.dml                   |   76 +-
 scripts/utils/splitXY.dml                       |  124 +-
 scripts/utils/write.dml                         |   78 +-
 .../org/apache/sysml/lops/BinaryScalar.java     |  394 +--
 .../java/org/apache/sysml/parser/antlr4/Dml.g4  |  402 +--
 .../controlprogram/parfor/RemoteDPParForMR.java |  584 ++--
 .../parfor/RemoteDPParWorkerReducer.java        |  744 ++---
 .../parfor/RemoteParForUtils.java               |  532 ++--
 .../parfor/opt/PerfTestToolRegression.dml       |  114 +-
 .../spark/data/BroadcastObject.java             |  128 +-
 .../instructions/spark/data/LineageObject.java  |  166 +-
 .../instructions/spark/data/RDDObject.java      |  248 +-
 .../matrix/mapred/GroupedAggMRCombiner.java     |  334 +--
 .../matrix/sort/IndexSortComparable.java        |  168 +-
 .../matrix/sort/IndexSortComparableDesc.java    |   98 +-
 .../runtime/matrix/sort/IndexSortMapper.java    |  150 +-
 .../runtime/matrix/sort/IndexSortReducer.java   |  206 +-
 .../matrix/sort/IndexSortStitchupMapper.java    |  282 +-
 .../matrix/sort/IndexSortStitchupReducer.java   |  148 +-
 .../runtime/matrix/sort/ValueSortMapper.java    |  196 +-
 .../runtime/matrix/sort/ValueSortReducer.java   |  136 +-
 .../sysml/runtime/transform/ApplyTfBBMR.java    |  312 +-
 .../runtime/transform/ApplyTfBBMapper.java      |  302 +-
 .../sysml/runtime/transform/ApplyTfCSVMR.java   |  256 +-
 .../runtime/transform/ApplyTfCSVMapper.java     |  224 +-
 .../runtime/transform/ApplyTfCSVSPARK.java      |  320 +-
 .../sysml/runtime/transform/BinAgent.java       |  710 ++---
 .../sysml/runtime/transform/DistinctValue.java  |  216 +-
 .../sysml/runtime/transform/DummycodeAgent.java |  852 +++---
 .../sysml/runtime/transform/GTFMTDMapper.java   |  214 +-
 .../sysml/runtime/transform/GTFMTDReducer.java  |  248 +-
 .../sysml/runtime/transform/GenTfMtdMR.java     |  212 +-
 .../sysml/runtime/transform/GenTfMtdSPARK.java  |  470 +--
 .../sysml/runtime/transform/MVImputeAgent.java  | 1954 ++++++-------
 .../sysml/runtime/transform/OmitAgent.java      |  246 +-
 .../sysml/runtime/transform/RecodeAgent.java    |    2 +-
 .../apache/sysml/runtime/transform/TfUtils.java | 1098 +++----
 .../runtime/transform/TransformationAgent.java  |  186 +-
 src/main/standalone/runStandaloneSystemML.bat   |  100 +-
 .../apply-transform/apply-transform.dml         |  310 +-
 .../apply-transform/apply-transform.pydml       |  290 +-
 .../applications/arima_box-jenkins/arima.dml    |  574 ++--
 .../applications/arima_box-jenkins/arima.pydml  |  516 ++--
 .../applications/ctableStats/Binomial.dml       |  342 +--
 .../scripts/applications/ctableStats/ctci.dml   |  290 +-
 .../applications/ctableStats/ctci_odds.dml      |  356 +--
 .../applications/ctableStats/stratstats.dml     |  700 ++---
 .../applications/ctableStats/wilson_score.dml   |  290 +-
 .../applications/ctableStats/zipftest.dml       |  154 +-
 .../applications/descriptivestats/Categorical.R |  114 +-
 .../descriptivestats/Categorical.dml            |  110 +-
 .../descriptivestats/CategoricalCategorical.R   |   98 +-
 .../descriptivestats/CategoricalCategorical.dml |  112 +-
 .../CategoricalCategoricalWithWeightsTest.R     |  134 +-
 .../CategoricalCategoricalWithWeightsTest.dml   |  120 +-
 .../applications/descriptivestats/IQMTest.dml   |   68 +-
 .../applications/descriptivestats/OddsRatio.R   |  150 +-
 .../applications/descriptivestats/OddsRatio.dml |  228 +-
 .../descriptivestats/OrdinalOrdinal.R           |   76 +-
 .../descriptivestats/OrdinalOrdinal.dml         |  148 +-
 .../OrdinalOrdinalWithWeightsTest.R             |   92 +-
 .../OrdinalOrdinalWithWeightsTest.dml           |  156 +-
 .../descriptivestats/QuantileTest.dml           |   66 +-
 .../applications/descriptivestats/Scale.R       |  282 +-
 .../applications/descriptivestats/Scale.dml     |  228 +-
 .../descriptivestats/ScaleCategorical.R         |  138 +-
 .../descriptivestats/ScaleCategorical.dml       |  124 +-
 .../ScaleCategoricalWithWeightsTest.R           |  156 +-
 .../ScaleCategoricalWithWeightsTest.dml         |  130 +-
 .../applications/descriptivestats/ScaleScale.R  |   76 +-
 .../descriptivestats/ScaleScale.dml             |   96 +-
 .../ScaleScalePearsonRWithWeightsTest.R         |   90 +-
 .../ScaleScalePearsonRWithWeightsTest.dml       |  102 +-
 .../descriptivestats/SimpleQuantileTest.dml     |   68 +-
 .../descriptivestats/WeightedCategoricalTest.R  |  126 +-
 .../WeightedCategoricalTest.dml                 |  112 +-
 .../descriptivestats/WeightedScaleTest.R        |  310 +-
 .../descriptivestats/WeightedScaleTest.dml      |  250 +-
 src/test/scripts/applications/glm/GLM.R         |  282 +-
 src/test/scripts/applications/glm/GLM.dml       | 2334 +++++++--------
 src/test/scripts/applications/id3/id3.R         |  484 +--
 .../applications/impute/imputeGaussMCMC.dml     | 1374 ++++-----
 .../impute/imputeGaussMCMC.nogradient.dml       |  906 +++---
 .../applications/impute/old/imputeGaussMCMC.dml |  840 +++---
 .../impute/old/wfundInputGenerator.dml          |  806 ++---
 .../impute/test/testInputGenerator.dml          |  304 +-
 .../testShadowRecurrenceInputGenerator.dml      |  348 +--
 src/test/scripts/applications/impute/tmp.dml    |  254 +-
 .../wfundInputGenerator.The0thReportAttempt.dml | 1002 +++----
 .../wfundInputGenerator.pre2013-08-26.dml       |  884 +++---
 .../impute/wfundInputGenerator1.dml             |  938 +++---
 .../impute/wfundInputGenerator2.dml             |  892 +++---
 src/test/scripts/applications/kmeans/Kmeans.dml |  216 +-
 src/test/scripts/applications/l2svm/L2SVM.R     |  206 +-
 src/test/scripts/applications/l2svm/L2SVM.dml   |  248 +-
 src/test/scripts/applications/l2svm/L2SVM.pydml |  238 +-
 .../scripts/applications/l2svm/L2SVMTest.Rt     |  142 +-
 .../scripts/applications/l2svm/L2SVMTest.dmlt   |  160 +-
 .../applications/linearLogReg/LinearLogReg.R    |  434 +--
 .../applications/linearLogReg/LinearLogReg.dml  |  462 +--
 .../linearLogReg/LinearLogReg.pydml             |  428 +--
 src/test/scripts/applications/m-svm/m-svm.R     |  240 +-
 src/test/scripts/applications/m-svm/m-svm.dml   |  290 +-
 src/test/scripts/applications/m-svm/m-svm.pydml |  272 +-
 .../applications/mdabivar/MDABivariateStats.R   |  588 ++--
 .../applications/mdabivar/MDABivariateStats.dml |  520 ++--
 .../mdabivar/MDABivariateStats.pydml            |  488 ++--
 .../naive-bayes-parfor/naive-bayes.R            |  142 +-
 .../naive-bayes-parfor/naive-bayes.dml          |  156 +-
 .../naive-bayes-parfor/naive-bayes.pydml        |  158 +-
 .../applications/naive-bayes/naive-bayes.R      |  142 +-
 .../applications/naive-bayes/naive-bayes.dml    |  134 +-
 .../applications/naive-bayes/naive-bayes.pydml  |  142 +-
 .../applications/parfor/parfor_bivariate.R      |  310 +-
 .../applications/parfor/parfor_bivariate0.dml   |  528 ++--
 .../applications/parfor/parfor_bivariate1.dml   |  512 ++--
 .../applications/parfor/parfor_bivariate2.dml   |  512 ++--
 .../applications/parfor/parfor_bivariate3.dml   |  512 ++--
 .../applications/parfor/parfor_bivariate4.dml   |  516 ++--
 .../scripts/applications/parfor/parfor_corr.R   |   96 +-
 .../applications/parfor/parfor_corr0.dml        |  100 +-
 .../applications/parfor/parfor_corr1.dml        |   98 +-
 .../applications/parfor/parfor_corr2.dml        |   98 +-
 .../applications/parfor/parfor_corr3.dml        |  100 +-
 .../applications/parfor/parfor_corr4.dml        |  100 +-
 .../applications/parfor/parfor_corr5.dml        |  100 +-
 .../applications/parfor/parfor_corr6.dml        |  100 +-
 .../applications/parfor/parfor_corr_large.R     |   96 +-
 .../applications/parfor/parfor_corr_large1.dml  |  100 +-
 .../applications/parfor/parfor_corr_large2.dml  |  100 +-
 .../applications/parfor/parfor_corr_large3.dml  |  100 +-
 .../applications/parfor/parfor_corr_large4.dml  |  100 +-
 .../parfor/parfor_cv_multiclasssvm.R            |  582 ++--
 .../parfor/parfor_cv_multiclasssvm0.dml         |  548 ++--
 .../parfor/parfor_cv_multiclasssvm1.dml         |  548 ++--
 .../parfor/parfor_cv_multiclasssvm4.dml         |  548 ++--
 .../applications/parfor/parfor_naive-bayes.R    |  122 +-
 .../applications/parfor/parfor_univariate.R     |  310 +-
 .../applications/parfor/parfor_univariate0.dml  |  332 +--
 .../applications/parfor/parfor_univariate1.dml  |  332 +--
 .../applications/parfor/parfor_univariate4.dml  |  332 +--
 .../validation/LinearLogisticRegression.dml     |  492 ++--
 .../genRandData4LogisticRegression.dml          |  244 +-
 .../applications/welchTTest/welchTTest.R        |   98 +-
 .../applications/welchTTest/welchTTest.dml      |   86 +-
 .../applications/welchTTest/welchTTest.pydml    |   86 +-
 src/test/scripts/functions/aggregate/AllMax.R   |   56 +-
 src/test/scripts/functions/aggregate/AllMean.R  |   56 +-
 src/test/scripts/functions/aggregate/AllMin.R   |   56 +-
 src/test/scripts/functions/aggregate/AllProd.R  |   56 +-
 src/test/scripts/functions/aggregate/AllSum.R   |   56 +-
 src/test/scripts/functions/aggregate/ColMaxs.R  |   66 +-
 src/test/scripts/functions/aggregate/ColMeans.R |   56 +-
 src/test/scripts/functions/aggregate/ColMins.R  |   66 +-
 src/test/scripts/functions/aggregate/ColSums.R  |   56 +-
 src/test/scripts/functions/aggregate/DiagSum.R  |   56 +-
 .../functions/aggregate/GroupedAggregate.R      |  120 +-
 .../aggregate/GroupedAggregateMatrix.R          |  138 +-
 .../aggregate/GroupedAggregateWeights.R         |  140 +-
 .../scripts/functions/aggregate/RowIndexMaxs.R  |   54 +-
 .../scripts/functions/aggregate/RowIndexMins.R  |   54 +-
 .../functions/aggregate/RowIndexMins.dml        |   48 +-
 src/test/scripts/functions/aggregate/RowMaxs.R  |   66 +-
 src/test/scripts/functions/aggregate/RowMeans.R |   56 +-
 src/test/scripts/functions/aggregate/RowMins.R  |   66 +-
 src/test/scripts/functions/aggregate/RowSums.R  |   56 +-
 .../scripts/functions/append/AppendChainTest.R  |   68 +-
 .../functions/append/AppendChainTest.dml        |   54 +-
 .../scripts/functions/append/AppendMatrixTest.R |   60 +-
 .../functions/append/AppendMatrixTest.dml       |   50 +-
 .../scripts/functions/append/AppendVectorTest.R |   60 +-
 .../functions/append/AppendVectorTest.dml       |   50 +-
 .../functions/append/RBindCBindMatrixTest.R     |   62 +-
 .../functions/append/RBindCBindMatrixTest.dml   |   54 +-
 .../scripts/functions/append/RBindMatrixTest.R  |   62 +-
 .../functions/append/RBindMatrixTest.dml        |   54 +-
 .../functions/append/basic_string_append.dml    |   54 +-
 .../functions/append/loop_string_append.dml     |   62 +-
 .../functions/binary/matrix/BinUaggChain_Col.R  |   64 +-
 .../functions/binary/matrix/CentralMoment.R     |   72 +-
 .../functions/binary/matrix/Covariance.R        |   72 +-
 .../binary/matrix/DiagMatrixMultiplication.R    |   76 +-
 .../matrix/DiagMatrixMultiplicationTranspose.R  |   68 +-
 .../binary/matrix/ElementwiseModulusTest.dml    |   52 +-
 ...ElementwiseModulusVariableDimensionsTest.dml |   52 +-
 src/test/scripts/functions/binary/matrix/IQM.R  |   86 +-
 .../functions/binary/matrix/MapMultChain.R      |   68 +-
 .../binary/matrix/MapMultChainWeights.R         |   70 +-
 .../binary/matrix/MapMultChainWeights2.R        |   70 +-
 .../binary/matrix/MapMultLimitTest.dml          |   62 +-
 .../binary/matrix/MatrixVectorMultiplication.R  |   72 +-
 .../scripts/functions/binary/matrix/Median.R    |   68 +-
 .../functions/binary/matrix/OuterProduct.R      |   82 +-
 .../scripts/functions/binary/matrix/Quantile.R  |   70 +-
 .../binary/matrix/ScalarModulusTest.dml         |   78 +-
 .../matrix/TransposeMatrixMultiplication.R      |   68 +-
 .../matrix/TransposeMatrixMultiplicationMinus.R |   68 +-
 .../TransposeMatrixMultiplicationMinus.dml      |   54 +-
 .../functions/binary/matrix/UaggOuterChain.R    |   68 +-
 .../binary/matrix/UaggOuterChainColSums.R       |   68 +-
 .../binary/matrix/UaggOuterChainEquals.R        |   68 +-
 .../binary/matrix/UaggOuterChainEqualsColSums.R |   68 +-
 .../binary/matrix/UaggOuterChainEqualsSums.R    |   68 +-
 .../binary/matrix/UaggOuterChainGreater.R       |   28 +-
 .../matrix/UaggOuterChainGreaterColSums.R       |   28 +-
 .../binary/matrix/UaggOuterChainGreaterEquals.R |   28 +-
 .../matrix/UaggOuterChainGreaterEqualsColSums.R |   28 +-
 .../binary/matrix/UaggOuterChainLessEquals.R    |   28 +-
 .../matrix/UaggOuterChainLessEqualsColSums.R    |   28 +-
 .../binary/matrix/UaggOuterChainNotEquals.R     |   28 +-
 .../matrix/UaggOuterChainNotEqualsColSums.R     |   28 +-
 .../binary/matrix/UaggOuterChainSums.R          |   66 +-
 .../matrix/UltraSparseMatrixMultiplication.R    |   32 +-
 .../matrix/UltraSparseMatrixMultiplication2.R   |   32 +-
 .../scripts/functions/binary/matrix/ZipMMTest.R |   68 +-
 .../FullMatrixCellwiseOperation_Addition.R      |   34 +-
 .../FullMatrixCellwiseOperation_Division.R      |   34 +-
 ...FullMatrixCellwiseOperation_Multiplication.R |   34 +-
 .../FullMatrixCellwiseOperation_Substraction.R  |   34 +-
 ...lMatrixVectorColCellwiseOperation_Addition.R |   34 +-
 ...lMatrixVectorColCellwiseOperation_Division.R |   34 +-
 ...xVectorColCellwiseOperation_Multiplication.R |   34 +-
 ...rixVectorColCellwiseOperation_Substraction.R |   34 +-
 ...lMatrixVectorRowCellwiseOperation_Addition.R |   36 +-
 ...lMatrixVectorRowCellwiseOperation_Division.R |   36 +-
 ...xVectorRowCellwiseOperation_Multiplication.R |   36 +-
 ...rixVectorRowCellwiseOperation_Substraction.R |   36 +-
 .../FullVectorVectorCellwiseOperation.R         |   38 +-
 .../matrix_full_cellwise/Minus1MultTest.R       |   78 +-
 .../FullDistributedMatrixMultiplication.R       |   34 +-
 .../FullMatrixMultiplication.R                  |   34 +-
 .../matrix_full_other/FullMinMaxComparison.R    |   74 +-
 .../binary/matrix_full_other/FullPower.R        |   40 +-
 .../matrix_full_other/IntegerDivision_div.R     |   40 +-
 .../matrix_full_other/IntegerDivision_mod.R     |   40 +-
 .../binary/matrix_full_other/PPredMatrixTest.R  |   74 +-
 .../matrix_full_other/PPredScalarLeftTest.R     |   76 +-
 .../matrix_full_other/PPredScalarRightTest.R    |   76 +-
 .../TransposeSelfMatrixMultiplication1.R        |   22 +-
 .../TransposeSelfMatrixMultiplication2.R        |   22 +-
 .../binary/scalar/ModulusSingleTest.dml         |   16 +-
 .../functions/binary/scalar/ModulusTest.dml     |   46 +-
 src/test/scripts/functions/caching/export.dml   |    4 +-
 .../functions/data/RandRuntimePlatformTest.dml  |   52 +-
 .../data/RandRuntimePlatformTestPoisson.dml     |   54 +-
 src/test/scripts/functions/data/RandVarMinMax.R |   34 +-
 src/test/scripts/functions/data/Sample2.dml     |    6 +-
 src/test/scripts/functions/data/Sample3.dml     |    6 +-
 src/test/scripts/functions/data/Sample4.dml     |    6 +-
 src/test/scripts/functions/data/Sequence.R      |   16 +-
 src/test/scripts/functions/data/Sequence.dml    |    8 +-
 .../scripts/functions/data/Sequence2inputs.R    |   16 +-
 .../scripts/functions/data/Sequence2inputs.dml  |    8 +-
 src/test/scripts/functions/data/StrInit.dml     |   46 +-
 .../functions/data/WriteMMComplexTest.dml       |   20 +-
 src/test/scripts/functions/data/WriteMMTest.dml |   12 +-
 .../scripts/functions/external/DynProject.R     |   32 +-
 .../scripts/functions/external/DynProject.dml   |   20 +-
 .../scripts/functions/external/DynReadWrite.dml |   36 +-
 .../functions/external/FunctionExpressions1.dml |   32 +-
 .../functions/external/FunctionExpressions2.dml |   32 +-
 src/test/scripts/functions/external/Order.R     |   22 +-
 src/test/scripts/functions/external/Order1.dml  |   18 +-
 src/test/scripts/functions/external/Order2.dml  |   18 +-
 src/test/scripts/functions/external/Outlier.dml |   38 +-
 src/test/scripts/functions/external/kMeans.dml  |   40 +-
 src/test/scripts/functions/external/kMeans2.dml |   54 +-
 src/test/scripts/functions/gdfo/LinregCG.R      |   72 +-
 src/test/scripts/functions/gdfo/LinregCG.dml    |   70 +-
 src/test/scripts/functions/gdfo/LinregDS.R      |   42 +-
 src/test/scripts/functions/gdfo/LinregDS.dml    |   36 +-
 src/test/scripts/functions/gdfo/LinregDSsimpl.R |   26 +-
 .../scripts/functions/gdfo/LinregDSsimpl.dml    |   20 +-
 src/test/scripts/functions/gdfo/MMChainLoop.R   |   32 +-
 src/test/scripts/functions/gdfo/MMChainLoop.dml |   32 +-
 .../scripts/functions/indexing/Jdk7IssueTest.R  |   26 +-
 .../functions/indexing/Jdk7IssueTest.dml        |   22 +-
 .../functions/indexing/LeftIndexingScalarTest.R |   26 +-
 .../indexing/LeftIndexingScalarTest.dml         |   18 +-
 .../indexing/LeftIndexingSparseDenseTest.R      |   26 +-
 .../indexing/LeftIndexingSparseDenseTest.dml    |   14 +-
 .../indexing/LeftIndexingSparseSparseTest.R     |   26 +-
 .../indexing/LeftIndexingSparseSparseTest.dml   |   14 +-
 .../functions/indexing/LeftIndexingTest.R       |   44 +-
 .../functions/indexing/LeftIndexingTest.dml     |   20 +-
 .../indexing/RightIndexingMatrixTest.R          |   28 +-
 .../indexing/RightIndexingMatrixTest.dml        |   16 +-
 .../indexing/RightIndexingVectorTest.R          |   30 +-
 .../indexing/RightIndexingVectorTest.dml        |   16 +-
 .../scripts/functions/io/ScalarComputeWrite.dml |   64 +-
 src/test/scripts/functions/io/ScalarRead.dml    |   46 +-
 src/test/scripts/functions/io/ScalarWrite.dml   |   16 +-
 .../scripts/functions/io/SeqParReadTest.dml     |   12 +-
 .../scripts/functions/io/csv/ReadCSVTest_1.dml  |   54 +-
 .../scripts/functions/io/csv/ReadCSVTest_2.dml  |   54 +-
 .../scripts/functions/io/csv/ReadCSVTest_3.dml  |   54 +-
 .../scripts/functions/io/csv/WriteCSVTest.dml   |   56 +-
 src/test/scripts/functions/io/csv/csv_test.dml  |   14 +-
 src/test/scripts/functions/io/csv/csv_verify.R  |   28 +-
 .../scripts/functions/io/csv/csv_verify.dml     |   14 +-
 src/test/scripts/functions/io/csv/csv_verify2.R |   22 +-
 .../scripts/functions/io/csv/csvprop_read.dml   |   28 +-
 .../scripts/functions/io/csv/csvprop_write.dml  |   14 +-
 .../functions/io/csv/in/transfusion_1.data      | 1496 +++++-----
 .../io/csv/in/transfusion_1.data.single         | 1496 +++++-----
 .../io/csv/in/transfusion_2.data.single         | 1496 +++++-----
 .../io/csv/in/transfusion_2.data/part-0         | 1182 ++++----
 .../io/csv/in/transfusion_2.data/part-1         |  312 +-
 .../io/csv/in/transfusion_3.data.single         | 1496 +++++-----
 .../io/csv/in/transfusion_3.data/part-0         | 1380 ++++-----
 .../io/csv/in/transfusion_3.data/part-1         |  114 +-
 .../scripts/functions/io/csv/writecsv_verify.R  |   24 +-
 .../functions/io/matrixmarket/ReadMMTest_1.dml  |   20 +-
 .../functions/io/matrixmarket/ReadMMTest_2.dml  |   16 +-
 .../functions/io/matrixmarket/ReadMMTest_3.dml  |   16 +-
 .../functions/io/matrixmarket/in/ReadMMTest.mtx |   60 +-
 .../functions/io/matrixmarket/mm_test1.dml      |   14 +-
 .../functions/io/matrixmarket/mm_verify.R       |   22 +-
 .../functions/io/matrixmarket/mm_verify.dml     |   14 +-
 src/test/scripts/functions/jmlc/m-svm-score.R   |   44 +-
 src/test/scripts/functions/jmlc/m-svm-score.dml |   68 +-
 .../functions/jmlc/reuse-glm-predict.dml        |  766 ++---
 .../functions/jmlc/reuse-msvm-predict.dml       |  148 +-
 .../functions/misc/ForScalarAssignmentTest.dml  |   12 +-
 .../misc/IPALiteralReplacement_ForIf.R          |   52 +-
 .../misc/IPALiteralReplacement_ForIf.dml        |   40 +-
 .../misc/IPALiteralReplacement_While.R          |   50 +-
 .../misc/IPALiteralReplacement_While.dml        |   40 +-
 .../functions/misc/IPAScalarRecursion.dml       |   34 +-
 .../functions/misc/IPAUnknownRecursion.R        |   60 +-
 .../functions/misc/IPAUnknownRecursion.dml      |   46 +-
 .../functions/misc/IfScalarAssignmentTest.dml   |   18 +-
 .../misc/InvalidFunctionSignatureTest1.dml      |   60 +-
 .../misc/InvalidFunctionSignatureTest2.dml      |   60 +-
 .../scripts/functions/misc/LengthStringTest.dml |    8 +-
 .../functions/misc/LengthUnknownCSVTest.dml     |    4 +-
 .../functions/misc/LongOverflowForLoop.dml      |   22 +-
 .../scripts/functions/misc/LongOverflowMult.dml |   14 +-
 .../scripts/functions/misc/LongOverflowPlus.dml |   14 +-
 .../scripts/functions/misc/NcolStringTest.dml   |    8 +-
 .../functions/misc/NcolUnknownCSVTest.dml       |    4 +-
 .../scripts/functions/misc/NrowStringTest.dml   |    8 +-
 .../functions/misc/NrowUnknownCSVTest.dml       |    4 +-
 .../scripts/functions/misc/OuterExpandTest.R    |   76 +-
 .../scripts/functions/misc/OuterExpandTest.dml  |   66 +-
 .../scripts/functions/misc/PackageFunCall1.dml  |   50 +-
 .../scripts/functions/misc/PackageFunCall2.dml  |   52 +-
 .../scripts/functions/misc/PackageFunLib.dml    |   52 +-
 .../misc/ParForScalarAssignmentTest.dml         |   12 +-
 .../functions/misc/PrintExpressionTest1.dml     |   46 +-
 .../functions/misc/PrintExpressionTest2.dml     |   46 +-
 .../scripts/functions/misc/PrintMatrixTest.dml  |   72 +-
 .../functions/misc/ReadAfterWriteMatrix1.dml    |   14 +-
 .../functions/misc/ReadAfterWriteMatrix2.dml    |   18 +-
 .../functions/misc/ReadAfterWriteScalar1.dml    |   14 +-
 .../functions/misc/ReadAfterWriteScalar2.dml    |   18 +-
 .../functions/misc/RewriteColSumsMVMult.R       |   18 +-
 .../functions/misc/RewriteColSumsMVMult.dml     |    8 +-
 .../functions/misc/RewriteRowSumsMVMult.R       |   18 +-
 .../functions/misc/RewriteRowSumsMVMult.dml     |    8 +-
 .../functions/misc/RewriteSlicedMatrixMult.R    |   66 +-
 .../functions/misc/RewriteSlicedMatrixMult.dml  |   56 +-
 .../functions/misc/ScalarFunctionTest1.R        |   70 +-
 .../functions/misc/ScalarFunctionTest1.dml      |   56 +-
 .../functions/misc/ScalarFunctionTest2.R        |   72 +-
 .../functions/misc/ScalarFunctionTest2.dml      |   58 +-
 .../scripts/functions/misc/TableExpandTest.R    |   82 +-
 .../scripts/functions/misc/TableExpandTest.dml  |   66 +-
 .../misc/WhileScalarAssignmentTest.dml          |   16 +-
 src/test/scripts/functions/misc/castBoolean.dml |    8 +-
 src/test/scripts/functions/misc/castDouble.dml  |    8 +-
 src/test/scripts/functions/misc/castInteger.dml |    8 +-
 .../scripts/functions/misc/castMatrixScalar.dml |    8 +-
 .../scripts/functions/misc/castScalarMatrix.dml |    8 +-
 .../functions/misc/conditionalPredicateIf.dml   |   24 +-
 .../misc/conditionalPredicateWhile.dml          |   14 +-
 .../functions/misc/conditionalValidate1.dml     |    8 +-
 .../functions/misc/conditionalValidate2.dml     |   22 +-
 .../functions/misc/conditionalValidate3.dml     |   18 +-
 .../functions/misc/conditionalValidate4.dml     |   18 +-
 .../scripts/functions/misc/dt_change_1a.dml     |   24 +-
 .../scripts/functions/misc/dt_change_1b.dml     |   24 +-
 .../scripts/functions/misc/dt_change_1c.dml     |   24 +-
 .../scripts/functions/misc/dt_change_1d.dml     |   24 +-
 .../scripts/functions/misc/dt_change_1e.dml     |   24 +-
 .../scripts/functions/misc/dt_change_1f.dml     |   24 +-
 .../scripts/functions/misc/dt_change_1g.dml     |   20 +-
 .../scripts/functions/misc/dt_change_1h.dml     |   20 +-
 .../scripts/functions/misc/dt_change_2a.dml     |   20 +-
 .../scripts/functions/misc/dt_change_2b.dml     |   20 +-
 .../scripts/functions/misc/dt_change_2c.dml     |   20 +-
 .../scripts/functions/misc/dt_change_2d.dml     |   20 +-
 .../scripts/functions/misc/dt_change_2e.dml     |   20 +-
 .../scripts/functions/misc/dt_change_2f.dml     |   20 +-
 .../scripts/functions/misc/dt_change_3a.dml     |   24 +-
 .../scripts/functions/misc/dt_change_3b.dml     |   26 +-
 .../scripts/functions/misc/dt_change_3c.dml     |   24 +-
 .../scripts/functions/misc/dt_change_3d.dml     |   24 +-
 .../scripts/functions/misc/dt_change_3e.dml     |   24 +-
 .../scripts/functions/misc/dt_change_3f.dml     |   24 +-
 .../scripts/functions/misc/dt_change_4a.dml     |   14 +-
 .../scripts/functions/misc/dt_change_4b.dml     |   14 +-
 .../scripts/functions/misc/dt_change_4c.dml     |   28 +-
 .../scripts/functions/misc/dt_change_4d.dml     |   30 +-
 .../scripts/functions/misc/dt_change_4e.dml     |   16 +-
 .../scripts/functions/misc/dt_change_4f.dml     |   16 +-
 .../scripts/functions/misc/functionInlining.dml |   44 +-
 .../functions/misc/functionNoInlining.dml       |   52 +-
 .../functions/misc/function_chain_inlining.dml  |   26 +-
 .../misc/function_chain_non_inlining.dml        |   36 +-
 .../misc/function_recursive_inlining.dml        |   52 +-
 .../functions/misc/iterablePredicate.dml        |   34 +-
 .../scripts/functions/parfor/for_pred1a.dml     |   18 +-
 .../scripts/functions/parfor/for_pred1b.dml     |   18 +-
 .../scripts/functions/parfor/for_pred2a.dml     |   24 +-
 .../scripts/functions/parfor/for_pred2b.dml     |   26 +-
 .../scripts/functions/parfor/for_pred3a.dml     |   18 +-
 .../scripts/functions/parfor/for_pred3b.dml     |   18 +-
 src/test/scripts/functions/parfor/parfor1.dml   |   16 +-
 src/test/scripts/functions/parfor/parfor10.dml  |   20 +-
 src/test/scripts/functions/parfor/parfor11.dml  |   18 +-
 src/test/scripts/functions/parfor/parfor12.dml  |   18 +-
 src/test/scripts/functions/parfor/parfor13.dml  |   18 +-
 src/test/scripts/functions/parfor/parfor14.dml  |   18 +-
 src/test/scripts/functions/parfor/parfor15.dml  |   20 +-
 src/test/scripts/functions/parfor/parfor16.dml  |   20 +-
 src/test/scripts/functions/parfor/parfor17.dml  |   22 +-
 src/test/scripts/functions/parfor/parfor18.dml  |   22 +-
 src/test/scripts/functions/parfor/parfor19.dml  |   22 +-
 src/test/scripts/functions/parfor/parfor2.dml   |   24 +-
 src/test/scripts/functions/parfor/parfor20.dml  |   24 +-
 src/test/scripts/functions/parfor/parfor21.dml  |   24 +-
 src/test/scripts/functions/parfor/parfor22.dml  |   28 +-
 src/test/scripts/functions/parfor/parfor23.dml  |   22 +-
 src/test/scripts/functions/parfor/parfor24.dml  |   22 +-
 src/test/scripts/functions/parfor/parfor25.dml  |   20 +-
 src/test/scripts/functions/parfor/parfor26.dml  |   20 +-
 src/test/scripts/functions/parfor/parfor26b.dml |   18 +-
 src/test/scripts/functions/parfor/parfor26c.dml |   18 +-
 .../scripts/functions/parfor/parfor26c2.dml     |   18 +-
 src/test/scripts/functions/parfor/parfor26d.dml |   20 +-
 src/test/scripts/functions/parfor/parfor27.dml  |   24 +-
 src/test/scripts/functions/parfor/parfor28.dml  |   24 +-
 src/test/scripts/functions/parfor/parfor28b.dml |   36 +-
 src/test/scripts/functions/parfor/parfor28c.dml |   24 +-
 src/test/scripts/functions/parfor/parfor28d.dml |   24 +-
 src/test/scripts/functions/parfor/parfor28e.dml |   28 +-
 src/test/scripts/functions/parfor/parfor28f.dml |   34 +-
 src/test/scripts/functions/parfor/parfor28g.dml |   42 +-
 src/test/scripts/functions/parfor/parfor28h.dml |   40 +-
 src/test/scripts/functions/parfor/parfor29.dml  |   20 +-
 src/test/scripts/functions/parfor/parfor3.dml   |   18 +-
 src/test/scripts/functions/parfor/parfor30.dml  |   18 +-
 src/test/scripts/functions/parfor/parfor31.dml  |   32 +-
 src/test/scripts/functions/parfor/parfor31b.dml |   32 +-
 src/test/scripts/functions/parfor/parfor32.dml  |   26 +-
 src/test/scripts/functions/parfor/parfor32b.dml |   24 +-
 src/test/scripts/functions/parfor/parfor32c.dml |   26 +-
 src/test/scripts/functions/parfor/parfor32d.dml |   18 +-
 src/test/scripts/functions/parfor/parfor32e.dml |   20 +-
 src/test/scripts/functions/parfor/parfor33.dml  |   22 +-
 src/test/scripts/functions/parfor/parfor34.dml  |   22 +-
 src/test/scripts/functions/parfor/parfor35.dml  |   24 +-
 src/test/scripts/functions/parfor/parfor35b.dml |   60 +-
 src/test/scripts/functions/parfor/parfor35c.dml |   60 +-
 src/test/scripts/functions/parfor/parfor35d.dml |   60 +-
 src/test/scripts/functions/parfor/parfor36.dml  |   16 +-
 src/test/scripts/functions/parfor/parfor37.dml  |   16 +-
 src/test/scripts/functions/parfor/parfor38.dml  |   18 +-
 src/test/scripts/functions/parfor/parfor39.dml  |   18 +-
 src/test/scripts/functions/parfor/parfor4.dml   |   18 +-
 src/test/scripts/functions/parfor/parfor40.dml  |   32 +-
 src/test/scripts/functions/parfor/parfor41.dml  |   32 +-
 src/test/scripts/functions/parfor/parfor42.dml  |   18 +-
 src/test/scripts/functions/parfor/parfor43.dml  |   18 +-
 src/test/scripts/functions/parfor/parfor44.dml  |   16 +-
 src/test/scripts/functions/parfor/parfor45.dml  |   32 +-
 src/test/scripts/functions/parfor/parfor46.dml  |   50 +-
 src/test/scripts/functions/parfor/parfor47.dml  |   50 +-
 src/test/scripts/functions/parfor/parfor48.dml  |   22 +-
 src/test/scripts/functions/parfor/parfor48b.dml |   22 +-
 src/test/scripts/functions/parfor/parfor48c.dml |   20 +-
 src/test/scripts/functions/parfor/parfor49a.dml |   24 +-
 src/test/scripts/functions/parfor/parfor49b.dml |   46 +-
 src/test/scripts/functions/parfor/parfor5.dml   |   22 +-
 src/test/scripts/functions/parfor/parfor50.dml  |   98 +-
 src/test/scripts/functions/parfor/parfor51.dml  |   22 +-
 src/test/scripts/functions/parfor/parfor52.dml  |   24 +-
 src/test/scripts/functions/parfor/parfor6.dml   |   16 +-
 src/test/scripts/functions/parfor/parfor7.dml   |   18 +-
 src/test/scripts/functions/parfor/parfor8.dml   |   20 +-
 src/test/scripts/functions/parfor/parfor9.dml   |   20 +-
 src/test/scripts/functions/parfor/parfor_NaN1.R |   38 +-
 .../scripts/functions/parfor/parfor_NaN1.dml    |   28 +-
 src/test/scripts/functions/parfor/parfor_NaN2.R |   38 +-
 .../scripts/functions/parfor/parfor_NaN2.dml    |   28 +-
 .../parfor_cdatapartition_leftindexing.dml      |   28 +-
 .../functions/parfor/parfor_cdatapartitioning.R |   38 +-
 .../parfor/parfor_cdatapartitioning1.dml        |   28 +-
 .../parfor/parfor_cdatapartitioning2.dml        |   28 +-
 .../parfor/parfor_cdatapartitioning3.dml        |   28 +-
 .../parfor/parfor_cdatapartitioning4.dml        |   28 +-
 .../parfor/parfor_cdatapartitioning5.dml        |   28 +-
 .../parfor/parfor_cdatapartitioning6.R          |   38 +-
 .../parfor/parfor_cdatapartitioning6.dml        |   28 +-
 .../parfor/parfor_cdatapartitioning7.dml        |   28 +-
 .../parfor/parfor_cdatapartitioning8.dml        |   28 +-
 .../parfor/parfor_cdatapartitioning9.dml        |   28 +-
 .../scripts/functions/parfor/parfor_extfunct.R  |   36 +-
 .../functions/parfor/parfor_extfunct.dml        |   48 +-
 .../scripts/functions/parfor/parfor_funct.R     |   36 +-
 .../scripts/functions/parfor/parfor_funct.dml   |   36 +-
 .../functions/parfor/parfor_literals1a.dml      |   26 +-
 .../functions/parfor/parfor_literals1b.dml      |   26 +-
 .../functions/parfor/parfor_literals1c.dml      |   32 +-
 .../functions/parfor/parfor_literals2.dml       |   26 +-
 .../functions/parfor/parfor_literals3.dml       |   22 +-
 .../functions/parfor/parfor_literals4a.dml      |   22 +-
 .../functions/parfor/parfor_literals4b.dml      |   22 +-
 .../functions/parfor/parfor_mdatapartitioning.R |   72 +-
 .../parfor/parfor_mdatapartitioning1.dml        |   50 +-
 .../parfor/parfor_mdatapartitioning2.dml        |   48 +-
 .../functions/parfor/parfor_optimizer1.R        |   68 +-
 .../functions/parfor/parfor_optimizer1.dml      |   62 +-
 .../functions/parfor/parfor_optimizer2.R        |  270 +-
 .../functions/parfor/parfor_optimizer2.dml      |  512 ++--
 .../functions/parfor/parfor_optimizer3.R        |   42 +-
 .../functions/parfor/parfor_optimizer3.dml      |   60 +-
 .../functions/parfor/parfor_pr_resultmerge1a.R  |   42 +-
 .../parfor/parfor_pr_resultmerge1a.dml          |   26 +-
 .../functions/parfor/parfor_pr_resultmerge1b.R  |   42 +-
 .../parfor/parfor_pr_resultmerge1b.dml          |   26 +-
 .../functions/parfor/parfor_pr_resultmerge1c.R  |   42 +-
 .../parfor/parfor_pr_resultmerge1c.dml          |   26 +-
 .../functions/parfor/parfor_pr_resultmerge1d.R  |   42 +-
 .../parfor/parfor_pr_resultmerge1d.dml          |   26 +-
 .../functions/parfor/parfor_pr_resultmerge2.R   |   46 +-
 .../functions/parfor/parfor_pr_resultmerge2.dml |   30 +-
 .../functions/parfor/parfor_pr_resultmerge32.R  |  166 +-
 .../parfor/parfor_pr_resultmerge32.dml          |  152 +-
 .../parfor_rdatapartition_leftindexing.dml      |   30 +-
 .../functions/parfor/parfor_rdatapartitioning.R |   38 +-
 .../parfor/parfor_rdatapartitioning1.dml        |   28 +-
 .../parfor/parfor_rdatapartitioning2.dml        |   28 +-
 .../parfor/parfor_rdatapartitioning3.dml        |   28 +-
 .../parfor/parfor_rdatapartitioning4.dml        |   28 +-
 .../parfor/parfor_rdatapartitioning5.dml        |   28 +-
 .../parfor/parfor_rdatapartitioning6.R          |   38 +-
 .../parfor/parfor_rdatapartitioning6.dml        |   28 +-
 .../parfor/parfor_rdatapartitioning7.dml        |   28 +-
 .../parfor/parfor_rdatapartitioning8.dml        |   28 +-
 .../parfor/parfor_rdatapartitioning9.dml        |   28 +-
 .../functions/parfor/parfor_repeatedopt1.R      |   44 +-
 .../functions/parfor/parfor_repeatedopt1.dml    |   38 +-
 .../functions/parfor/parfor_repeatedopt2.R      |   54 +-
 .../functions/parfor/parfor_repeatedopt2.dml    |   48 +-
 .../functions/parfor/parfor_repeatedopt3.R      |   60 +-
 .../functions/parfor/parfor_repeatedopt3.dml    |   54 +-
 .../parfor/parfor_threadid_recompile1.dml       |   58 +-
 .../parfor/parfor_threadid_recompile2.dml       |   58 +-
 .../piggybacking/Piggybacking1_append.dml       |   62 +-
 .../piggybacking/Piggybacking1_mvmult.R         |   64 +-
 .../piggybacking/Piggybacking1_mvmult.dml       |   56 +-
 .../piggybacking/Piggybacking_eliminate.dml     |   72 +-
 .../functions/piggybacking/Piggybacking_iqm.dml |   64 +-
 .../quaternary/RewriteWeightedSigmoid.R         |   70 +-
 .../scripts/functions/quaternary/WeightedCeMM.R |   72 +-
 .../functions/quaternary/WeightedDivMMLeft.R    |   72 +-
 .../quaternary/WeightedDivMMMultBasic.R         |   72 +-
 .../quaternary/WeightedDivMMMultLeft.R          |   72 +-
 .../quaternary/WeightedDivMMMultMinusLeft.R     |   72 +-
 .../quaternary/WeightedDivMMMultMinusRight.R    |   72 +-
 .../quaternary/WeightedDivMMMultRight.R         |   72 +-
 .../functions/quaternary/WeightedDivMMRight.R   |   72 +-
 .../functions/quaternary/WeightedSigmoidP1.R    |   32 +-
 .../functions/quaternary/WeightedSigmoidP2.R    |   32 +-
 .../functions/quaternary/WeightedSigmoidP3.R    |   32 +-
 .../functions/quaternary/WeightedSigmoidP4.R    |   32 +-
 .../quaternary/WeightedSquaredLossNo.R          |   32 +-
 .../quaternary/WeightedSquaredLossNo2.R         |   74 +-
 .../quaternary/WeightedSquaredLossPost.R        |   34 +-
 .../quaternary/WeightedSquaredLossPost2.R       |   76 +-
 .../quaternary/WeightedSquaredLossPostNz.R      |   76 +-
 .../quaternary/WeightedSquaredLossPre.R         |   34 +-
 .../quaternary/WeightedSquaredLossPre2.R        |   76 +-
 .../quaternary/WeightedUnaryMMExpDiv.R          |   72 +-
 .../quaternary/WeightedUnaryMMExpMult.R         |   72 +-
 .../functions/quaternary/WeightedUnaryMMMult2.R |   72 +-
 .../functions/quaternary/WeightedUnaryMMPow2.R  |   72 +-
 .../recompile/LiteralReplaceCastScalar.dml      |   42 +-
 .../scripts/functions/recompile/append_nnz.dml  |   44 +-
 .../recompile/constant_propagation_if.R         |   40 +-
 .../recompile/constant_propagation_if.dml       |   26 +-
 .../recompile/constant_propagation_sb.R         |   52 +-
 .../recompile/constant_propagation_sb.dml       |   36 +-
 .../recompile/constant_propagation_while.R      |   44 +-
 .../recompile/constant_propagation_while.dml    |   30 +-
 .../functions/recompile/csv_read_unknown.dml    |   24 +-
 .../functions/recompile/for_recompile.dml       |   14 +-
 .../recompile/for_recompile_func_sparse.dml     |   64 +-
 .../recompile/for_recompile_sparse.dml          |   34 +-
 .../functions/recompile/funct_recompile.R       |   34 +-
 .../functions/recompile/funct_recompile.dml     |   58 +-
 .../functions/recompile/grpagg_rand_recompile.R |   22 +-
 .../recompile/grpagg_rand_recompile.dml         |   12 +-
 .../functions/recompile/if_branch_removal.R     |   52 +-
 .../functions/recompile/if_branch_removal.dml   |   48 +-
 .../functions/recompile/if_recompile.dml        |   14 +-
 .../recompile/if_recompile_func_sparse.dml      |   56 +-
 .../functions/recompile/if_recompile_sparse.dml |   26 +-
 .../recompile/multiple_function_calls1.R        |   36 +-
 .../recompile/multiple_function_calls1.dml      |   56 +-
 .../recompile/multiple_function_calls2.R        |   36 +-
 .../recompile/multiple_function_calls2.dml      |   56 +-
 .../recompile/multiple_function_calls3.R        |   36 +-
 .../recompile/multiple_function_calls3.dml      |   56 +-
 .../recompile/multiple_function_calls4.R        |   36 +-
 .../recompile/multiple_function_calls4.dml      |   56 +-
 .../recompile/multiple_function_calls5.R        |   36 +-
 .../recompile/multiple_function_calls5.dml      |   58 +-
 .../functions/recompile/multiple_reads.R        |   26 +-
 .../functions/recompile/multiple_reads.dml      |   16 +-
 .../functions/recompile/parfor_recompile.dml    |   14 +-
 .../recompile/parfor_recompile_func_sparse.dml  |   56 +-
 .../recompile/parfor_recompile_sparse.dml       |   24 +-
 .../functions/recompile/rand_recompile.dml      |   26 +-
 .../functions/recompile/rand_recompile2.dml     |   32 +-
 .../functions/recompile/rand_recompile3.dml     |   32 +-
 .../functions/recompile/rand_size_expr_eval.dml |   28 +-
 .../functions/recompile/rblk_recompile1.R       |   14 +-
 .../functions/recompile/rblk_recompile1.dml     |    4 +-
 .../functions/recompile/rblk_recompile2.R       |   18 +-
 .../functions/recompile/rblk_recompile2.dml     |    6 +-
 .../functions/recompile/rblk_recompile3.R       |   18 +-
 .../functions/recompile/rblk_recompile3.dml     |    8 +-
 .../recompile/remove_empty_potpourri1.R         |   18 +-
 .../recompile/remove_empty_potpourri1.dml       |    6 +-
 .../recompile/remove_empty_potpourri2.R         |   16 +-
 .../recompile/remove_empty_potpourri2.dml       |   14 +-
 .../recompile/remove_empty_potpourri3.R         |   26 +-
 .../recompile/remove_empty_potpourri3.dml       |   28 +-
 .../recompile/remove_empty_potpourri4.R         |   80 +-
 .../recompile/remove_empty_potpourri4.dml       |   82 +-
 .../recompile/remove_empty_recompile.R          |  106 +-
 .../recompile/remove_empty_recompile.dml        |  100 +-
 .../functions/recompile/rewrite_mapmultchain1.R |   28 +-
 .../recompile/rewrite_mapmultchain1.dml         |   28 +-
 .../functions/recompile/rewrite_mapmultchain2.R |   28 +-
 .../recompile/rewrite_mapmultchain2.dml         |   28 +-
 .../functions/recompile/while_recompile.dml     |   14 +-
 .../recompile/while_recompile_func_sparse.dml   |   62 +-
 .../recompile/while_recompile_sparse.dml        |   32 +-
 src/test/scripts/functions/reorg/DiagV2MTest.R  |   24 +-
 .../scripts/functions/reorg/DiagV2MTest.dml     |   12 +-
 .../scripts/functions/reorg/MatrixReshape1.R    |   24 +-
 .../scripts/functions/reorg/MatrixReshape1.dml  |    8 +-
 .../scripts/functions/reorg/MatrixReshape2.R    |   24 +-
 .../scripts/functions/reorg/MatrixReshape2.dml  |    8 +-
 src/test/scripts/functions/reorg/Order.R        |   46 +-
 src/test/scripts/functions/reorg/Order.dml      |   14 +-
 src/test/scripts/functions/reorg/OrderDyn.R     |   44 +-
 src/test/scripts/functions/reorg/OrderDyn.dml   |   18 +-
 src/test/scripts/functions/reorg/Reverse1.R     |   82 +-
 src/test/scripts/functions/reorg/Reverse1.dml   |   48 +-
 src/test/scripts/functions/reorg/Reverse2.R     |   82 +-
 src/test/scripts/functions/reorg/Reverse2.dml   |   48 +-
 src/test/scripts/functions/reorg/Transpose.R    |   24 +-
 src/test/scripts/functions/reorg/Transpose.dml  |    8 +-
 .../scripts/functions/ternary/CTableRowHist.R   |   46 +-
 .../functions/ternary/CTableSequenceLeft.R      |   26 +-
 .../functions/ternary/CTableSequenceRight.R     |   26 +-
 .../functions/ternary/CentralMomentWeights.R    |   34 +-
 .../functions/ternary/CovarianceWeights.R       |   34 +-
 src/test/scripts/functions/ternary/IQMWeights.R |   48 +-
 .../scripts/functions/ternary/MedianWeights.R   |   30 +-
 .../scripts/functions/ternary/QuantileWeights.R |   32 +-
 .../scripts/functions/ternary/TableOutputTest.R |   28 +-
 src/test/scripts/functions/transform/Apply.dml  |   18 +-
 src/test/scripts/functions/transform/Scaling.R  |   30 +-
 .../scripts/functions/transform/Scaling.dml     |   18 +-
 .../scripts/functions/transform/Transform.dml   |   18 +-
 .../functions/transform/Transform_colnames.dml  |   20 +-
 .../functions/transform/input/homes/homes.csv   |  402 +--
 .../transform/input/homes/homesAllMissing.csv   |  402 +--
 .../input/homes/homesAllMissing.tfidspec.json   |   10 +-
 .../input/homes/homesAllMissing.tfspec.json     |    8 +-
 .../input/homes/homesOmit.tfidspec.json         |   28 +-
 .../transform/input/homes/homesOmit.tfspec.json |   26 +-
 .../transform/input/homes2/homes.csv/homes1.csv |  196 +-
 .../transform/input/homes2/homes.csv/homes2.csv |  204 +-
 .../transform/input/homes2/homes.tfidspec.json  |   44 +-
 .../transform/input/homes2/homes.tfspec.json    |   42 +-
 .../transform/input/homes2/homes.tfspec2.json   |   42 +-
 .../functions/transform/input/iris/iris.csv     |  302 +-
 .../transform/input/iris/iris.transformed.csv   |  302 +-
 .../scripts/functions/unary/matrix/ACosTest.dml |   20 +-
 .../scripts/functions/unary/matrix/ASinTest.dml |   20 +-
 .../scripts/functions/unary/matrix/ATanTest.dml |   20 +-
 src/test/scripts/functions/unary/matrix/Ceil.R  |   24 +-
 .../scripts/functions/unary/matrix/Cummax.R     |   34 +-
 .../scripts/functions/unary/matrix/Cummin.R     |   34 +-
 .../scripts/functions/unary/matrix/Cumprod.R    |   34 +-
 .../scripts/functions/unary/matrix/Cumsum.R     |   34 +-
 src/test/scripts/functions/unary/matrix/Floor.R |   24 +-
 .../scripts/functions/unary/matrix/Inverse.R    |   26 +-
 .../scripts/functions/unary/matrix/Inverse.dml  |   18 +-
 src/test/scripts/functions/unary/matrix/Minus.R |   26 +-
 .../scripts/functions/unary/matrix/Minus.dml    |    8 +-
 .../scripts/functions/unary/matrix/QRsolve.R    |   88 +-
 .../scripts/functions/unary/matrix/QRsolve.dml  |   84 +-
 .../scripts/functions/unary/matrix/RoundTest.R  |   24 +-
 src/test/scripts/functions/unary/matrix/SProp.R |   26 +-
 .../scripts/functions/unary/matrix/SelPos.R     |   68 +-
 .../scripts/functions/unary/matrix/Sigmoid.R    |   26 +-
 src/test/scripts/functions/unary/matrix/Sign1.R |   66 +-
 src/test/scripts/functions/unary/matrix/Sign2.R |   66 +-
 .../scripts/functions/unary/matrix/eigen.dml    |   78 +-
 src/test/scripts/functions/unary/matrix/lu.dml  |   36 +-
 src/test/scripts/functions/unary/matrix/qr.dml  |  100 +-
 .../functions/unary/matrix/removeEmpty2.dml     |    8 +-
 .../functions/unary/matrix/removeEmpty3.dml     |   10 +-
 .../functions/unary/matrix/removeEmpty4.dml     |    6 +-
 .../functions/unary/matrix/replace_Infinity.R   |   26 +-
 .../functions/unary/matrix/replace_Infinity.dml |    8 +-
 .../functions/unary/matrix/replace_NInfinity.R  |   26 +-
 .../unary/matrix/replace_NInfinity.dml          |    8 +-
 .../functions/unary/matrix/replace_NaN.R        |   26 +-
 .../functions/unary/matrix/replace_NaN.dml      |    8 +-
 .../functions/unary/matrix/replace_maxmin.R     |   26 +-
 .../functions/unary/matrix/replace_maxmin.dml   |    6 +-
 .../functions/unary/matrix/replace_value.R      |   26 +-
 .../functions/unary/matrix/replace_value.dml    |    6 +-
 .../scripts/functions/unary/scalar/ACosTest.dml |   24 +-
 .../scripts/functions/unary/scalar/ASinTest.dml |   24 +-
 .../scripts/functions/unary/scalar/ATanTest.dml |   24 +-
 .../functions/unary/scalar/DFTest_CHISQ.R       |   32 +-
 .../functions/unary/scalar/DFTest_CHISQ.dml     |   24 +-
 .../scripts/functions/unary/scalar/DFTest_EXP.R |   32 +-
 .../functions/unary/scalar/DFTest_EXP.dml       |   24 +-
 .../unary/scalar/DFTest_EXP_NOPARAMS.R          |   32 +-
 .../unary/scalar/DFTest_EXP_NOPARAMS.dml        |   24 +-
 .../scripts/functions/unary/scalar/DFTest_F.R   |   32 +-
 .../scripts/functions/unary/scalar/DFTest_F.dml |   24 +-
 .../functions/unary/scalar/DFTest_NORMAL.R      |   32 +-
 .../functions/unary/scalar/DFTest_NORMAL.dml    |   24 +-
 .../functions/unary/scalar/DFTest_NORMAL_MEAN.R |   32 +-
 .../unary/scalar/DFTest_NORMAL_MEAN.dml         |   24 +-
 .../unary/scalar/DFTest_NORMAL_NOPARAMS.R       |   32 +-
 .../unary/scalar/DFTest_NORMAL_NOPARAMS.dml     |   24 +-
 .../functions/unary/scalar/DFTest_NORMAL_SD.R   |   32 +-
 .../functions/unary/scalar/DFTest_NORMAL_SD.dml |   24 +-
 .../scripts/functions/unary/scalar/DFTest_T.R   |   32 +-
 .../scripts/functions/unary/scalar/DFTest_T.dml |   24 +-
 .../functions/unary/scalar/PrintTest3.dml       |   60 +-
 .../functions/unary/scalar/StopTest2.dml        |   18 +-
 .../functions/unary/scalar/StopTestLoops_fn.dml |   44 +-
 .../unary/scalar/StopTestLoops_for.dml          |   30 +-
 .../unary/scalar/StopTestLoops_parfor.dml       |   22 +-
 .../unary/scalar/StopTestLoops_while.dml        |   32 +-
 .../vect/VectorizeForLoopBinaryColNeg.R         |   34 +-
 .../vect/VectorizeForLoopBinaryColPos.R         |   34 +-
 .../vect/VectorizeForLoopBinaryRowNeg.R         |   34 +-
 .../vect/VectorizeForLoopBinaryRowPos.R         |   34 +-
 .../vect/VectorizeForLoopLeftScalarColNeg.R     |   38 +-
 .../vect/VectorizeForLoopLeftScalarColPos.R     |   36 +-
 .../vect/VectorizeForLoopLeftScalarRowNeg.R     |   38 +-
 .../vect/VectorizeForLoopLeftScalarRowPos.R     |   36 +-
 .../vect/VectorizeForLoopRightScalarColNeg.R    |   38 +-
 .../vect/VectorizeForLoopRightScalarColPos.R    |   36 +-
 .../vect/VectorizeForLoopRightScalarRowNeg.R    |   38 +-
 .../vect/VectorizeForLoopRightScalarRowPos.R    |   36 +-
 .../vect/VectorizeForLoopUnaryColNeg.R          |   34 +-
 .../vect/VectorizeForLoopUnaryColPos.R          |   32 +-
 .../vect/VectorizeForLoopUnaryRowNeg.R          |   34 +-
 .../vect/VectorizeForLoopUnaryRowPos.R          |   32 +-
 .../scripts/functions/vect/VectorizeLixColNeg.R |   30 +-
 .../scripts/functions/vect/VectorizeLixColPos.R |   30 +-
 .../scripts/functions/vect/VectorizeLixRowNeg.R |   30 +-
 .../scripts/functions/vect/VectorizeLixRowPos.R |   32 +-
 .../scripts/functions/vect/VectorizeRixColNeg.R |   32 +-
 .../scripts/functions/vect/VectorizeRixColPos.R |   32 +-
 .../scripts/functions/vect/VectorizeRixRowNeg.R |   32 +-
 .../scripts/functions/vect/VectorizeRixRowPos.R |   32 +-
 826 files changed, 52535 insertions(+), 52522 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/816e2db8/.gitattributes
----------------------------------------------------------------------
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..a8edefd
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,13 @@
+# Set the default behavior to have all files normalized to Unix-style
+# line endings upon check-in.
+* text=auto
+
+# Declare files that will always have CRLF line endings on checkout.
+*.bat text eol=crlf
+
+# Denote all files that are truly binary and should not be modified.
+*.dll binary
+*.exp binary
+*.lib binary
+*.pdb binary
+*.exe binary

http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/816e2db8/docs/devdocs/MatrixMultiplicationOperators.txt
----------------------------------------------------------------------
diff --git a/docs/devdocs/MatrixMultiplicationOperators.txt b/docs/devdocs/MatrixMultiplicationOperators.txt
index 7bc8a9c..962951c 100644
--- a/docs/devdocs/MatrixMultiplicationOperators.txt
+++ b/docs/devdocs/MatrixMultiplicationOperators.txt
@@ -1,128 +1,128 @@
-#####################################################################
-# TITLE: An Overview of Matrix Multiplication Operators in SystemML #
-# DATE MODIFIED: 11/21/2015                                         #
-#####################################################################
-
-In the following, we give an overview of backend-specific physical matrix multiplication operators in SystemML as well as their internally used matrix multiplication block operations.
-
-A) BASIC MATRIX MULT OPERATORS 
--------------------------------
-
-An AggBinaryOp hop can be compiled into the following physical operators.
-
-* 1) Physical Operators in CP (single node, control program)
-  - MM (basic matrix multiplication)                     --> mm
-  - MMChain (matrix multiplication chain)                --> mmchain
-  - TSMM (transpose-self matrix multiplication)          --> tsmm
-  - PMM (permutation matrix multiplication)              --> pmm
-
-* 2) Physical Operator in MR (distributed, mapreduce)
-  - MapMM (map-side matrix multiplication, w/|w/o agg)   --> mm
-  - MapMMChain (map-side matrix chain multiplication)    --> mmchain
-  - TSMM (map-side transpose-self matrix multiplication) --> tsmm
-  - PMM (map-side permutation matrix multiplication)     --> pmm
-  - CPMM (cross-product matrix multiplication, 2 jobs)   --> mm
-  - RMM (replication-based matrix multiplication, 1 job) --> mm
-
-* 3) Physical Operators in SPARK (distributed, spark)
-  - MapMM (see MR, flatmap/mappartitions/maptopair +     --> mm
-    reduce/reducebykey/no_aggregation)                   
-  - MapMMChain (see MR, mapvalues/maptopair + reduce)    --> mmchain
-  - TSMM (see MR, mapvalues + reduce)                    --> tsmm
-  - PMM (see MR, flatmaptopair + reducebykey)            --> pmm
-  - CPMM (see MR, 2 x maptopair + join + maptopair +     --> mm
-    reduce/reducebykey) 
-  - RMM (see MR, 2 x flatmap + join + maptopair +        --> mm
-    reducebykey) 
-  - ZIPMM (partitioning-preserving 1-1 zipping mm,       --> mm
-    join + mapvalues + reduce) 
-
-
-B) COMPLEX MATRIX MULT OPERATORS
--------------------------------  
-
-A QuaternaryOp hop can be compiled into the following physical operators. Note that wsloss, wsigmoid, wdivmm have different semantics though. The main goal of these operators is to prevent the creation of dense "outer" products via selective computation over a sparse driver (sparse matrix and sparse-safe operation).
- 
-* 1) Physical Operators in CP (single node, control program)
-  - WSLoss (weighted squared loss)                       --> wsloss
-  - WSigmoid (weighted sigmoid)                          --> wsigmoid
-  - WDivMM (weighted divide matrix multiplication)       --> wdivmm
-  - WCeMM (weighted cross entropy matrix multiplication) --> wcemm
-  - WuMM (weighted unary op matrix multiplication)       --> wumm
-
-* 2) Physical Operator in MR (distributed, mapreduce)
-  - MapWSLoss (map-side weighted squared loss)           --> wsloss
-  - RedWSLoss (reduce-side weighted squared loss)        --> wsloss
-  - MapWSigmoid (map-side weighted sigmoid)              --> wsigmoid
-  - RedWSigmoid (reduce-side weighted sigmoid)           --> wsigmoid
-  - MapWDivMM (map-side weighted divide matrix mult)     --> wdivmm
-  - RedWDivMM (reduce-side weighted divide matrix mult)  --> wdivmm
-  - MapWCeMM (map-side weighted cross entr. matrix mult) --> wcemm
-  - RedWCeMM (reduce-side w. cross entr. matrix mult)    --> wcemm
-  - MapWuMM (map-side weighted unary op matrix mult)     --> wumm
-  - RedWuMM (reduce-side weighted unary op matrix mult)  --> wumm
-
-* 3) Physical Operators in SPARK (distributed, spark)
-  - MapWSLoss (see MR, mappartitions + reduce)           --> wsloss           
-  - RedWSLoss (see MR, 1/2x flatmaptopair + 1-3x join +  --> wsloss
-    maptopair + reduce)
-  - MapWSigmoid (see MR, mappartitions)                  --> wsigmoid
-  - RedWSigmoid (see MR, 1/2x flatmaptopair +            --> wsigmoid
-    1/2x join + maptopair)          
-  - MapWDivMM (see MR, mappartitions + reducebykey )     --> wdivmm
-  - RedWDivMM (see MR, 1/2x flatmaptopair + 1/2x join +  --> wdivmm 
-    maptopair + reducebykey)  
-  - MapWCeMM (see MR, mappartitions + reduce)            --> wcemm           
-  - RedWCeMM (see MR, 1/2x flatmaptopair + 1/2x join +   --> wcemm 
-    maptopair + reduce)  
-  - MapWuMM (see MR, mappartitions)                      --> wumm
-  - RedWuMM (see MR, 1/2x flatmaptopair +                --> wumm
-    1/2x join + maptopair)          
-  
-  
-C) CORE MATRIX MULT PRIMITIVES LibMatrixMult (incl related script patterns)
--------------------------------  
-* 1) mm       (general A %*% B)
-  - sequential / multi-threaded (same block ops, par over rows in A)
-  - dense-dense, dense-sparse, sparse-dense, sparse-sparse, ultra-sparse*
-  - ~20 special cases for matrix-vector, vector-vector, etc
-  
-* 2) mmchain  ((a) t(X) %*% (X %*% v), (b) t(X) %*% (w * (X %*% v)))
-  - sequential / multi-threaded (same block ops, par over rows in X)
-  - dense / sparse x 2 patterns
-
-* 3) tsmm     ((a) t(X) %*% X, (b) X %*% t(X)
-  - sequential / multi-threaded (same block ops, par over rows in R, 2x tasks)
-  - dense / sparse x 2 patterns; special cases for dot products
-
-* 4) pmm      (removeEmpty(diag(v), "rows") %*% X)
-  - sequential / multi-threaded (same block ops, par over rows in X)
-  - sparse-sparse, dense-dense, sparse-dense
-
-* 5) wsloss   ((a) sum(W*(X-U%*%t(V))^2), (b) sum((X-W*(U%*%t(V)))^2), 
-               (c) sum((X-(U%*%t(V)))^2)), (d) sum(W*(U%*%t(V)-X)^2),
-               (e) sum((W*(U%*%t(V))-X)^2), (f) sum(((U%*%t(V))-X)^2))
-  - sequential / multi-threaded (same block ops, par over rows in W/X)                 
-  - all dense, sparse-dense factors, sparse/dense-* x 3 patterns      
-  - special patterns for (a) and (d) if W is X!=0      
-
-* 6) wsigmoid ((a) W*sigmoid(Y%*%t(X))), (b) W*sigmoid(-(Y%*%t(X))), 
-               (c) W*log(sigmoid(Y%*%t(X))), (d) W*log(sigmoid(-(Y%*%t(X))))) 
-  - sequential / multi-threaded (same block ops, par over rows in W)                 
-  - all dense, sparse-dense factors, sparse/dense-* x 4 patterns                   
-
-* 7) wdivmm   ((a) t(t(U)%*%(W/(U%*%t(V)))), (b) (W/(U%*%t(V)))%*%V,
-               (c) t(t(U)%*%(W*(U%*%t(V)))), (d) (W*(U%*%t(V)))%*%V, 
-               (e) W*(U%*%t(V)), (f) t(t(U)%*%((X!=0)*(U%*%t(V)-X))),
-               (g) ((X!=0)*(U%*%t(V)-X)%*%V)
-  - sequential / multi-threaded (same block ops, par over rows in X)                 
-  - all dense, sparse-dense factors, sparse/dense-* x 7 patterns
-
-* 8) wcemm    (sum(X*log(U%*%t(V))))  
-  - sequential / multi-threaded (same block ops, par over rows in X)                 
-  - all dense, sparse-dense factors, sparse/dense-*, 1 pattern
-
-* 9) wumm     ((a) X*uop(U%*%t(V)), (b) X/uop(U%*%t(V)))
-  - any unary operator, e.g., X*exp(U%*%t(V)) or X*(U%*%t(V))^2  
-  - sequential / multi-threaded (same block ops, par over rows in X)                 
-  - all dense, sparse-dense factors, sparse/dense-*, 2 pattern
+#####################################################################
+# TITLE: An Overview of Matrix Multiplication Operators in SystemML #
+# DATE MODIFIED: 11/21/2015                                         #
+#####################################################################
+
+In the following, we give an overview of backend-specific physical matrix multiplication operators in SystemML as well as their internally used matrix multiplication block operations.
+
+A) BASIC MATRIX MULT OPERATORS 
+-------------------------------
+
+An AggBinaryOp hop can be compiled into the following physical operators.
+
+* 1) Physical Operators in CP (single node, control program)
+  - MM (basic matrix multiplication)                     --> mm
+  - MMChain (matrix multiplication chain)                --> mmchain
+  - TSMM (transpose-self matrix multiplication)          --> tsmm
+  - PMM (permutation matrix multiplication)              --> pmm
+
+* 2) Physical Operator in MR (distributed, mapreduce)
+  - MapMM (map-side matrix multiplication, w/|w/o agg)   --> mm
+  - MapMMChain (map-side matrix chain multiplication)    --> mmchain
+  - TSMM (map-side transpose-self matrix multiplication) --> tsmm
+  - PMM (map-side permutation matrix multiplication)     --> pmm
+  - CPMM (cross-product matrix multiplication, 2 jobs)   --> mm
+  - RMM (replication-based matrix multiplication, 1 job) --> mm
+
+* 3) Physical Operators in SPARK (distributed, spark)
+  - MapMM (see MR, flatmap/mappartitions/maptopair +     --> mm
+    reduce/reducebykey/no_aggregation)                   
+  - MapMMChain (see MR, mapvalues/maptopair + reduce)    --> mmchain
+  - TSMM (see MR, mapvalues + reduce)                    --> tsmm
+  - PMM (see MR, flatmaptopair + reducebykey)            --> pmm
+  - CPMM (see MR, 2 x maptopair + join + maptopair +     --> mm
+    reduce/reducebykey) 
+  - RMM (see MR, 2 x flatmap + join + maptopair +        --> mm
+    reducebykey) 
+  - ZIPMM (partitioning-preserving 1-1 zipping mm,       --> mm
+    join + mapvalues + reduce) 
+
+
+B) COMPLEX MATRIX MULT OPERATORS
+-------------------------------  
+
+A QuaternaryOp hop can be compiled into the following physical operators. Note that wsloss, wsigmoid, wdivmm have different semantics though. The main goal of these operators is to prevent the creation of dense "outer" products via selective computation over a sparse driver (sparse matrix and sparse-safe operation).
+ 
+* 1) Physical Operators in CP (single node, control program)
+  - WSLoss (weighted squared loss)                       --> wsloss
+  - WSigmoid (weighted sigmoid)                          --> wsigmoid
+  - WDivMM (weighted divide matrix multiplication)       --> wdivmm
+  - WCeMM (weighted cross entropy matrix multiplication) --> wcemm
+  - WuMM (weighted unary op matrix multiplication)       --> wumm
+
+* 2) Physical Operator in MR (distributed, mapreduce)
+  - MapWSLoss (map-side weighted squared loss)           --> wsloss
+  - RedWSLoss (reduce-side weighted squared loss)        --> wsloss
+  - MapWSigmoid (map-side weighted sigmoid)              --> wsigmoid
+  - RedWSigmoid (reduce-side weighted sigmoid)           --> wsigmoid
+  - MapWDivMM (map-side weighted divide matrix mult)     --> wdivmm
+  - RedWDivMM (reduce-side weighted divide matrix mult)  --> wdivmm
+  - MapWCeMM (map-side weighted cross entr. matrix mult) --> wcemm
+  - RedWCeMM (reduce-side w. cross entr. matrix mult)    --> wcemm
+  - MapWuMM (map-side weighted unary op matrix mult)     --> wumm
+  - RedWuMM (reduce-side weighted unary op matrix mult)  --> wumm
+
+* 3) Physical Operators in SPARK (distributed, spark)
+  - MapWSLoss (see MR, mappartitions + reduce)           --> wsloss           
+  - RedWSLoss (see MR, 1/2x flatmaptopair + 1-3x join +  --> wsloss
+    maptopair + reduce)
+  - MapWSigmoid (see MR, mappartitions)                  --> wsigmoid
+  - RedWSigmoid (see MR, 1/2x flatmaptopair +            --> wsigmoid
+    1/2x join + maptopair)          
+  - MapWDivMM (see MR, mappartitions + reducebykey )     --> wdivmm
+  - RedWDivMM (see MR, 1/2x flatmaptopair + 1/2x join +  --> wdivmm 
+    maptopair + reducebykey)  
+  - MapWCeMM (see MR, mappartitions + reduce)            --> wcemm           
+  - RedWCeMM (see MR, 1/2x flatmaptopair + 1/2x join +   --> wcemm 
+    maptopair + reduce)  
+  - MapWuMM (see MR, mappartitions)                      --> wumm
+  - RedWuMM (see MR, 1/2x flatmaptopair +                --> wumm
+    1/2x join + maptopair)          
+  
+  
+C) CORE MATRIX MULT PRIMITIVES LibMatrixMult (incl related script patterns)
+-------------------------------  
+* 1) mm       (general A %*% B)
+  - sequential / multi-threaded (same block ops, par over rows in A)
+  - dense-dense, dense-sparse, sparse-dense, sparse-sparse, ultra-sparse*
+  - ~20 special cases for matrix-vector, vector-vector, etc
+  
+* 2) mmchain  ((a) t(X) %*% (X %*% v), (b) t(X) %*% (w * (X %*% v)))
+  - sequential / multi-threaded (same block ops, par over rows in X)
+  - dense / sparse x 2 patterns
+
+* 3) tsmm     ((a) t(X) %*% X, (b) X %*% t(X)
+  - sequential / multi-threaded (same block ops, par over rows in R, 2x tasks)
+  - dense / sparse x 2 patterns; special cases for dot products
+
+* 4) pmm      (removeEmpty(diag(v), "rows") %*% X)
+  - sequential / multi-threaded (same block ops, par over rows in X)
+  - sparse-sparse, dense-dense, sparse-dense
+
+* 5) wsloss   ((a) sum(W*(X-U%*%t(V))^2), (b) sum((X-W*(U%*%t(V)))^2), 
+               (c) sum((X-(U%*%t(V)))^2)), (d) sum(W*(U%*%t(V)-X)^2),
+               (e) sum((W*(U%*%t(V))-X)^2), (f) sum(((U%*%t(V))-X)^2))
+  - sequential / multi-threaded (same block ops, par over rows in W/X)                 
+  - all dense, sparse-dense factors, sparse/dense-* x 3 patterns      
+  - special patterns for (a) and (d) if W is X!=0      
+
+* 6) wsigmoid ((a) W*sigmoid(Y%*%t(X))), (b) W*sigmoid(-(Y%*%t(X))), 
+               (c) W*log(sigmoid(Y%*%t(X))), (d) W*log(sigmoid(-(Y%*%t(X))))) 
+  - sequential / multi-threaded (same block ops, par over rows in W)                 
+  - all dense, sparse-dense factors, sparse/dense-* x 4 patterns                   
+
+* 7) wdivmm   ((a) t(t(U)%*%(W/(U%*%t(V)))), (b) (W/(U%*%t(V)))%*%V,
+               (c) t(t(U)%*%(W*(U%*%t(V)))), (d) (W*(U%*%t(V)))%*%V, 
+               (e) W*(U%*%t(V)), (f) t(t(U)%*%((X!=0)*(U%*%t(V)-X))),
+               (g) ((X!=0)*(U%*%t(V)-X)%*%V)
+  - sequential / multi-threaded (same block ops, par over rows in X)                 
+  - all dense, sparse-dense factors, sparse/dense-* x 7 patterns
+
+* 8) wcemm    (sum(X*log(U%*%t(V))))  
+  - sequential / multi-threaded (same block ops, par over rows in X)                 
+  - all dense, sparse-dense factors, sparse/dense-*, 1 pattern
+
+* 9) wumm     ((a) X*uop(U%*%t(V)), (b) X/uop(U%*%t(V)))
+  - any unary operator, e.g., X*exp(U%*%t(V)) or X*(U%*%t(V))^2  
+  - sequential / multi-threaded (same block ops, par over rows in X)                 
+  - all dense, sparse-dense factors, sparse/dense-*, 2 pattern

http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/816e2db8/scripts/algorithms/ALS-DS.dml
----------------------------------------------------------------------
diff --git a/scripts/algorithms/ALS-DS.dml b/scripts/algorithms/ALS-DS.dml
index 1d0fce4..537c8ae 100644
--- a/scripts/algorithms/ALS-DS.dml
+++ b/scripts/algorithms/ALS-DS.dml
@@ -1,170 +1,170 @@
-#-------------------------------------------------------------
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-#   http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#-------------------------------------------------------------
-
-#  
-# THIS SCRIPT COMPUTES AN APPROXIMATE FACTORIZATIONOF A LOW-RANK MATRIX V INTO TWO MATRICES L AND R 
-# USING ALTERNATING-LEAST-SQUARES (ALS) ALGORITHM 
-# MATRICES L AND R ARE COMPUTED BY MINIMIZING A LOSS FUNCTION (WITH REGULARIZATION)
-#
-# INPUT   PARAMETERS:
-# ---------------------------------------------------------------------------------------------
-# NAME    TYPE     DEFAULT  MEANING
-# ---------------------------------------------------------------------------------------------
-# V       String   ---      Location to read the input matrix V to be factorized
-# L       String   ---      Location to write the factor matrix L
-# R       String   ---      Location to write the factor matrix R
-# rank    Int      10       Rank of the factorization
-# reg     String   "L2"	    Regularization: 
-#						    "L2" = L2 regularization;
-#                           "wL2" = weighted L2 regularization
-# lambda  Double   0.0      Regularization parameter, no regularization if 0.0
-# maxi    Int      50       Maximum number of iterations
-# check   Boolean  FALSE    Check for convergence after every iteration, i.e., updating L and R once
-# thr     Double   0.0001   Assuming check is set to TRUE, the algorithm stops and convergence is declared 
-# 							if the decrease in loss in any two consecutive iterations falls below this threshold; 
-#							if check is FALSE thr is ignored
-# fmt     String   "text"   The output format of the factor matrices L and R, such as "text" or "csv"
-# ---------------------------------------------------------------------------------------------
-# OUTPUT: 
-# 1- An m x r matrix L, where r is the factorization rank 
-# 2- An r x n matrix R
-#
-# HOW TO INVOKE THIS SCRIPT - EXAMPLE:
-# hadoop jar SystemML.jar -f ALS.dml -nvargs V=INPUT_DIR/V L=OUTPUT_DIR/L R=OUTPUT_DIR/R rank=10 reg="L2" lambda=0.0001 fmt=csv
-
-fileV      = $V;
-fileL	   = $L;
-fileR      = $R;
-
-# Default values of some parameters
-r          = ifdef ($rank, 10);	        # $rank=10;
-reg	   	   = ifdef ($reg, "L2")         # $reg="L2";
-lambda	   = ifdef ($lambda, 0.000001); # $lambda=0.000001;
-max_iter   = ifdef ($maxi, 50);         # $maxi=50;
-check      = ifdef ($check, FALSE);	    # $check=FALSE;
-thr        = ifdef ($thr, 0.0001);      # $thr=0.0001;
-fmtO       = ifdef ($fmt, "text");      # $fmt="text";
-
-V = read (fileV);
-
-
-# check the input matrix V, if some rows or columns contain only zeros remove them from V  
-V_nonzero_ind = ppred (V, 0, "!=");
-row_nonzeros = rowSums (V_nonzero_ind);
-col_nonzeros = t (colSums (V_nonzero_ind));
-orig_nonzero_rows_ind = ppred (row_nonzeros, 0, "!=");
-orig_nonzero_cols_ind = ppred (col_nonzeros, 0, "!=");
-num_zero_rows = nrow (V) - sum (orig_nonzero_rows_ind);
-num_zero_cols = ncol (V) - sum (orig_nonzero_cols_ind);
-if (num_zero_rows > 0) {
-	print ("Matrix V contains empty rows! These rows will be removed.");
-	V = removeEmpty (target = V, margin = "rows");
-}
-if (num_zero_cols > 0) {
-	print ("Matrix V contains empty columns! These columns will be removed.");
-	V = removeEmpty (target = V, margin = "cols");
-}
-if (num_zero_rows > 0 | num_zero_cols > 0) {
-	print ("Recomputing nonzero rows and columns!");
-	V_nonzero_ind = ppred (V, 0, "!=");
-	row_nonzeros = rowSums (V_nonzero_ind);
-	col_nonzeros = t (colSums (V_nonzero_ind));	
-}
-
-###### MAIN PART ######
-m = nrow (V);
-n = ncol (V);
-
-# initializing factor matrices
-L = rand (rows = m, cols = r, min = -0.5, max = 0.5);
-R = rand (rows = n, cols = r, min = -0.5, max = 0.5);
-
-# initializing transformed matrices
-Vt = t(V);
-  
-# check for regularization
-if (reg == "L2") {
-	print ("BEGIN ALS SCRIPT WITH NONZERO SQUARED LOSS + L2 WITH LAMBDA - " + lambda);
-} else if (reg == "wL2") {
-	print ("BEGIN ALS SCRIPT WITH NONZERO SQUARED LOSS + WEIGHTED L2 WITH LAMBDA - " + lambda);
-} else {
-	stop ("wrong regularization! " + reg);
-}
-
-if (check) {
-	loss_init = sum (V_nonzero_ind * (V - (L %*% t(R)))^2) + lambda * (sum ((L^2) * row_nonzeros) + sum ((R^2) * col_nonzeros));
-	print ("-----   Initial train loss: " + loss_init + " -----");
-}
-
-lambda_I = diag (matrix (lambda, rows = r, cols = 1));
-it = 0;
-converged = FALSE;
-while ((it < max_iter) & (!converged)) {
-	it = it + 1;
-	# keep R fixed and update L
-	parfor (i in 1:m) {
-    	R_nonzero_ind = t(ppred(V[i,],0,"!="));
-		R_nonzero = removeEmpty (target=R * R_nonzero_ind, margin="rows");			
-		A1 = (t(R_nonzero) %*% R_nonzero) + (as.scalar(row_nonzeros[i,1]) * lambda_I); # coefficient matrix
-		L[i,] = t(solve (A1, t(V[i,] %*% R)));		
-	}
-  
-	# keep L fixed and update R
-	parfor (j in 1:n) {
-		L_nonzero_ind = t(ppred(Vt[j,],0,"!="))
-		L_nonzero = removeEmpty (target=L * L_nonzero_ind, margin="rows");
-		A2 = (t(L_nonzero) %*% L_nonzero) + (as.scalar(col_nonzeros[j,1]) * lambda_I); # coefficient matrix
-		R[j,] = t(solve (A2, t(Vt[j,] %*% L)));    
-	}
-	
-	# check for convergence
-	if (check) {
-		loss_cur = sum (V_nonzero_ind * (V - (L %*% t(R)))^2) + lambda * (sum ((L^2) * row_nonzeros) + sum ((R^2) * col_nonzeros));
-		loss_dec = (loss_init - loss_cur) / loss_init;
-		print ("Train loss at iteration (R) " + it + ": " + loss_cur + " loss-dec " + loss_dec);
-		if (loss_dec >= 0 & loss_dec < thr | loss_init == 0) {
-			print ("----- ALS converged after " + it + " iterations!");
-			converged = TRUE;
-		}
-		loss_init = loss_cur;
-	}
-} # end of while loop
-
-if (check) {
-	print ("-----	Final train loss: " + loss_init + " -----");
-}
-
-if (!converged) {
-   print ("Max iteration achieved but not converged!");
-} 
-
-# inject 0s in L if original V had empty rows
-if (num_zero_rows > 0) {
-	L = removeEmpty (target = diag (orig_nonzero_rows_ind), margin = "cols") %*% L;
-}
-# inject 0s in R if original V had empty rows
-if (num_zero_cols > 0) {
-	R = removeEmpty (target = diag (orig_nonzero_cols_ind), margin = "cols") %*% R; 
-}
-Rt = t (R);
-write (L, fileL, format=fmtO);
-write (Rt, fileR, format=fmtO);
+#-------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+#-------------------------------------------------------------
+
+#  
+# THIS SCRIPT COMPUTES AN APPROXIMATE FACTORIZATIONOF A LOW-RANK MATRIX V INTO TWO MATRICES L AND R 
+# USING ALTERNATING-LEAST-SQUARES (ALS) ALGORITHM 
+# MATRICES L AND R ARE COMPUTED BY MINIMIZING A LOSS FUNCTION (WITH REGULARIZATION)
+#
+# INPUT   PARAMETERS:
+# ---------------------------------------------------------------------------------------------
+# NAME    TYPE     DEFAULT  MEANING
+# ---------------------------------------------------------------------------------------------
+# V       String   ---      Location to read the input matrix V to be factorized
+# L       String   ---      Location to write the factor matrix L
+# R       String   ---      Location to write the factor matrix R
+# rank    Int      10       Rank of the factorization
+# reg     String   "L2"	    Regularization: 
+#						    "L2" = L2 regularization;
+#                           "wL2" = weighted L2 regularization
+# lambda  Double   0.0      Regularization parameter, no regularization if 0.0
+# maxi    Int      50       Maximum number of iterations
+# check   Boolean  FALSE    Check for convergence after every iteration, i.e., updating L and R once
+# thr     Double   0.0001   Assuming check is set to TRUE, the algorithm stops and convergence is declared 
+# 							if the decrease in loss in any two consecutive iterations falls below this threshold; 
+#							if check is FALSE thr is ignored
+# fmt     String   "text"   The output format of the factor matrices L and R, such as "text" or "csv"
+# ---------------------------------------------------------------------------------------------
+# OUTPUT: 
+# 1- An m x r matrix L, where r is the factorization rank 
+# 2- An r x n matrix R
+#
+# HOW TO INVOKE THIS SCRIPT - EXAMPLE:
+# hadoop jar SystemML.jar -f ALS.dml -nvargs V=INPUT_DIR/V L=OUTPUT_DIR/L R=OUTPUT_DIR/R rank=10 reg="L2" lambda=0.0001 fmt=csv
+
+fileV      = $V;
+fileL	   = $L;
+fileR      = $R;
+
+# Default values of some parameters
+r          = ifdef ($rank, 10);	        # $rank=10;
+reg	   	   = ifdef ($reg, "L2")         # $reg="L2";
+lambda	   = ifdef ($lambda, 0.000001); # $lambda=0.000001;
+max_iter   = ifdef ($maxi, 50);         # $maxi=50;
+check      = ifdef ($check, FALSE);	    # $check=FALSE;
+thr        = ifdef ($thr, 0.0001);      # $thr=0.0001;
+fmtO       = ifdef ($fmt, "text");      # $fmt="text";
+
+V = read (fileV);
+
+
+# check the input matrix V, if some rows or columns contain only zeros remove them from V  
+V_nonzero_ind = ppred (V, 0, "!=");
+row_nonzeros = rowSums (V_nonzero_ind);
+col_nonzeros = t (colSums (V_nonzero_ind));
+orig_nonzero_rows_ind = ppred (row_nonzeros, 0, "!=");
+orig_nonzero_cols_ind = ppred (col_nonzeros, 0, "!=");
+num_zero_rows = nrow (V) - sum (orig_nonzero_rows_ind);
+num_zero_cols = ncol (V) - sum (orig_nonzero_cols_ind);
+if (num_zero_rows > 0) {
+	print ("Matrix V contains empty rows! These rows will be removed.");
+	V = removeEmpty (target = V, margin = "rows");
+}
+if (num_zero_cols > 0) {
+	print ("Matrix V contains empty columns! These columns will be removed.");
+	V = removeEmpty (target = V, margin = "cols");
+}
+if (num_zero_rows > 0 | num_zero_cols > 0) {
+	print ("Recomputing nonzero rows and columns!");
+	V_nonzero_ind = ppred (V, 0, "!=");
+	row_nonzeros = rowSums (V_nonzero_ind);
+	col_nonzeros = t (colSums (V_nonzero_ind));	
+}
+
+###### MAIN PART ######
+m = nrow (V);
+n = ncol (V);
+
+# initializing factor matrices
+L = rand (rows = m, cols = r, min = -0.5, max = 0.5);
+R = rand (rows = n, cols = r, min = -0.5, max = 0.5);
+
+# initializing transformed matrices
+Vt = t(V);
+  
+# check for regularization
+if (reg == "L2") {
+	print ("BEGIN ALS SCRIPT WITH NONZERO SQUARED LOSS + L2 WITH LAMBDA - " + lambda);
+} else if (reg == "wL2") {
+	print ("BEGIN ALS SCRIPT WITH NONZERO SQUARED LOSS + WEIGHTED L2 WITH LAMBDA - " + lambda);
+} else {
+	stop ("wrong regularization! " + reg);
+}
+
+if (check) {
+	loss_init = sum (V_nonzero_ind * (V - (L %*% t(R)))^2) + lambda * (sum ((L^2) * row_nonzeros) + sum ((R^2) * col_nonzeros));
+	print ("-----   Initial train loss: " + loss_init + " -----");
+}
+
+lambda_I = diag (matrix (lambda, rows = r, cols = 1));
+it = 0;
+converged = FALSE;
+while ((it < max_iter) & (!converged)) {
+	it = it + 1;
+	# keep R fixed and update L
+	parfor (i in 1:m) {
+    	R_nonzero_ind = t(ppred(V[i,],0,"!="));
+		R_nonzero = removeEmpty (target=R * R_nonzero_ind, margin="rows");			
+		A1 = (t(R_nonzero) %*% R_nonzero) + (as.scalar(row_nonzeros[i,1]) * lambda_I); # coefficient matrix
+		L[i,] = t(solve (A1, t(V[i,] %*% R)));		
+	}
+  
+	# keep L fixed and update R
+	parfor (j in 1:n) {
+		L_nonzero_ind = t(ppred(Vt[j,],0,"!="))
+		L_nonzero = removeEmpty (target=L * L_nonzero_ind, margin="rows");
+		A2 = (t(L_nonzero) %*% L_nonzero) + (as.scalar(col_nonzeros[j,1]) * lambda_I); # coefficient matrix
+		R[j,] = t(solve (A2, t(Vt[j,] %*% L)));    
+	}
+	
+	# check for convergence
+	if (check) {
+		loss_cur = sum (V_nonzero_ind * (V - (L %*% t(R)))^2) + lambda * (sum ((L^2) * row_nonzeros) + sum ((R^2) * col_nonzeros));
+		loss_dec = (loss_init - loss_cur) / loss_init;
+		print ("Train loss at iteration (R) " + it + ": " + loss_cur + " loss-dec " + loss_dec);
+		if (loss_dec >= 0 & loss_dec < thr | loss_init == 0) {
+			print ("----- ALS converged after " + it + " iterations!");
+			converged = TRUE;
+		}
+		loss_init = loss_cur;
+	}
+} # end of while loop
+
+if (check) {
+	print ("-----	Final train loss: " + loss_init + " -----");
+}
+
+if (!converged) {
+   print ("Max iteration achieved but not converged!");
+} 
+
+# inject 0s in L if original V had empty rows
+if (num_zero_rows > 0) {
+	L = removeEmpty (target = diag (orig_nonzero_rows_ind), margin = "cols") %*% L;
+}
+# inject 0s in R if original V had empty rows
+if (num_zero_cols > 0) {
+	R = removeEmpty (target = diag (orig_nonzero_cols_ind), margin = "cols") %*% R; 
+}
+Rt = t (R);
+write (L, fileL, format=fmtO);
+write (Rt, fileR, format=fmtO);
  
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/816e2db8/scripts/algorithms/ALS_topk_predict.dml
----------------------------------------------------------------------
diff --git a/scripts/algorithms/ALS_topk_predict.dml b/scripts/algorithms/ALS_topk_predict.dml
index 9d3d2ae..9b7e476 100644
--- a/scripts/algorithms/ALS_topk_predict.dml
+++ b/scripts/algorithms/ALS_topk_predict.dml
@@ -1,126 +1,126 @@
-#-------------------------------------------------------------
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-#   http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#-------------------------------------------------------------
-
-#  
-# THIS SCRIPT COMPUTES THE RATING/SCORE FOR A GIVEN LIST OF PAIRS: (USER-ID, ITEM-ID) USING 2 FACTOR MATRICES L AND R
-# WE ASSUME THAT ALL USERS HAVE RATED AT LEAST ONCE AND ALL ITEMS HAVE BEEN RATED AT LEAST ONCE.
-# INPUT   PARAMETERS:
-# ---------------------------------------------------------------------------------------------
-# NAME    TYPE     DEFAULT  MEANING
-# ---------------------------------------------------------------------------------------------
-# X       String   ---      Location to read the input user-ids list
-# Y	 	  String   ---	    Location to write the output of top-K prediction: 
-#							 - top-K item-ids will be stored at Y
-#							 - the corresponding top-K ratings will be stored at Y+".ratings" 
-# L       String   ---      Location of factor matrix L: user-id x feature-id 
-# R       String   ---      Location of factor matrix R: feature-id x item-id
-# V	  	  String   ---      Location of original matrix V: user-id x item-id
-# K	  	  Int      5	    The number of top-K items	
-# fmt     String   "text"   The output format of the factor matrix user-id/item-id/score
-# ---------------------------------------------------------------------------------------------
-# OUTPUT: 
-# 1- A matrix containing the top-K item-ids with highest predicted ratings for the users specified in the input matrix X  
-# 2- A matrix containing the top-K predicted ratings for the users specified in the input matrix X  
-#
-# HOW TO INVOKE THIS SCRIPT - EXAMPLE:
-# hadoop jar system-ml.jar -f ALS-topk-predict.dml -nvargs X=INPUT_DIR/X L=INPUT_DIR/L R=INPUT_DIR/R V=INTPUT_DIR/V.mtx 
-#													Y=OUTPUT_DIR/Y K=5 fmt=csv
-
-fileX      = $X;
-fileY 	   = $Y;
-fileL	   = $L;
-fileR      = $R;
-fileV	   = $V;
-K	  	   = ifdef ($K, 5);
-fmtO       = ifdef ($fmt, "text");    # $fmt="text";
-
-X = read (fileX);
-L = read (fileL);
-R = read (fileR);
-V = read (fileV);
-
-Vrows = nrow(V);
-Vcols = ncol(V);
-
-zero_cols_ind = ppred (colSums (ppred (R, 0, "!=")), 0, "==");
-K = min (Vcols - sum (zero_cols_ind), K);
-
-n = nrow(X);
-
-Lrows = nrow(L);
-Rcols = ncol(R);
-
-X_user_max = max(X[,1]);
-
-if (X_user_max > Vrows) {
-	stop ("Predictions cannot be provided. Maximum user-id exceeds the number of rows of V.");
-}
-if (Lrows != Vrows | Rcols !=  Vcols) {
-	stop ("Predictions cannot be provided. Number of rows of L (columns of R) does not match the number of rows (column) of V.");
-}
-
-
-# creats projection matrix to select users
-s = seq(1, n);
-ones = matrix (1, rows = n, cols = 1);
-projection_matrix = table(s, X[,1], ones, n, Lrows);
-
-# selects users from factor L
-U_prime = projection_matrix %*% L;
-
-# calculates V_filter for selected users
-V_filter = U_prime %*% R;
-
-# selects users from original V
-V_prime = projection_matrix %*% V;
-
-# filter for already recommended items
-V_prime = ppred(V_prime, 0, '==');
-
-# removes already recommended items and creating user2item matrix
-V_filter = V_prime * V_filter; 
-
-
-# stores sorted movies for selected users 
-V_top_indices = matrix(0, rows = nrow (V_filter), cols = K);
-V_top_values = matrix(0, rows = nrow (V_filter), cols = K);
-
-# a large number to mask the max ratings
-range = max (V_filter) - min (V_filter) + 1;
-
-# uses rowIndexMax/rowMaxs to update kth ratings
-for (i in 1:K){
-	rowIndexMax = rowIndexMax (V_filter);
-	rowMaxs = rowMaxs (V_filter);
-	V_top_indices[,i] = rowIndexMax;
-	V_top_values[,i] = rowMaxs;
-	V_filter = V_filter - range * table (seq (1, nrow (V_filter), 1), rowIndexMax, nrow(V_filter), ncol(V_filter));
-}
-
-V_top_indices = V_top_indices * ppred (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);
-
-# writing top K elements
-write (V_top_indices, fileY, format = fmtO);
-write(V_top_values, fileY+".ratings", format = fmtO);
+#-------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+#-------------------------------------------------------------
+
+#  
+# THIS SCRIPT COMPUTES THE RATING/SCORE FOR A GIVEN LIST OF PAIRS: (USER-ID, ITEM-ID) USING 2 FACTOR MATRICES L AND R
+# WE ASSUME THAT ALL USERS HAVE RATED AT LEAST ONCE AND ALL ITEMS HAVE BEEN RATED AT LEAST ONCE.
+# INPUT   PARAMETERS:
+# ---------------------------------------------------------------------------------------------
+# NAME    TYPE     DEFAULT  MEANING
+# ---------------------------------------------------------------------------------------------
+# X       String   ---      Location to read the input user-ids list
+# Y	 	  String   ---	    Location to write the output of top-K prediction: 
+#							 - top-K item-ids will be stored at Y
+#							 - the corresponding top-K ratings will be stored at Y+".ratings" 
+# L       String   ---      Location of factor matrix L: user-id x feature-id 
+# R       String   ---      Location of factor matrix R: feature-id x item-id
+# V	  	  String   ---      Location of original matrix V: user-id x item-id
+# K	  	  Int      5	    The number of top-K items	
+# fmt     String   "text"   The output format of the factor matrix user-id/item-id/score
+# ---------------------------------------------------------------------------------------------
+# OUTPUT: 
+# 1- A matrix containing the top-K item-ids with highest predicted ratings for the users specified in the input matrix X  
+# 2- A matrix containing the top-K predicted ratings for the users specified in the input matrix X  
+#
+# HOW TO INVOKE THIS SCRIPT - EXAMPLE:
+# hadoop jar system-ml.jar -f ALS-topk-predict.dml -nvargs X=INPUT_DIR/X L=INPUT_DIR/L R=INPUT_DIR/R V=INTPUT_DIR/V.mtx 
+#													Y=OUTPUT_DIR/Y K=5 fmt=csv
+
+fileX      = $X;
+fileY 	   = $Y;
+fileL	   = $L;
+fileR      = $R;
+fileV	   = $V;
+K	  	   = ifdef ($K, 5);
+fmtO       = ifdef ($fmt, "text");    # $fmt="text";
+
+X = read (fileX);
+L = read (fileL);
+R = read (fileR);
+V = read (fileV);
+
+Vrows = nrow(V);
+Vcols = ncol(V);
+
+zero_cols_ind = ppred (colSums (ppred (R, 0, "!=")), 0, "==");
+K = min (Vcols - sum (zero_cols_ind), K);
+
+n = nrow(X);
+
+Lrows = nrow(L);
+Rcols = ncol(R);
+
+X_user_max = max(X[,1]);
+
+if (X_user_max > Vrows) {
+	stop ("Predictions cannot be provided. Maximum user-id exceeds the number of rows of V.");
+}
+if (Lrows != Vrows | Rcols !=  Vcols) {
+	stop ("Predictions cannot be provided. Number of rows of L (columns of R) does not match the number of rows (column) of V.");
+}
+
+
+# creats projection matrix to select users
+s = seq(1, n);
+ones = matrix (1, rows = n, cols = 1);
+projection_matrix = table(s, X[,1], ones, n, Lrows);
+
+# selects users from factor L
+U_prime = projection_matrix %*% L;
+
+# calculates V_filter for selected users
+V_filter = U_prime %*% R;
+
+# selects users from original V
+V_prime = projection_matrix %*% V;
+
+# filter for already recommended items
+V_prime = ppred(V_prime, 0, '==');
+
+# removes already recommended items and creating user2item matrix
+V_filter = V_prime * V_filter; 
+
+
+# stores sorted movies for selected users 
+V_top_indices = matrix(0, rows = nrow (V_filter), cols = K);
+V_top_values = matrix(0, rows = nrow (V_filter), cols = K);
+
+# a large number to mask the max ratings
+range = max (V_filter) - min (V_filter) + 1;
+
+# uses rowIndexMax/rowMaxs to update kth ratings
+for (i in 1:K){
+	rowIndexMax = rowIndexMax (V_filter);
+	rowMaxs = rowMaxs (V_filter);
+	V_top_indices[,i] = rowIndexMax;
+	V_top_values[,i] = rowMaxs;
+	V_filter = V_filter - range * table (seq (1, nrow (V_filter), 1), rowIndexMax, nrow(V_filter), ncol(V_filter));
+}
+
+V_top_indices = V_top_indices * ppred (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);
+
+# writing top K elements
+write (V_top_indices, fileY, format = fmtO);
+write(V_top_values, fileY+".ratings", format = fmtO);