Hama
  1. Hama
  2. HAMA-773

Matrix/Vector operation does not validate the input argument

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.6.3
    • Component/s: math
    • Labels:
      None

      Description

      Some of the method like add, multiply does not validate the input, they just assume the the input to be correct.

      We need to provide two versions of such methods, one version validates the input but sacrifice some performance, the other version does not check, but will potentially cause error.

      1. HAMA-773.patch
        11 kB
        Yexi Jiang
      2. HAMA-773.patch
        20 kB
        Yexi Jiang
      3. HAMA-773.patch
        32 kB
        Yexi Jiang

        Activity

        Yexi Jiang created issue -
        Hide
        Yexi Jiang added a comment -

        Patch available

        Show
        Yexi Jiang added a comment - Patch available
        Yexi Jiang made changes -
        Field Original Value New Value
        Attachment HAMA-773.patch [ 12590447 ]
        Yexi Jiang made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Edward J. Yoon made changes -
        Issue Type Bug [ 1 ] Improvement [ 4 ]
        Hide
        Edward J. Yoon added a comment -

        +1

        Show
        Edward J. Yoon added a comment - +1
        Hide
        Yexi Jiang added a comment -

        If no objection, I will commit it in two days.

        Show
        Yexi Jiang added a comment - If no objection, I will commit it in two days.
        Edward J. Yoon made changes -
        Fix Version/s 0.6.3 [ 12324386 ]
        Hide
        Yexi Jiang added a comment -

        Is it OK to commit it?

        Show
        Yexi Jiang added a comment - Is it OK to commit it?
        Hide
        Suraj Menon added a comment -

        +1. You may do the condition check with PreConditions from guava library.

        Show
        Suraj Menon added a comment - +1. You may do the condition check with PreConditions from guava library.
        Yexi Jiang made changes -
        Attachment HAMA-773.patch [ 12590917 ]
        Hide
        Yexi Jiang added a comment -

        I upload a new one by using Preconditions.

        Show
        Yexi Jiang added a comment - I upload a new one by using Preconditions.
        Hide
        Yexi Jiang added a comment -

        I added the test cases.

        Show
        Yexi Jiang added a comment - I added the test cases.
        Yexi Jiang made changes -
        Attachment HAMA-773.patch [ 12591065 ]
        Hide
        Hudson added a comment -

        Integrated in Hama trunk #138 (See https://builds.apache.org/job/Hama%20trunk/138/)
        HAMA-773: Matrix/Vector operation does not validate the input argument. (Revision 1500189)

        Result = ABORTED
        yxjiang :
        Files :

        • /hama/trunk/CHANGES.txt
        • /hama/trunk/ml/src/main/java/org/apache/hama/ml/distance/CosineDistance.java
        • /hama/trunk/ml/src/main/java/org/apache/hama/ml/distance/EuclidianDistance.java
        • /hama/trunk/ml/src/main/java/org/apache/hama/ml/kmeans/KMeansBSP.java
        • /hama/trunk/ml/src/main/java/org/apache/hama/ml/math/DenseDoubleMatrix.java
        • /hama/trunk/ml/src/main/java/org/apache/hama/ml/math/DenseDoubleVector.java
        • /hama/trunk/ml/src/main/java/org/apache/hama/ml/math/DoubleMatrix.java
        • /hama/trunk/ml/src/main/java/org/apache/hama/ml/math/DoubleVector.java
        • /hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/LinearRegressionModel.java
        • /hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/LogisticRegressionModel.java
        • /hama/trunk/ml/src/main/java/org/apache/hama/ml/writable/VectorWritable.java
        • /hama/trunk/ml/src/test/java/org/apache/hama/ml/math/TestDenseDoubleMatrix.java
        • /hama/trunk/ml/src/test/java/org/apache/hama/ml/math/TestDenseDoubleVector.java
        Show
        Hudson added a comment - Integrated in Hama trunk #138 (See https://builds.apache.org/job/Hama%20trunk/138/ ) HAMA-773 : Matrix/Vector operation does not validate the input argument. (Revision 1500189) Result = ABORTED yxjiang : Files : /hama/trunk/CHANGES.txt /hama/trunk/ml/src/main/java/org/apache/hama/ml/distance/CosineDistance.java /hama/trunk/ml/src/main/java/org/apache/hama/ml/distance/EuclidianDistance.java /hama/trunk/ml/src/main/java/org/apache/hama/ml/kmeans/KMeansBSP.java /hama/trunk/ml/src/main/java/org/apache/hama/ml/math/DenseDoubleMatrix.java /hama/trunk/ml/src/main/java/org/apache/hama/ml/math/DenseDoubleVector.java /hama/trunk/ml/src/main/java/org/apache/hama/ml/math/DoubleMatrix.java /hama/trunk/ml/src/main/java/org/apache/hama/ml/math/DoubleVector.java /hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/LinearRegressionModel.java /hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/LogisticRegressionModel.java /hama/trunk/ml/src/main/java/org/apache/hama/ml/writable/VectorWritable.java /hama/trunk/ml/src/test/java/org/apache/hama/ml/math/TestDenseDoubleMatrix.java /hama/trunk/ml/src/test/java/org/apache/hama/ml/math/TestDenseDoubleVector.java
        Hide
        Hudson added a comment -

        Integrated in Hama-Nightly-for-Hadoop-1.x #965 (See https://builds.apache.org/job/Hama-Nightly-for-Hadoop-1.x/965/)
        HAMA-773: Matrix/Vector operation does not validate the input argument. (Revision 1500189)

        Result = SUCCESS
        yxjiang :
        Files :

        • /hama/trunk/CHANGES.txt
        • /hama/trunk/ml/src/main/java/org/apache/hama/ml/distance/CosineDistance.java
        • /hama/trunk/ml/src/main/java/org/apache/hama/ml/distance/EuclidianDistance.java
        • /hama/trunk/ml/src/main/java/org/apache/hama/ml/kmeans/KMeansBSP.java
        • /hama/trunk/ml/src/main/java/org/apache/hama/ml/math/DenseDoubleMatrix.java
        • /hama/trunk/ml/src/main/java/org/apache/hama/ml/math/DenseDoubleVector.java
        • /hama/trunk/ml/src/main/java/org/apache/hama/ml/math/DoubleMatrix.java
        • /hama/trunk/ml/src/main/java/org/apache/hama/ml/math/DoubleVector.java
        • /hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/LinearRegressionModel.java
        • /hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/LogisticRegressionModel.java
        • /hama/trunk/ml/src/main/java/org/apache/hama/ml/writable/VectorWritable.java
        • /hama/trunk/ml/src/test/java/org/apache/hama/ml/math/TestDenseDoubleMatrix.java
        • /hama/trunk/ml/src/test/java/org/apache/hama/ml/math/TestDenseDoubleVector.java
        Show
        Hudson added a comment - Integrated in Hama-Nightly-for-Hadoop-1.x #965 (See https://builds.apache.org/job/Hama-Nightly-for-Hadoop-1.x/965/ ) HAMA-773 : Matrix/Vector operation does not validate the input argument. (Revision 1500189) Result = SUCCESS yxjiang : Files : /hama/trunk/CHANGES.txt /hama/trunk/ml/src/main/java/org/apache/hama/ml/distance/CosineDistance.java /hama/trunk/ml/src/main/java/org/apache/hama/ml/distance/EuclidianDistance.java /hama/trunk/ml/src/main/java/org/apache/hama/ml/kmeans/KMeansBSP.java /hama/trunk/ml/src/main/java/org/apache/hama/ml/math/DenseDoubleMatrix.java /hama/trunk/ml/src/main/java/org/apache/hama/ml/math/DenseDoubleVector.java /hama/trunk/ml/src/main/java/org/apache/hama/ml/math/DoubleMatrix.java /hama/trunk/ml/src/main/java/org/apache/hama/ml/math/DoubleVector.java /hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/LinearRegressionModel.java /hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/LogisticRegressionModel.java /hama/trunk/ml/src/main/java/org/apache/hama/ml/writable/VectorWritable.java /hama/trunk/ml/src/test/java/org/apache/hama/ml/math/TestDenseDoubleMatrix.java /hama/trunk/ml/src/test/java/org/apache/hama/ml/math/TestDenseDoubleVector.java
        Yexi Jiang made changes -
        Component/s math [ 12312441 ]
        Yexi Jiang made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Yexi Jiang
            Reporter:
            Yexi Jiang
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development