[SYSTEMML-1873] Update instruction constructor scopes to reflect use Instructions are usually created using static parseInstruction methods. Therefore, change constructor scopes to either private or protected where appropriate to reflect this actual usage.
Closes #644. Project: http://git-wip-us.apache.org/repos/asf/systemml/repo Commit: http://git-wip-us.apache.org/repos/asf/systemml/commit/55b73422 Tree: http://git-wip-us.apache.org/repos/asf/systemml/tree/55b73422 Diff: http://git-wip-us.apache.org/repos/asf/systemml/diff/55b73422 Branch: refs/heads/master Commit: 55b7342276868a2bf32643e44521e0fa21eefbc6 Parents: 62a0246 Author: Deron Eriksson <[email protected]> Authored: Thu Aug 31 18:06:38 2017 -0700 Committer: Deron Eriksson <[email protected]> Committed: Thu Aug 31 18:06:38 2017 -0700 ---------------------------------------------------------------------- .../cp/AggregateBinaryCPInstruction.java | 8 +- .../cp/AggregateTernaryCPInstruction.java | 9 +- .../cp/AggregateUnaryCPInstruction.java | 16 +-- .../instructions/cp/AppendCPInstruction.java | 8 +- .../cp/ArithmeticBinaryCPInstruction.java | 9 +- .../instructions/cp/BinaryCPInstruction.java | 12 +- .../cp/BooleanBinaryCPInstruction.java | 10 +- .../cp/BooleanUnaryCPInstruction.java | 7 +- .../cp/BuiltinBinaryCPInstruction.java | 9 +- .../cp/BuiltinMultipleCPInstruction.java | 3 +- .../cp/BuiltinUnaryCPInstruction.java | 10 +- .../runtime/instructions/cp/CPInstruction.java | 14 +- .../runtime/instructions/cp/CPOperand.java | 6 +- .../cp/CentralMomentCPInstruction.java | 9 +- .../cp/CompressionCPInstruction.java | 9 +- .../cp/ComputationCPInstruction.java | 12 +- .../cp/ConvolutionCPInstruction.java | 49 ++++--- .../cp/CovarianceCPInstruction.java | 16 +-- .../instructions/cp/DataGenCPInstruction.java | 51 ++++---- .../cp/DataPartitionCPInstruction.java | 11 +- .../cp/FrameAppendCPInstruction.java | 7 +- .../cp/FrameIndexingCPInstruction.java | 14 +- .../cp/FunctionCallCPInstruction.java | 20 +-- .../instructions/cp/IndexingCPInstruction.java | 13 +- .../instructions/cp/MMChainCPInstruction.java | 11 +- .../instructions/cp/MMTSJCPInstruction.java | 10 +- .../cp/MatrixAppendCPInstruction.java | 7 +- .../cp/MatrixBuiltinCPInstruction.java | 6 +- .../cp/MatrixIndexingCPInstruction.java | 14 +- .../cp/MatrixMatrixArithmeticCPInstruction.java | 14 +- .../cp/MatrixMatrixBuiltinCPInstruction.java | 14 +- .../cp/MatrixMatrixRelationalCPInstruction.java | 12 +- .../cp/MatrixReshapeCPInstruction.java | 13 +- .../cp/MatrixScalarBuiltinCPInstruction.java | 14 +- .../cp/MultiReturnBuiltinCPInstruction.java | 10 +- ...ReturnParameterizedBuiltinCPInstruction.java | 11 +- .../instructions/cp/PMMJCPInstruction.java | 11 +- .../cp/ParameterizedBuiltinCPInstruction.java | 14 +- .../instructions/cp/PlusMultCPInstruction.java | 12 +- .../cp/QuantilePickCPInstruction.java | 16 +-- .../cp/QuantileSortCPInstruction.java | 31 +++-- .../cp/QuaternaryCPInstruction.java | 16 +-- .../cp/RelationalBinaryCPInstruction.java | 8 +- .../instructions/cp/ReorgCPInstruction.java | 68 ++++++---- .../cp/ScalarAppendCPInstruction.java | 9 +- .../cp/ScalarBuiltinCPInstruction.java | 9 +- .../cp/ScalarBuiltinMultipleCPInstruction.java | 2 +- .../cp/ScalarMatrixArithmeticCPInstruction.java | 15 +-- .../cp/ScalarMatrixRelationalCPInstruction.java | 13 +- .../cp/ScalarScalarArithmeticCPInstruction.java | 8 +- .../cp/ScalarScalarBuiltinCPInstruction.java | 6 +- .../cp/ScalarScalarRelationalCPInstruction.java | 9 +- .../instructions/cp/SpoofCPInstruction.java | 10 +- .../cp/StringInitCPInstruction.java | 13 +- .../instructions/cp/TernaryCPInstruction.java | 16 +-- .../cp/UaggOuterChainCPInstruction.java | 13 +- .../instructions/cp/UnaryCPInstruction.java | 21 ++- .../instructions/cp/VariableCPInstruction.java | 33 +++-- .../cpfile/MatrixIndexingCPFileInstruction.java | 9 +- .../ParameterizedBuiltinCPFileInstruction.java | 9 +- .../gpu/AggregateBinaryGPUInstruction.java | 10 +- .../gpu/AggregateUnaryGPUInstruction.java | 20 ++- .../gpu/ArithmeticBinaryGPUInstruction.java | 8 +- .../gpu/BuiltinBinaryGPUInstruction.java | 29 ++--- .../gpu/BuiltinUnaryGPUInstruction.java | 10 +- .../gpu/ConvolutionGPUInstruction.java | 48 ++++--- .../instructions/gpu/GPUInstruction.java | 10 +- .../instructions/gpu/MMTSJGPUInstruction.java | 52 ++++---- .../gpu/MatrixAppendGPUInstruction.java | 3 +- .../gpu/MatrixBuiltinGPUInstruction.java | 4 +- .../gpu/MatrixIndexingGPUInstruction.java | 18 +-- .../MatrixMatrixArithmeticGPUInstruction.java | 15 +-- .../gpu/MatrixMatrixAxpyGPUInstruction.java | 17 +-- .../gpu/MatrixMatrixBuiltinGPUInstruction.java | 11 +- ...rixMatrixRelationalBinaryGPUInstruction.java | 2 +- .../gpu/RelationalBinaryGPUInstruction.java | 3 +- .../instructions/gpu/ReorgGPUInstruction.java | 36 +++--- .../ScalarMatrixArithmeticGPUInstruction.java | 11 +- ...larMatrixRelationalBinaryGPUInstruction.java | 2 +- .../mr/AggregateBinaryInstruction.java | 19 ++- .../instructions/mr/AggregateInstruction.java | 9 +- .../mr/AggregateUnaryInstruction.java | 12 +- .../instructions/mr/AppendGInstruction.java | 14 +- .../instructions/mr/AppendInstruction.java | 9 +- .../instructions/mr/AppendMInstruction.java | 12 +- .../instructions/mr/AppendRInstruction.java | 6 +- .../mr/BinUaggChainInstruction.java | 20 ++- .../instructions/mr/BinaryInstruction.java | 9 +- .../instructions/mr/BinaryMInstruction.java | 12 +- .../mr/BinaryMRInstructionBase.java | 15 +-- .../instructions/mr/CM_N_COVInstruction.java | 9 +- .../instructions/mr/CSVReblockInstruction.java | 22 ++-- .../instructions/mr/CSVWriteInstruction.java | 10 +- .../mr/CombineBinaryInstruction.java | 12 +- .../mr/CombineTernaryInstruction.java | 7 +- .../mr/CombineUnaryInstruction.java | 6 +- .../mr/CumulativeAggregateInstruction.java | 12 +- .../mr/CumulativeOffsetInstruction.java | 29 ++--- .../mr/CumulativeSplitInstruction.java | 9 +- .../instructions/mr/DataGenMRInstruction.java | 14 +- .../mr/DataPartitionMRInstruction.java | 10 +- .../mr/GroupedAggregateInstruction.java | 10 +- .../mr/GroupedAggregateMInstruction.java | 9 +- .../instructions/mr/MMTSJMRInstruction.java | 9 +- .../runtime/instructions/mr/MRInstruction.java | 23 ++-- .../mr/MapMultChainInstruction.java | 29 ++--- .../mr/MatrixReshapeMRInstruction.java | 16 +-- .../instructions/mr/PMMJMRInstruction.java | 19 ++- .../mr/ParameterizedBuiltinMRInstruction.java | 23 ++-- .../instructions/mr/PickByCountInstruction.java | 30 ++--- .../instructions/mr/PlusMultInstruction.java | 6 +- .../instructions/mr/QuaternaryInstruction.java | 17 ++- .../instructions/mr/RandInstruction.java | 17 ++- .../mr/RangeBasedReIndexInstruction.java | 11 +- .../instructions/mr/ReblockInstruction.java | 15 +-- .../mr/RemoveEmptyMRInstruction.java | 17 +-- .../instructions/mr/ReorgInstruction.java | 15 +-- .../instructions/mr/ReplicateInstruction.java | 13 +- .../instructions/mr/ScalarInstruction.java | 11 +- .../runtime/instructions/mr/SeqInstruction.java | 13 +- .../instructions/mr/TernaryInstruction.java | 129 ++++++++++++------- .../mr/UaggOuterChainInstruction.java | 21 ++- .../instructions/mr/UnaryInstruction.java | 9 +- .../instructions/mr/UnaryMRInstructionBase.java | 13 +- .../instructions/mr/ZeroOutInstruction.java | 18 ++- .../spark/AggregateTernarySPInstruction.java | 9 +- .../spark/AggregateUnarySPInstruction.java | 9 +- .../spark/AppendGAlignedSPInstruction.java | 11 +- .../spark/AppendGSPInstruction.java | 11 +- .../spark/AppendMSPInstruction.java | 11 +- .../spark/AppendRSPInstruction.java | 10 +- .../spark/ArithmeticBinarySPInstruction.java | 9 +- .../spark/BinUaggChainSPInstruction.java | 14 +- .../instructions/spark/BinarySPInstruction.java | 8 +- .../spark/BuiltinBinarySPInstruction.java | 9 +- .../spark/BuiltinUnarySPInstruction.java | 7 +- .../spark/CSVReblockSPInstruction.java | 9 +- .../instructions/spark/CastSPInstruction.java | 7 +- .../spark/CentralMomentSPInstruction.java | 10 +- .../spark/CheckpointSPInstruction.java | 14 +- .../spark/CompressionSPInstruction.java | 5 +- .../spark/ComputationSPInstruction.java | 10 +- .../spark/ConvolutionSPInstruction.java | 34 ++--- .../spark/CovarianceSPInstruction.java | 17 +-- .../instructions/spark/CpmmSPInstruction.java | 10 +- .../spark/CumulativeAggregateSPInstruction.java | 11 +- .../spark/CumulativeOffsetSPInstruction.java | 32 ++--- .../spark/FrameAppendMSPInstruction.java | 10 +- .../spark/FrameAppendRSPInstruction.java | 10 +- .../spark/FrameIndexingSPInstruction.java | 46 +++---- .../spark/IndexingSPInstruction.java | 46 +++---- .../spark/MapmmChainSPInstruction.java | 32 ++--- .../instructions/spark/MapmmSPInstruction.java | 12 +- .../spark/MatrixAppendMSPInstruction.java | 10 +- .../spark/MatrixAppendRSPInstruction.java | 10 +- .../MatrixBVectorArithmeticSPInstruction.java | 25 ++-- .../MatrixBVectorBuiltinSPInstruction.java | 18 +-- .../MatrixBVectorRelationalSPInstruction.java | 21 ++- .../spark/MatrixBuiltinSPInstruction.java | 7 +- .../spark/MatrixIndexingSPInstruction.java | 17 +-- .../MatrixMatrixArithmeticSPInstruction.java | 25 ++-- .../spark/MatrixMatrixBuiltinSPInstruction.java | 11 +- .../MatrixMatrixRelationalSPInstruction.java | 24 ++-- .../spark/MatrixReshapeSPInstruction.java | 13 +- .../MatrixScalarArithmeticSPInstruction.java | 10 +- .../spark/MatrixScalarBuiltinSPInstruction.java | 11 +- .../MatrixScalarRelationalSPInstruction.java | 9 +- ...ReturnParameterizedBuiltinSPInstruction.java | 9 +- .../instructions/spark/PMapmmSPInstruction.java | 11 +- .../ParameterizedBuiltinSPInstruction.java | 15 +-- .../spark/PlusMultSPInstruction.java | 21 ++- .../instructions/spark/PmmSPInstruction.java | 13 +- .../spark/QuantilePickSPInstruction.java | 17 +-- .../spark/QuantileSortSPInstruction.java | 31 +++-- .../spark/QuaternarySPInstruction.java | 13 +- .../instructions/spark/RandSPInstruction.java | 36 +++--- .../spark/ReblockSPInstruction.java | 18 ++- .../spark/RelationalBinarySPInstruction.java | 8 +- .../instructions/spark/ReorgSPInstruction.java | 25 ++-- .../instructions/spark/RmmSPInstruction.java | 10 +- .../instructions/spark/SPInstruction.java | 22 ++-- .../instructions/spark/SpoofSPInstruction.java | 10 +- .../spark/TernarySPInstruction.java | 15 +-- .../instructions/spark/Tsmm2SPInstruction.java | 10 +- .../instructions/spark/TsmmSPInstruction.java | 11 +- .../spark/UaggOuterChainSPInstruction.java | 13 +- .../instructions/spark/UnarySPInstruction.java | 20 ++- .../instructions/spark/WriteSPInstruction.java | 9 +- .../instructions/spark/ZipmmSPInstruction.java | 14 +- 189 files changed, 1296 insertions(+), 1607 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/AggregateBinaryCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/AggregateBinaryCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/AggregateBinaryCPInstruction.java index 2b09843..100384f 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/AggregateBinaryCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/AggregateBinaryCPInstruction.java @@ -32,10 +32,10 @@ import org.apache.sysml.runtime.matrix.operators.AggregateBinaryOperator; import org.apache.sysml.runtime.matrix.operators.AggregateOperator; import org.apache.sysml.runtime.matrix.operators.Operator; -public class AggregateBinaryCPInstruction extends BinaryCPInstruction -{ - - public AggregateBinaryCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand out, String opcode, String istr ){ +public class AggregateBinaryCPInstruction extends BinaryCPInstruction { + + private AggregateBinaryCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand out, String opcode, + String istr) { super(op, in1, in2, out, opcode, istr); _cptype = CPINSTRUCTION_TYPE.AggregateBinary; } http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/AggregateTernaryCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/AggregateTernaryCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/AggregateTernaryCPInstruction.java index 949462a..a5cd372 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/AggregateTernaryCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/AggregateTernaryCPInstruction.java @@ -26,11 +26,10 @@ import org.apache.sysml.runtime.matrix.data.MatrixBlock; import org.apache.sysml.runtime.matrix.operators.AggregateTernaryOperator; import org.apache.sysml.runtime.matrix.operators.Operator; -public class AggregateTernaryCPInstruction extends ComputationCPInstruction -{ - public AggregateTernaryCPInstruction(Operator op, CPOperand in1, CPOperand in2, - CPOperand in3, CPOperand out, String opcode, String istr ) - { +public class AggregateTernaryCPInstruction extends ComputationCPInstruction { + + private AggregateTernaryCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand in3, CPOperand out, + String opcode, String istr) { super(op, in1, in2, in3, out, opcode, istr); _cptype = CPINSTRUCTION_TYPE.AggregateTernary; } http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/AggregateUnaryCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/AggregateUnaryCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/AggregateUnaryCPInstruction.java index 5edce07..8a26e25 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/AggregateUnaryCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/AggregateUnaryCPInstruction.java @@ -35,18 +35,18 @@ import org.apache.sysml.runtime.matrix.operators.AggregateUnaryOperator; import org.apache.sysml.runtime.matrix.operators.Operator; import org.apache.sysml.runtime.matrix.operators.SimpleOperator; -public class AggregateUnaryCPInstruction extends UnaryCPInstruction -{ - - public AggregateUnaryCPInstruction(Operator op, CPOperand in, CPOperand out, String opcode, String istr){ +public class AggregateUnaryCPInstruction extends UnaryCPInstruction { + + private AggregateUnaryCPInstruction(Operator op, CPOperand in, CPOperand out, String opcode, String istr) { this(op, in, null, null, out, opcode, istr); } - - public AggregateUnaryCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand in3, CPOperand out, String opcode, String istr){ + + protected AggregateUnaryCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand in3, CPOperand out, + String opcode, String istr) { super(op, in1, in2, in3, out, opcode, istr); - _cptype = CPINSTRUCTION_TYPE.AggregateUnary; + _cptype = CPINSTRUCTION_TYPE.AggregateUnary; } - + public static AggregateUnaryCPInstruction parseInstruction(String str) throws DMLRuntimeException { http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/AppendCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/AppendCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/AppendCPInstruction.java index 8dd842f..74b2d6d 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/AppendCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/AppendCPInstruction.java @@ -37,12 +37,12 @@ public abstract class AppendCPInstruction extends BinaryCPInstruction //type (matrix cbind / scalar string concatenation) protected AppendType _type; - - public AppendCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand in3, CPOperand out, AppendType type, String opcode, String istr) - { + + protected AppendCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand in3, CPOperand out, + AppendType type, String opcode, String istr) { super(op, in1, in2, out, opcode, istr); _cptype = CPINSTRUCTION_TYPE.Append; - + _type = type; } http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/ArithmeticBinaryCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/ArithmeticBinaryCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/ArithmeticBinaryCPInstruction.java index 338daba..5507393 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/ArithmeticBinaryCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/ArithmeticBinaryCPInstruction.java @@ -26,13 +26,14 @@ import org.apache.sysml.runtime.instructions.InstructionUtils; import org.apache.sysml.runtime.matrix.operators.Operator; -public abstract class ArithmeticBinaryCPInstruction extends BinaryCPInstruction -{ - public ArithmeticBinaryCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand out, String opcode, String istr) { +public abstract class ArithmeticBinaryCPInstruction extends BinaryCPInstruction { + + protected ArithmeticBinaryCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand out, String opcode, + String istr) { super(op, in1, in2, out, opcode, istr); _cptype = CPINSTRUCTION_TYPE.ArithmeticBinary; } - + public static ArithmeticBinaryCPInstruction parseInstruction ( String str ) throws DMLRuntimeException { http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/BinaryCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/BinaryCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/BinaryCPInstruction.java index 0f160f3..9c3470c 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/BinaryCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/BinaryCPInstruction.java @@ -24,17 +24,15 @@ import org.apache.sysml.runtime.DMLRuntimeException; import org.apache.sysml.runtime.instructions.InstructionUtils; import org.apache.sysml.runtime.matrix.operators.Operator; +public abstract class BinaryCPInstruction extends ComputationCPInstruction { -public abstract class BinaryCPInstruction extends ComputationCPInstruction -{ - - public BinaryCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand out, - String opcode, String istr ){ + protected BinaryCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand out, String opcode, + String istr) { super(op, in1, in2, out, opcode, istr); } - public BinaryCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand in3, CPOperand out, - String opcode, String istr ){ + protected BinaryCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand in3, CPOperand out, + String opcode, String istr) { super(op, in1, in2, in3, out, opcode, istr); } http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/BooleanBinaryCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/BooleanBinaryCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/BooleanBinaryCPInstruction.java index ef28c10..230ecea 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/BooleanBinaryCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/BooleanBinaryCPInstruction.java @@ -27,16 +27,14 @@ import org.apache.sysml.runtime.instructions.InstructionUtils; import org.apache.sysml.runtime.matrix.operators.BinaryOperator; import org.apache.sysml.runtime.matrix.operators.Operator; +public class BooleanBinaryCPInstruction extends BinaryCPInstruction { -public class BooleanBinaryCPInstruction extends BinaryCPInstruction -{ - - public BooleanBinaryCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand out, String opcode, String istr ) - { + private BooleanBinaryCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand out, String opcode, + String istr) { super(op, in1, in2, out, opcode, istr); _cptype = CPINSTRUCTION_TYPE.BooleanBinary; } - + public static BooleanBinaryCPInstruction parseInstruction (String str) throws DMLRuntimeException { http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/BooleanUnaryCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/BooleanUnaryCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/BooleanUnaryCPInstruction.java index 2d7baaf..9143179 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/BooleanUnaryCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/BooleanUnaryCPInstruction.java @@ -26,12 +26,9 @@ import org.apache.sysml.runtime.controlprogram.context.ExecutionContext; import org.apache.sysml.runtime.matrix.operators.Operator; import org.apache.sysml.runtime.matrix.operators.SimpleOperator; +public class BooleanUnaryCPInstruction extends UnaryCPInstruction { -public class BooleanUnaryCPInstruction extends UnaryCPInstruction -{ - - public BooleanUnaryCPInstruction(Operator op, CPOperand in, CPOperand out, - String opcode, String instr){ + private BooleanUnaryCPInstruction(Operator op, CPOperand in, CPOperand out, String opcode, String instr) { super(op, in, out, opcode, instr); _cptype = CPINSTRUCTION_TYPE.BooleanUnary; } http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/BuiltinBinaryCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/BuiltinBinaryCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/BuiltinBinaryCPInstruction.java index d4679f3..4f83714 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/BuiltinBinaryCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/BuiltinBinaryCPInstruction.java @@ -28,12 +28,11 @@ import org.apache.sysml.runtime.matrix.operators.BinaryOperator; import org.apache.sysml.runtime.matrix.operators.Operator; import org.apache.sysml.runtime.matrix.operators.RightScalarOperator; - -public abstract class BuiltinBinaryCPInstruction extends BinaryCPInstruction -{ +public abstract class BuiltinBinaryCPInstruction extends BinaryCPInstruction { private int _arity; - - public BuiltinBinaryCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand out, int arity, String opcode, String istr) { + + protected BuiltinBinaryCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand out, int arity, + String opcode, String istr) { super(op, in1, in2, out, opcode, istr); _cptype = CPINSTRUCTION_TYPE.BuiltinBinary; _arity = arity; http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/BuiltinMultipleCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/BuiltinMultipleCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/BuiltinMultipleCPInstruction.java index bab3148..6da8e48 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/BuiltinMultipleCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/BuiltinMultipleCPInstruction.java @@ -43,8 +43,7 @@ public abstract class BuiltinMultipleCPInstruction extends CPInstruction { public CPOperand output; public CPOperand[] inputs; - public BuiltinMultipleCPInstruction(Operator op, String opcode, String istr, CPOperand output, - CPOperand... inputs) { + BuiltinMultipleCPInstruction(Operator op, String opcode, String istr, CPOperand output, CPOperand... inputs) { super(op, opcode, istr); _cptype = CPINSTRUCTION_TYPE.BuiltinMultiple; this.output = output; http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/BuiltinUnaryCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/BuiltinUnaryCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/BuiltinUnaryCPInstruction.java index 27b291b..42db461 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/BuiltinUnaryCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/BuiltinUnaryCPInstruction.java @@ -31,14 +31,12 @@ import org.apache.sysml.runtime.matrix.operators.Operator; import org.apache.sysml.runtime.matrix.operators.SimpleOperator; import org.apache.sysml.runtime.matrix.operators.UnaryOperator; +public abstract class BuiltinUnaryCPInstruction extends UnaryCPInstruction { -public abstract class BuiltinUnaryCPInstruction extends UnaryCPInstruction -{ - int arity; - - public BuiltinUnaryCPInstruction(Operator op, CPOperand in, CPOperand out, int _arity, String opcode, String istr ) - { + + protected BuiltinUnaryCPInstruction(Operator op, CPOperand in, CPOperand out, int _arity, String opcode, + String istr) { super(op, in, out, opcode, istr); _cptype = CPINSTRUCTION_TYPE.BuiltinUnary; arity = _arity; http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/CPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/CPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/CPInstruction.java index c879481..b01c2c5 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/CPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/CPInstruction.java @@ -57,21 +57,21 @@ public abstract class CPInstruction extends Instruction // SystemML committers have to be judicious about adding them by weighing the tradeoffs between reuse in future analysis and unnecessary overheads. public final static String MISC_TIMER_CSR_LIX_COPY = "csrlix";// time spent in CSR-specific method to address performance issues due to repeated re-shifting on update-in-place. public final static String MISC_TIMER_LIX_COPY = "lixcp";// time spent in range copy - - public CPInstruction(String opcode, String istr) { + + protected CPInstruction(String opcode, String istr) { type = INSTRUCTION_TYPE.CONTROL_PROGRAM; instString = istr; - - //prepare opcode and update requirement for repeated usage + + // prepare opcode and update requirement for repeated usage instOpcode = opcode; _requiresLabelUpdate = super.requiresLabelUpdate(); } - - public CPInstruction(Operator op, String opcode, String istr) { + + protected CPInstruction(Operator op, String opcode, String istr) { this(opcode, istr); _optr = op; } - + public CPINSTRUCTION_TYPE getCPInstructionType() { return _cptype; } http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/CPOperand.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/CPOperand.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/CPOperand.java index 5fee5ed..6fb5753 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/CPOperand.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/CPOperand.java @@ -46,14 +46,14 @@ public class CPOperand public CPOperand(String name, ValueType vt, DataType dt ) { this(name, vt, dt, false); } - - public CPOperand(String name, ValueType vt, DataType dt, boolean literal ) { + + private CPOperand(String name, ValueType vt, DataType dt, boolean literal) { _name = name; _valueType = vt; _dataType = dt; _isLiteral = literal; } - + public String getName() { return _name; } http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/CentralMomentCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/CentralMomentCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/CentralMomentCPInstruction.java index 917e984..b8ba345 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/CentralMomentCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/CentralMomentCPInstruction.java @@ -29,11 +29,10 @@ import org.apache.sysml.runtime.matrix.data.MatrixBlock; import org.apache.sysml.runtime.matrix.operators.CMOperator; import org.apache.sysml.runtime.matrix.operators.CMOperator.AggregateOperationTypes; -public class CentralMomentCPInstruction extends AggregateUnaryCPInstruction -{ - public CentralMomentCPInstruction(CMOperator cm, CPOperand in1, CPOperand in2, - CPOperand in3, CPOperand out, String opcode, String str) - { +public class CentralMomentCPInstruction extends AggregateUnaryCPInstruction { + + private CentralMomentCPInstruction(CMOperator cm, CPOperand in1, CPOperand in2, CPOperand in3, CPOperand out, + String opcode, String str) { super(cm, in1, in2, in3, out, opcode, str); } http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/CompressionCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/CompressionCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/CompressionCPInstruction.java index e9826e1..6169076 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/CompressionCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/CompressionCPInstruction.java @@ -28,13 +28,12 @@ import org.apache.sysml.runtime.instructions.InstructionUtils; import org.apache.sysml.runtime.matrix.data.MatrixBlock; import org.apache.sysml.runtime.matrix.operators.Operator; -public class CompressionCPInstruction extends UnaryCPInstruction -{ - - public CompressionCPInstruction(Operator op, CPOperand in, CPOperand out, String opcode, String istr){ +public class CompressionCPInstruction extends UnaryCPInstruction { + + private CompressionCPInstruction(Operator op, CPOperand in, CPOperand out, String opcode, String istr) { super(op, in, null, null, out, opcode, istr); } - + public static Instruction parseInstruction(String str) throws DMLRuntimeException { http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/ComputationCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/ComputationCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/ComputationCPInstruction.java index 92d5ef2..67dc051 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/ComputationCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/ComputationCPInstruction.java @@ -23,14 +23,13 @@ import org.apache.sysml.hops.OptimizerUtils; import org.apache.sysml.runtime.matrix.data.MatrixBlock; import org.apache.sysml.runtime.matrix.operators.Operator; -public abstract class ComputationCPInstruction extends CPInstruction -{ - +public abstract class ComputationCPInstruction extends CPInstruction { public CPOperand output; public CPOperand input1, input2, input3; - - public ComputationCPInstruction ( Operator op, CPOperand in1, CPOperand in2, CPOperand out, String opcode, String istr ) { + + protected ComputationCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand out, String opcode, + String istr) { super(op, opcode, istr); input1 = in1; input2 = in2; @@ -38,7 +37,8 @@ public abstract class ComputationCPInstruction extends CPInstruction output = out; } - public ComputationCPInstruction ( Operator op, CPOperand in1, CPOperand in2, CPOperand in3, CPOperand out, String opcode, String istr ) { + protected ComputationCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand in3, CPOperand out, + String opcode, String istr) { super(op, opcode, istr); input1 = in1; input2 = in2; http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/ConvolutionCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/ConvolutionCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/ConvolutionCPInstruction.java index 97a9a5a..629b688 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/ConvolutionCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/ConvolutionCPInstruction.java @@ -34,33 +34,32 @@ import org.apache.sysml.runtime.matrix.operators.ReorgOperator; import org.apache.sysml.runtime.util.ConvolutionUtils; import org.apache.sysml.utils.NativeHelper; -public class ConvolutionCPInstruction extends UnaryCPInstruction -{ +public class ConvolutionCPInstruction extends UnaryCPInstruction { private CPOperand _in2; - private CPOperand _in3; + private CPOperand _in3; private ArrayList<CPOperand> _input_shape; private ArrayList<CPOperand> _filter_shape; private ArrayList<CPOperand> _stride = new ArrayList<CPOperand>(); private ArrayList<CPOperand> _padding = new ArrayList<CPOperand>(); private int _numThreads = -1; - - public ConvolutionCPInstruction(CPOperand in, CPOperand in2, CPOperand out, String opcode, String istr, int numThreads) throws DMLRuntimeException { - super(new ReorgOperator(SwapIndex.getSwapIndexFnObject()), in, out, - opcode, istr); - if( !(opcode.equals("bias_add") || opcode.equals("relu_backward") || opcode.equals("bias_multiply") ) ) { - throw new DMLRuntimeException("Incorrect usage. Expected the opcode to be bias_add or bias_multiply or relu_backward, but found " + opcode); + + private ConvolutionCPInstruction(CPOperand in, CPOperand in2, CPOperand out, String opcode, String istr, + int numThreads) throws DMLRuntimeException { + super(new ReorgOperator(SwapIndex.getSwapIndexFnObject()), in, out, opcode, istr); + if (!(opcode.equals("bias_add") || opcode.equals("relu_backward") || opcode.equals("bias_multiply"))) { + throw new DMLRuntimeException( + "Incorrect usage. Expected the opcode to be bias_add or bias_multiply or relu_backward, but found " + + opcode); } _in2 = in2; _cptype = CPINSTRUCTION_TYPE.Convolution; _numThreads = numThreads; } - - public ConvolutionCPInstruction(CPOperand in, CPOperand out, String opcode, - String istr, ArrayList<CPOperand> stride, - ArrayList<CPOperand> padding, ArrayList<CPOperand> input_shape, + + private ConvolutionCPInstruction(CPOperand in, CPOperand out, String opcode, String istr, + ArrayList<CPOperand> stride, ArrayList<CPOperand> padding, ArrayList<CPOperand> input_shape, ArrayList<CPOperand> filter_shape, int numThreads) { - super(new ReorgOperator(SwapIndex.getSwapIndexFnObject()), in, out, - opcode, istr); + super(new ReorgOperator(SwapIndex.getSwapIndexFnObject()), in, out, opcode, istr); _cptype = CPINSTRUCTION_TYPE.Convolution; _stride = stride; _padding = padding; @@ -68,13 +67,11 @@ public class ConvolutionCPInstruction extends UnaryCPInstruction _filter_shape = filter_shape; _numThreads = numThreads; } - - public ConvolutionCPInstruction(CPOperand in, CPOperand in2, CPOperand out, String opcode, - String istr, ArrayList<CPOperand> stride, - ArrayList<CPOperand> padding, ArrayList<CPOperand> input_shape, + + private ConvolutionCPInstruction(CPOperand in, CPOperand in2, CPOperand out, String opcode, String istr, + ArrayList<CPOperand> stride, ArrayList<CPOperand> padding, ArrayList<CPOperand> input_shape, ArrayList<CPOperand> filter_shape, int numThreads) { - super(new ReorgOperator(SwapIndex.getSwapIndexFnObject()), in, out, - opcode, istr); + super(new ReorgOperator(SwapIndex.getSwapIndexFnObject()), in, out, opcode, istr); _in2 = in2; _cptype = CPINSTRUCTION_TYPE.Convolution; _stride = stride; @@ -83,13 +80,11 @@ public class ConvolutionCPInstruction extends UnaryCPInstruction _filter_shape = filter_shape; _numThreads = numThreads; } - - public ConvolutionCPInstruction(CPOperand in, CPOperand in2, CPOperand in3, CPOperand out, String opcode, - String istr, ArrayList<CPOperand> stride, - ArrayList<CPOperand> padding, ArrayList<CPOperand> input_shape, + + private ConvolutionCPInstruction(CPOperand in, CPOperand in2, CPOperand in3, CPOperand out, String opcode, + String istr, ArrayList<CPOperand> stride, ArrayList<CPOperand> padding, ArrayList<CPOperand> input_shape, ArrayList<CPOperand> filter_shape, int numThreads) { - super(new ReorgOperator(SwapIndex.getSwapIndexFnObject()), in, out, - opcode, istr); + super(new ReorgOperator(SwapIndex.getSwapIndexFnObject()), in, out, opcode, istr); _in2 = in2; _in3 = in3; _cptype = CPINSTRUCTION_TYPE.Convolution; http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/CovarianceCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/CovarianceCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/CovarianceCPInstruction.java index d2e43e2..d7eb24f 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/CovarianceCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/CovarianceCPInstruction.java @@ -29,18 +29,16 @@ import org.apache.sysml.runtime.matrix.data.MatrixBlock; import org.apache.sysml.runtime.matrix.operators.COVOperator; import org.apache.sysml.runtime.matrix.operators.Operator; -public class CovarianceCPInstruction extends BinaryCPInstruction -{ - - public CovarianceCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand out, String opcode, String istr ) - { +public class CovarianceCPInstruction extends BinaryCPInstruction { + + private CovarianceCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand out, String opcode, + String istr) { super(op, in1, in2, out, opcode, istr); _cptype = CPINSTRUCTION_TYPE.AggregateBinary; } - - public CovarianceCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand in3, CPOperand out, - String opcode, String istr ) - { + + private CovarianceCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand in3, CPOperand out, + String opcode, String istr) { super(op, in1, in2, in3, out, opcode, istr); _cptype = CPINSTRUCTION_TYPE.AggregateBinary; } http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/DataGenCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/DataGenCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/DataGenCPInstruction.java index 73e4cf1..46f2116 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/DataGenCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/DataGenCPInstruction.java @@ -32,11 +32,10 @@ import org.apache.sysml.runtime.matrix.data.RandomMatrixGenerator; import org.apache.sysml.runtime.matrix.operators.Operator; import org.apache.sysml.runtime.util.UtilFunctions; -public class DataGenCPInstruction extends UnaryCPInstruction -{ - +public class DataGenCPInstruction extends UnaryCPInstruction { + private DataGenMethod method = DataGenMethod.INVALID; - + private long rows; private long cols; private int rowsInBlock; @@ -45,24 +44,22 @@ public class DataGenCPInstruction extends UnaryCPInstruction private double maxValue; private double sparsity; private String pdf, pdfParams; - private long seed=0; - - //sequence specific attributes + private long seed = 0; + + // sequence specific attributes private double seq_from; - private double seq_to; + private double seq_to; private double seq_incr; - - //sample specific attributes + + // sample specific attributes private boolean replace; - private int numThreads = -1; - - public DataGenCPInstruction (Operator op, DataGenMethod mthd, CPOperand in, CPOperand out, - long rows, long cols, int rpb, int cpb, - double minValue, double maxValue, double sparsity, long seed, - String probabilityDensityFunction, String pdfParams, int k, String opcode, String istr) - { + private int numThreads = -1; + + private DataGenCPInstruction(Operator op, DataGenMethod mthd, CPOperand in, CPOperand out, long rows, long cols, + int rpb, int cpb, double minValue, double maxValue, double sparsity, long seed, + String probabilityDensityFunction, String pdfParams, int k, String opcode, String istr) { super(op, in, out, opcode, istr); - + this.method = mthd; this.rows = rows; this.cols = cols; @@ -77,12 +74,10 @@ public class DataGenCPInstruction extends UnaryCPInstruction this.pdfParams = pdfParams; } - public DataGenCPInstruction (Operator op, DataGenMethod mthd, CPOperand in, CPOperand out, - long rows, long cols, int rpb, int cpb, double maxValue, - boolean replace, long seed, String opcode, String istr) - { + private DataGenCPInstruction(Operator op, DataGenMethod mthd, CPOperand in, CPOperand out, long rows, long cols, + int rpb, int cpb, double maxValue, boolean replace, long seed, String opcode, String istr) { super(op, in, out, opcode, istr); - + this.method = mthd; this.rows = rows; this.cols = cols; @@ -92,13 +87,11 @@ public class DataGenCPInstruction extends UnaryCPInstruction this.replace = replace; this.seed = seed; } - - public DataGenCPInstruction(Operator op, DataGenMethod mthd, CPOperand in, CPOperand out, - long rows, long cols, int rpb, int cpb, double seqFrom, - double seqTo, double seqIncr, String opcode, String istr) - { + + private DataGenCPInstruction(Operator op, DataGenMethod mthd, CPOperand in, CPOperand out, long rows, long cols, + int rpb, int cpb, double seqFrom, double seqTo, double seqIncr, String opcode, String istr) { super(op, in, out, opcode, istr); - + this.method = mthd; this.rows = rows; this.cols = cols; http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/DataPartitionCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/DataPartitionCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/DataPartitionCPInstruction.java index 68151d2..799fdb3 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/DataPartitionCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/DataPartitionCPInstruction.java @@ -37,13 +37,12 @@ import org.apache.sysml.runtime.matrix.data.MatrixBlock; import org.apache.sysml.runtime.matrix.data.OutputInfo; import org.apache.sysml.runtime.matrix.operators.Operator; -public class DataPartitionCPInstruction extends UnaryCPInstruction -{ - +public class DataPartitionCPInstruction extends UnaryCPInstruction { + private PDataPartitionFormat _pformat = null; - - public DataPartitionCPInstruction(Operator op, CPOperand in1, PDataPartitionFormat pformat, CPOperand out, String opcode, String istr) - { + + private DataPartitionCPInstruction(Operator op, CPOperand in1, PDataPartitionFormat pformat, CPOperand out, + String opcode, String istr) { super(op, in1, out, opcode, istr); _cptype = CPINSTRUCTION_TYPE.MMTSJ; _pformat = pformat; http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/FrameAppendCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/FrameAppendCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/FrameAppendCPInstruction.java index a3a03a0..e194c87 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/FrameAppendCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/FrameAppendCPInstruction.java @@ -24,9 +24,10 @@ import org.apache.sysml.runtime.controlprogram.context.ExecutionContext; import org.apache.sysml.runtime.matrix.data.FrameBlock; import org.apache.sysml.runtime.matrix.operators.Operator; -public final class FrameAppendCPInstruction extends AppendCPInstruction -{ - public FrameAppendCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand in3, CPOperand out, AppendType type, String opcode, String istr) { +public final class FrameAppendCPInstruction extends AppendCPInstruction { + + protected FrameAppendCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand in3, CPOperand out, + AppendType type, String opcode, String istr) { super(op, in1, in2, in3, out, type, opcode, istr); } http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/FrameIndexingCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/FrameIndexingCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/FrameIndexingCPInstruction.java index 21b02c7..fa45b9c 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/FrameIndexingCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/FrameIndexingCPInstruction.java @@ -26,16 +26,18 @@ import org.apache.sysml.runtime.matrix.data.FrameBlock; import org.apache.sysml.runtime.matrix.operators.Operator; import org.apache.sysml.runtime.util.IndexRange; -public final class FrameIndexingCPInstruction extends IndexingCPInstruction -{ - public FrameIndexingCPInstruction(Operator op, CPOperand in, CPOperand rl, CPOperand ru, CPOperand cl, CPOperand cu, CPOperand out, String opcode, String istr){ +public final class FrameIndexingCPInstruction extends IndexingCPInstruction { + + protected FrameIndexingCPInstruction(Operator op, CPOperand in, CPOperand rl, CPOperand ru, CPOperand cl, + CPOperand cu, CPOperand out, String opcode, String istr) { super(op, in, rl, ru, cl, cu, out, opcode, istr); } - - public FrameIndexingCPInstruction(Operator op, CPOperand lhsInput, CPOperand rhsInput, CPOperand rl, CPOperand ru, CPOperand cl, CPOperand cu, CPOperand out, String opcode, String istr){ + + protected FrameIndexingCPInstruction(Operator op, CPOperand lhsInput, CPOperand rhsInput, CPOperand rl, + CPOperand ru, CPOperand cl, CPOperand cu, CPOperand out, String opcode, String istr) { super(op, lhsInput, rhsInput, rl, ru, cl, cu, out, opcode, istr); } - + @Override public void processInstruction(ExecutionContext ec) throws DMLRuntimeException http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/FunctionCallCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/FunctionCallCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/FunctionCallCPInstruction.java index 77c48a7..d774c8d 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/FunctionCallCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/FunctionCallCPInstruction.java @@ -40,34 +40,34 @@ import org.apache.sysml.runtime.controlprogram.context.ExecutionContextFactory; import org.apache.sysml.runtime.instructions.Instruction; import org.apache.sysml.runtime.instructions.InstructionUtils; -public class FunctionCallCPInstruction extends CPInstruction -{ +public class FunctionCallCPInstruction extends CPInstruction { private String _functionName; private String _namespace; - - public String getFunctionName(){ + + public String getFunctionName() { return _functionName; } - + public String getNamespace() { return _namespace; } - + // stores both the bound input and output parameters private ArrayList<CPOperand> _boundInputParamOperands; private ArrayList<String> _boundInputParamNames; private ArrayList<String> _boundOutputParamNames; - - public FunctionCallCPInstruction(String namespace, String functName, ArrayList<CPOperand> boundInParamOperands, ArrayList<String> boundInParamNames, ArrayList<String> boundOutParamNames, String istr) { + + private FunctionCallCPInstruction(String namespace, String functName, ArrayList<CPOperand> boundInParamOperands, + ArrayList<String> boundInParamNames, ArrayList<String> boundOutParamNames, String istr) { super(null, functName, istr); - + _cptype = CPINSTRUCTION_TYPE.External; _functionName = functName; _namespace = namespace; _boundInputParamOperands = boundInParamOperands; _boundInputParamNames = boundInParamNames; _boundOutputParamNames = boundOutParamNames; - + } public static FunctionCallCPInstruction parseInstruction(String str) http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/IndexingCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/IndexingCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/IndexingCPInstruction.java index 17ff59c..46f3f05 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/IndexingCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/IndexingCPInstruction.java @@ -27,19 +27,20 @@ import org.apache.sysml.runtime.matrix.operators.Operator; import org.apache.sysml.runtime.matrix.operators.SimpleOperator; import org.apache.sysml.runtime.util.IndexRange; -public abstract class IndexingCPInstruction extends UnaryCPInstruction -{ +public abstract class IndexingCPInstruction extends UnaryCPInstruction { protected CPOperand rowLower, rowUpper, colLower, colUpper; - - public IndexingCPInstruction(Operator op, CPOperand in, CPOperand rl, CPOperand ru, CPOperand cl, CPOperand cu, CPOperand out, String opcode, String istr){ + + protected IndexingCPInstruction(Operator op, CPOperand in, CPOperand rl, CPOperand ru, CPOperand cl, CPOperand cu, + CPOperand out, String opcode, String istr) { super(op, in, out, opcode, istr); rowLower = rl; rowUpper = ru; colLower = cl; colUpper = cu; } - - public IndexingCPInstruction(Operator op, CPOperand lhsInput, CPOperand rhsInput, CPOperand rl, CPOperand ru, CPOperand cl, CPOperand cu, CPOperand out, String opcode, String istr){ + + protected IndexingCPInstruction(Operator op, CPOperand lhsInput, CPOperand rhsInput, CPOperand rl, CPOperand ru, + CPOperand cl, CPOperand cu, CPOperand out, String opcode, String istr) { super(op, lhsInput, rhsInput, out, opcode, istr); rowLower = rl; rowUpper = ru; http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/MMChainCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/MMChainCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/MMChainCPInstruction.java index 273dd2a..de898fe 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/MMChainCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/MMChainCPInstruction.java @@ -26,14 +26,13 @@ import org.apache.sysml.runtime.instructions.InstructionUtils; import org.apache.sysml.runtime.matrix.data.MatrixBlock; import org.apache.sysml.runtime.matrix.operators.Operator; -public class MMChainCPInstruction extends UnaryCPInstruction -{ - +public class MMChainCPInstruction extends UnaryCPInstruction { + private ChainType _type = null; private int _numThreads = -1; - - public MMChainCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand in3, CPOperand out, ChainType type, int k, String opcode, String istr) - { + + private MMChainCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand in3, CPOperand out, + ChainType type, int k, String opcode, String istr) { super(op, in1, in2, in3, out, opcode, istr); _cptype = CPINSTRUCTION_TYPE.MMChain; _type = type; http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/MMTSJCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/MMTSJCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/MMTSJCPInstruction.java index 361da7f..eb414e7 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/MMTSJCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/MMTSJCPInstruction.java @@ -26,14 +26,12 @@ import org.apache.sysml.runtime.instructions.InstructionUtils; import org.apache.sysml.runtime.matrix.data.MatrixBlock; import org.apache.sysml.runtime.matrix.operators.Operator; -public class MMTSJCPInstruction extends UnaryCPInstruction -{ - +public class MMTSJCPInstruction extends UnaryCPInstruction { private MMTSJType _type = null; private int _numThreads = 1; - - public MMTSJCPInstruction(Operator op, CPOperand in1, MMTSJType type, CPOperand out, int k, String opcode, String istr) - { + + private MMTSJCPInstruction(Operator op, CPOperand in1, MMTSJType type, CPOperand out, int k, String opcode, + String istr) { super(op, in1, out, opcode, istr); _cptype = CPINSTRUCTION_TYPE.MMTSJ; _type = type; http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixAppendCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixAppendCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixAppendCPInstruction.java index ec6bf09..28f9b6b 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixAppendCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixAppendCPInstruction.java @@ -24,9 +24,10 @@ import org.apache.sysml.runtime.controlprogram.context.ExecutionContext; import org.apache.sysml.runtime.matrix.data.MatrixBlock; import org.apache.sysml.runtime.matrix.operators.Operator; -public final class MatrixAppendCPInstruction extends AppendCPInstruction -{ - public MatrixAppendCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand in3, CPOperand out, AppendType type, String opcode, String istr) { +public final class MatrixAppendCPInstruction extends AppendCPInstruction { + + protected MatrixAppendCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand in3, CPOperand out, + AppendType type, String opcode, String istr) { super(op, in1, in2, in3, out, type, opcode, istr); } http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixBuiltinCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixBuiltinCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixBuiltinCPInstruction.java index 7817c06..30000f9 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixBuiltinCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixBuiltinCPInstruction.java @@ -26,10 +26,8 @@ import org.apache.sysml.runtime.matrix.data.MatrixBlock; import org.apache.sysml.runtime.matrix.operators.Operator; import org.apache.sysml.runtime.matrix.operators.UnaryOperator; - -public class MatrixBuiltinCPInstruction extends BuiltinUnaryCPInstruction -{ - public MatrixBuiltinCPInstruction(Operator op, CPOperand in, CPOperand out, String opcode, String instr){ +public class MatrixBuiltinCPInstruction extends BuiltinUnaryCPInstruction { + protected MatrixBuiltinCPInstruction(Operator op, CPOperand in, CPOperand out, String opcode, String instr) { super(op, in, out, 1, opcode, instr); } http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixIndexingCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixIndexingCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixIndexingCPInstruction.java index b2e416c..942f898 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixIndexingCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixIndexingCPInstruction.java @@ -31,16 +31,18 @@ import org.apache.sysml.runtime.matrix.operators.Operator; import org.apache.sysml.runtime.util.IndexRange; import org.apache.sysml.utils.Statistics; -public final class MatrixIndexingCPInstruction extends IndexingCPInstruction -{ - public MatrixIndexingCPInstruction(Operator op, CPOperand in, CPOperand rl, CPOperand ru, CPOperand cl, CPOperand cu, CPOperand out, String opcode, String istr){ +public final class MatrixIndexingCPInstruction extends IndexingCPInstruction { + + protected MatrixIndexingCPInstruction(Operator op, CPOperand in, CPOperand rl, CPOperand ru, CPOperand cl, + CPOperand cu, CPOperand out, String opcode, String istr) { super(op, in, rl, ru, cl, cu, out, opcode, istr); } - - public MatrixIndexingCPInstruction(Operator op, CPOperand lhsInput, CPOperand rhsInput, CPOperand rl, CPOperand ru, CPOperand cl, CPOperand cu, CPOperand out, String opcode, String istr){ + + protected MatrixIndexingCPInstruction(Operator op, CPOperand lhsInput, CPOperand rhsInput, CPOperand rl, + CPOperand ru, CPOperand cl, CPOperand cu, CPOperand out, String opcode, String istr) { super(op, lhsInput, rhsInput, rl, ru, cl, cu, out, opcode, istr); } - + @Override public void processInstruction(ExecutionContext ec) throws DMLRuntimeException http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixMatrixArithmeticCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixMatrixArithmeticCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixMatrixArithmeticCPInstruction.java index 7216418..309fe07 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixMatrixArithmeticCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixMatrixArithmeticCPInstruction.java @@ -25,19 +25,13 @@ import org.apache.sysml.runtime.matrix.data.MatrixBlock; import org.apache.sysml.runtime.matrix.operators.BinaryOperator; import org.apache.sysml.runtime.matrix.operators.Operator; +public class MatrixMatrixArithmeticCPInstruction extends ArithmeticBinaryCPInstruction { -public class MatrixMatrixArithmeticCPInstruction extends ArithmeticBinaryCPInstruction -{ - - public MatrixMatrixArithmeticCPInstruction(Operator op, - CPOperand in1, - CPOperand in2, - CPOperand out, - String opcode, - String istr){ + protected MatrixMatrixArithmeticCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand out, + String opcode, String istr) { super(op, in1, in2, out, opcode, istr); } - + @Override public void processInstruction(ExecutionContext ec) throws DMLRuntimeException http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixMatrixBuiltinCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixMatrixBuiltinCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixMatrixBuiltinCPInstruction.java index 348b9d6..96a1e86 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixMatrixBuiltinCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixMatrixBuiltinCPInstruction.java @@ -27,19 +27,13 @@ import org.apache.sysml.runtime.matrix.data.MatrixBlock; import org.apache.sysml.runtime.matrix.operators.BinaryOperator; import org.apache.sysml.runtime.matrix.operators.Operator; +public class MatrixMatrixBuiltinCPInstruction extends BuiltinBinaryCPInstruction { -public class MatrixMatrixBuiltinCPInstruction extends BuiltinBinaryCPInstruction -{ - - public MatrixMatrixBuiltinCPInstruction(Operator op, - CPOperand in1, - CPOperand in2, - CPOperand out, - String opcode, - String istr){ + protected MatrixMatrixBuiltinCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand out, String opcode, + String istr) { super(op, in1, in2, out, 2, opcode, istr); } - + @Override public void processInstruction(ExecutionContext ec) throws DMLRuntimeException http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixMatrixRelationalCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixMatrixRelationalCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixMatrixRelationalCPInstruction.java index fd6bd8b..c45f758 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixMatrixRelationalCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixMatrixRelationalCPInstruction.java @@ -25,16 +25,10 @@ import org.apache.sysml.runtime.matrix.data.MatrixBlock; import org.apache.sysml.runtime.matrix.operators.BinaryOperator; import org.apache.sysml.runtime.matrix.operators.Operator; +public class MatrixMatrixRelationalCPInstruction extends RelationalBinaryCPInstruction { -public class MatrixMatrixRelationalCPInstruction extends RelationalBinaryCPInstruction -{ - - public MatrixMatrixRelationalCPInstruction(Operator op, - CPOperand in1, - CPOperand in2, - CPOperand out, - String opcode, - String istr){ + protected MatrixMatrixRelationalCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand out, + String opcode, String istr) { super(op, in1, in2, out, opcode, istr); } http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixReshapeCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixReshapeCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixReshapeCPInstruction.java index 132428f..6474bd6 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixReshapeCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixReshapeCPInstruction.java @@ -27,18 +27,17 @@ import org.apache.sysml.runtime.matrix.data.LibMatrixReorg; import org.apache.sysml.runtime.matrix.data.MatrixBlock; import org.apache.sysml.runtime.matrix.operators.Operator; -public class MatrixReshapeCPInstruction extends UnaryCPInstruction -{ - +public class MatrixReshapeCPInstruction extends UnaryCPInstruction { + private CPOperand _opRows = null; private CPOperand _opCols = null; private CPOperand _opByRow = null; - - public MatrixReshapeCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand in3, CPOperand in4, CPOperand out, String opcode, String istr) - { + + private MatrixReshapeCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand in3, CPOperand in4, + CPOperand out, String opcode, String istr) { super(op, in1, out, opcode, istr); _cptype = CPINSTRUCTION_TYPE.MatrixReshape; - + _opRows = in2; _opCols = in3; _opByRow = in4; http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixScalarBuiltinCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixScalarBuiltinCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixScalarBuiltinCPInstruction.java index 3cd075b..dcacb21 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixScalarBuiltinCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixScalarBuiltinCPInstruction.java @@ -26,19 +26,13 @@ import org.apache.sysml.runtime.matrix.data.MatrixBlock; import org.apache.sysml.runtime.matrix.operators.Operator; import org.apache.sysml.runtime.matrix.operators.ScalarOperator; +public class MatrixScalarBuiltinCPInstruction extends BuiltinBinaryCPInstruction { -public class MatrixScalarBuiltinCPInstruction extends BuiltinBinaryCPInstruction -{ - - public MatrixScalarBuiltinCPInstruction(Operator op, - CPOperand in1, - CPOperand in2, - CPOperand out, - String opcode, - String instr){ + protected MatrixScalarBuiltinCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand out, String opcode, + String instr) { super(op, in1, in2, out, 2, opcode, instr); } - + @Override public void processInstruction(ExecutionContext ec) throws DMLRuntimeException http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/MultiReturnBuiltinCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/MultiReturnBuiltinCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/MultiReturnBuiltinCPInstruction.java index 32be373..c60b088 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/MultiReturnBuiltinCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/MultiReturnBuiltinCPInstruction.java @@ -31,15 +31,13 @@ import org.apache.sysml.runtime.matrix.data.LibCommonsMath; import org.apache.sysml.runtime.matrix.data.MatrixBlock; import org.apache.sysml.runtime.matrix.operators.Operator; +public class MultiReturnBuiltinCPInstruction extends ComputationCPInstruction { -public class MultiReturnBuiltinCPInstruction extends ComputationCPInstruction -{ - int arity; protected ArrayList<CPOperand> _outputs; - - public MultiReturnBuiltinCPInstruction(Operator op, CPOperand input1, ArrayList<CPOperand> outputs, String opcode, String istr ) - { + + private MultiReturnBuiltinCPInstruction(Operator op, CPOperand input1, ArrayList<CPOperand> outputs, String opcode, + String istr) { super(op, input1, null, outputs.get(0), opcode, istr); _cptype = CPINSTRUCTION_TYPE.MultiReturnBuiltin; _outputs = outputs; http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/MultiReturnParameterizedBuiltinCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/MultiReturnParameterizedBuiltinCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/MultiReturnParameterizedBuiltinCPInstruction.java index 429bb00..e59bb3a 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/MultiReturnParameterizedBuiltinCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/MultiReturnParameterizedBuiltinCPInstruction.java @@ -32,17 +32,16 @@ import org.apache.sysml.runtime.matrix.operators.Operator; import org.apache.sysml.runtime.transform.encode.Encoder; import org.apache.sysml.runtime.transform.encode.EncoderFactory; - -public class MultiReturnParameterizedBuiltinCPInstruction extends ComputationCPInstruction -{ +public class MultiReturnParameterizedBuiltinCPInstruction extends ComputationCPInstruction { protected ArrayList<CPOperand> _outputs; - - public MultiReturnParameterizedBuiltinCPInstruction(Operator op, CPOperand input1, CPOperand input2, ArrayList<CPOperand> outputs, String opcode, String istr ) { + + private MultiReturnParameterizedBuiltinCPInstruction(Operator op, CPOperand input1, CPOperand input2, + ArrayList<CPOperand> outputs, String opcode, String istr) { super(op, input1, input2, outputs.get(0), opcode, istr); _cptype = CPINSTRUCTION_TYPE.MultiReturnBuiltin; _outputs = outputs; } - + public CPOperand getOutput(int i) { return _outputs.get(i); } http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/PMMJCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/PMMJCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/PMMJCPInstruction.java index 75deaae..ec42e05 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/PMMJCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/PMMJCPInstruction.java @@ -25,13 +25,12 @@ import org.apache.sysml.runtime.instructions.InstructionUtils; import org.apache.sysml.runtime.matrix.data.MatrixBlock; import org.apache.sysml.runtime.matrix.operators.Operator; -public class PMMJCPInstruction extends ComputationCPInstruction -{ - +public class PMMJCPInstruction extends ComputationCPInstruction { + private int _numThreads = -1; - - public PMMJCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand in3, CPOperand out, int k, String opcode, String istr) - { + + private PMMJCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand in3, CPOperand out, int k, + String opcode, String istr) { super(op, in1, in2, in3, out, opcode, istr); _numThreads = k; } http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/ParameterizedBuiltinCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/ParameterizedBuiltinCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/ParameterizedBuiltinCPInstruction.java index d4df8b0..b7928a6 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/ParameterizedBuiltinCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/ParameterizedBuiltinCPInstruction.java @@ -46,21 +46,19 @@ import org.apache.sysml.runtime.transform.encode.EncoderFactory; import org.apache.sysml.runtime.transform.meta.TfMetaUtils; import org.apache.sysml.runtime.util.DataConverter; - -public class ParameterizedBuiltinCPInstruction extends ComputationCPInstruction -{ +public class ParameterizedBuiltinCPInstruction extends ComputationCPInstruction { private static final int TOSTRING_MAXROWS = 100; private static final int TOSTRING_MAXCOLS = 100; private static final int TOSTRING_DECIMAL = 3; private static final boolean TOSTRING_SPARSE = false; private static final String TOSTRING_SEPARATOR = " "; private static final String TOSTRING_LINESEPARATOR = "\n"; - + private int arity; - protected HashMap<String,String> params; - - public ParameterizedBuiltinCPInstruction(Operator op, HashMap<String,String> paramsMap, CPOperand out, String opcode, String istr ) - { + protected HashMap<String, String> params; + + protected ParameterizedBuiltinCPInstruction(Operator op, HashMap<String, String> paramsMap, CPOperand out, + String opcode, String istr) { super(op, null, null, out, opcode, istr); _cptype = CPINSTRUCTION_TYPE.ParameterizedBuiltin; params = paramsMap; http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/PlusMultCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/PlusMultCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/PlusMultCPInstruction.java index 06d752e..c49f229 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/PlusMultCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/PlusMultCPInstruction.java @@ -28,15 +28,13 @@ import org.apache.sysml.runtime.instructions.InstructionUtils; import org.apache.sysml.runtime.matrix.data.MatrixBlock; import org.apache.sysml.runtime.matrix.operators.BinaryOperator; -public class PlusMultCPInstruction extends ArithmeticBinaryCPInstruction -{ - public PlusMultCPInstruction(BinaryOperator op, CPOperand in1, CPOperand in2, - CPOperand in3, CPOperand out, String opcode, String str) - { +public class PlusMultCPInstruction extends ArithmeticBinaryCPInstruction { + private PlusMultCPInstruction(BinaryOperator op, CPOperand in1, CPOperand in2, CPOperand in3, CPOperand out, + String opcode, String str) { super(op, in1, in2, out, opcode, str); - input3=in3; + input3 = in3; } - + public static PlusMultCPInstruction parseInstruction(String str) { String[] parts = InstructionUtils.getInstructionPartsWithValueType(str); http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/QuantilePickCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/QuantilePickCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/QuantilePickCPInstruction.java index eb9e256..cace173 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/QuantilePickCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/QuantilePickCPInstruction.java @@ -34,20 +34,20 @@ import org.apache.sysml.runtime.matrix.operators.Operator; import org.apache.sysml.runtime.util.MapReduceTool; import org.apache.sysml.runtime.util.UtilFunctions; -public class QuantilePickCPInstruction extends BinaryCPInstruction -{ - +public class QuantilePickCPInstruction extends BinaryCPInstruction { + private OperationTypes _type = null; private boolean _inmem = true; - - public QuantilePickCPInstruction(Operator op, CPOperand in, CPOperand out, OperationTypes type, boolean inmem, String opcode, String istr){ + + private QuantilePickCPInstruction(Operator op, CPOperand in, CPOperand out, OperationTypes type, boolean inmem, + String opcode, String istr) { this(op, in, null, out, type, inmem, opcode, istr); } - - public QuantilePickCPInstruction(Operator op, CPOperand in, CPOperand in2, CPOperand out, OperationTypes type, boolean inmem, String opcode, String istr){ + + private QuantilePickCPInstruction(Operator op, CPOperand in, CPOperand in2, CPOperand out, OperationTypes type, + boolean inmem, String opcode, String istr) { super(op, in, in2, out, opcode, istr); _cptype = CPINSTRUCTION_TYPE.QPick; - _type = type; _inmem = inmem; } http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/QuantileSortCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/QuantileSortCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/QuantileSortCPInstruction.java index d35f26b..f25c225 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/QuantileSortCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/QuantileSortCPInstruction.java @@ -29,27 +29,26 @@ import org.apache.sysml.runtime.matrix.data.MatrixBlock; import org.apache.sysml.runtime.matrix.operators.Operator; import org.apache.sysml.runtime.matrix.operators.SimpleOperator; -public class QuantileSortCPInstruction extends UnaryCPInstruction -{ - - /* - * This class supports two variants of sort operation on a 1-dimensional input matrix. - * The two variants are <code> weighted </code> and <code> unweighted </code>. - * Example instructions: - * sort:mVar1:mVar2 (input=mVar1, output=mVar2) - * sort:mVar1:mVar2:mVar3 (input=mVar1, weights=mVar2, output=mVar3) - * - */ - - public QuantileSortCPInstruction(Operator op, CPOperand in, CPOperand out, String opcode, String istr){ +/** + * This class supports two variants of sort operation on a 1-dimensional input matrix. + * The two variants are <code> weighted </code> and <code> unweighted </code>. + * Example instructions: + * sort:mVar1:mVar2 (input=mVar1, output=mVar2) + * sort:mVar1:mVar2:mVar3 (input=mVar1, weights=mVar2, output=mVar3) + * + */ +public class QuantileSortCPInstruction extends UnaryCPInstruction { + + private QuantileSortCPInstruction(Operator op, CPOperand in, CPOperand out, String opcode, String istr) { this(op, in, null, out, opcode, istr); } - - public QuantileSortCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand out, String opcode, String istr){ + + private QuantileSortCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand out, String opcode, + String istr) { super(op, in1, in2, out, opcode, istr); _cptype = CPINSTRUCTION_TYPE.QSort; } - + public static QuantileSortCPInstruction parseInstruction ( String str ) throws DMLRuntimeException { http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/QuaternaryCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/QuaternaryCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/QuaternaryCPInstruction.java index 4fdea1b..d4e89ce 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/QuaternaryCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/QuaternaryCPInstruction.java @@ -33,17 +33,15 @@ import org.apache.sysml.runtime.matrix.data.MatrixValue; import org.apache.sysml.runtime.matrix.operators.Operator; import org.apache.sysml.runtime.matrix.operators.QuaternaryOperator; -public class QuaternaryCPInstruction extends ComputationCPInstruction -{ - +public class QuaternaryCPInstruction extends ComputationCPInstruction { + private CPOperand input4 = null; - private int _numThreads = -1; - - public QuaternaryCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand in3, CPOperand in4, CPOperand out, - int k, String opcode, String istr ) - { + private int _numThreads = -1; + + private QuaternaryCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand in3, CPOperand in4, + CPOperand out, int k, String opcode, String istr) { super(op, in1, in2, in3, out, opcode, istr); - + input4 = in4; _numThreads = k; } http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/RelationalBinaryCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/RelationalBinaryCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/RelationalBinaryCPInstruction.java index 8046de9..29d2304 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/RelationalBinaryCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/RelationalBinaryCPInstruction.java @@ -25,14 +25,14 @@ import org.apache.sysml.runtime.DMLRuntimeException; import org.apache.sysml.runtime.instructions.InstructionUtils; import org.apache.sysml.runtime.matrix.operators.Operator; +public abstract class RelationalBinaryCPInstruction extends BinaryCPInstruction { -public abstract class RelationalBinaryCPInstruction extends BinaryCPInstruction -{ - public RelationalBinaryCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand out, String opcode, String istr) { + protected RelationalBinaryCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand out, String opcode, + String istr) { super(op, in1, in2, out, opcode, istr); _cptype = CPINSTRUCTION_TYPE.RelationalBinary; } - + public static RelationalBinaryCPInstruction parseInstruction ( String str ) throws DMLRuntimeException { InstructionUtils.checkNumFields (str, 3); CPOperand in1 = new CPOperand("", ValueType.UNKNOWN, DataType.UNKNOWN); http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/ReorgCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/ReorgCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/ReorgCPInstruction.java index a4cfd38..c52f020 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/ReorgCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/ReorgCPInstruction.java @@ -32,47 +32,59 @@ import org.apache.sysml.runtime.matrix.data.MatrixBlock; import org.apache.sysml.runtime.matrix.operators.Operator; import org.apache.sysml.runtime.matrix.operators.ReorgOperator; +public class ReorgCPInstruction extends UnaryCPInstruction { + // sort-specific attributes (to enable variable attributes) + private CPOperand _col = null; + private CPOperand _desc = null; + private CPOperand _ixret = null; -public class ReorgCPInstruction extends UnaryCPInstruction -{ - //sort-specific attributes (to enable variable attributes) - private CPOperand _col = null; - private CPOperand _desc = null; - private CPOperand _ixret = null; - - /** - * for opcodes r' and rdiag - * - * @param op operator - * @param in cp input operand - * @param out cp output operand - * @param opcode the opcode - * @param istr ? - */ - public ReorgCPInstruction(Operator op, CPOperand in, CPOperand out, String opcode, String istr){ + /** + * for opcodes r' and rdiag + * + * @param op + * operator + * @param in + * cp input operand + * @param out + * cp output operand + * @param opcode + * the opcode + * @param istr + * ? + */ + private ReorgCPInstruction(Operator op, CPOperand in, CPOperand out, String opcode, String istr) { super(op, in, out, opcode, istr); _cptype = CPINSTRUCTION_TYPE.Reorg; } - + /** * for opcode rsort * - * @param op operator - * @param in cp input operand - * @param col ? - * @param desc ? - * @param ixret ? - * @param out cp output operand - * @param opcode the opcode - * @param istr ? + * @param op + * operator + * @param in + * cp input operand + * @param col + * ? + * @param desc + * ? + * @param ixret + * ? + * @param out + * cp output operand + * @param opcode + * the opcode + * @param istr + * ? */ - public ReorgCPInstruction(Operator op, CPOperand in, CPOperand col, CPOperand desc, CPOperand ixret, CPOperand out, String opcode, String istr){ + private ReorgCPInstruction(Operator op, CPOperand in, CPOperand col, CPOperand desc, CPOperand ixret, CPOperand out, + String opcode, String istr) { this(op, in, out, opcode, istr); _col = col; _desc = desc; _ixret = ixret; } - + public static ReorgCPInstruction parseInstruction ( String str ) throws DMLRuntimeException { http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/ScalarAppendCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/ScalarAppendCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/ScalarAppendCPInstruction.java index e777ea4..cbcf7e2 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/ScalarAppendCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/ScalarAppendCPInstruction.java @@ -23,12 +23,13 @@ import org.apache.sysml.runtime.DMLRuntimeException; import org.apache.sysml.runtime.controlprogram.context.ExecutionContext; import org.apache.sysml.runtime.matrix.operators.Operator; -public final class ScalarAppendCPInstruction extends AppendCPInstruction -{ - public ScalarAppendCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand in3, CPOperand out, AppendType type, String opcode, String istr) { +public final class ScalarAppendCPInstruction extends AppendCPInstruction { + + protected ScalarAppendCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand in3, CPOperand out, + AppendType type, String opcode, String istr) { super(op, in1, in2, in3, out, type, opcode, istr); } - + @Override public void processInstruction(ExecutionContext ec) throws DMLRuntimeException http://git-wip-us.apache.org/repos/asf/systemml/blob/55b73422/src/main/java/org/apache/sysml/runtime/instructions/cp/ScalarBuiltinCPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/ScalarBuiltinCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/ScalarBuiltinCPInstruction.java index 3b903c8..9ced515 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/cp/ScalarBuiltinCPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/ScalarBuiltinCPInstruction.java @@ -27,15 +27,12 @@ import org.apache.sysml.runtime.controlprogram.context.ExecutionContext; import org.apache.sysml.runtime.matrix.operators.Operator; import org.apache.sysml.runtime.matrix.operators.SimpleOperator; +public class ScalarBuiltinCPInstruction extends BuiltinUnaryCPInstruction { -public class ScalarBuiltinCPInstruction extends BuiltinUnaryCPInstruction -{ - - public ScalarBuiltinCPInstruction(Operator op, CPOperand in, CPOperand out, String opcode, String instr) - { + protected ScalarBuiltinCPInstruction(Operator op, CPOperand in, CPOperand out, String opcode, String instr) { super(op, in, out, 1, opcode, instr); } - + @Override public void processInstruction(ExecutionContext ec) throws DMLRuntimeException
