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
        32 kB
        Yexi Jiang
      2. HAMA-773.patch
        20 kB
        Yexi Jiang
      3. HAMA-773.patch
        11 kB
        Yexi Jiang

        Activity

        Hide
        Yexi Jiang added a comment -

        Patch available

        Show
        Yexi Jiang added a comment - Patch available
        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.
        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.
        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.
        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

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development