hama-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Edward J. Yoon (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HAMA-19) Remove vector-norms enum to interface from implementations.
Date Fri, 08 Aug 2008 05:43:44 GMT

     [ https://issues.apache.org/jira/browse/HAMA-19?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Edward J. Yoon updated HAMA-19:
-------------------------------

    Attachment: HAMA-19.patch

Interface : 

  /**
   * Supported vector-norms.
   */
  enum Norm {

    /** Sum of the absolute values of the entries */
    One,

    /** The root of sum of squares */
    Two,

    /**
     * As the 2 norm may overflow, an overflow resistant version is also
     * available. Note that it may be slower.
     */
    TwoRobust,

    /** Largest entry in absolute value */
    Infinity
  }

Implements : 

  public double norm(Norm type) {
    if (type == Norm.One)
      return getL1Norm();
    else if (type == Norm.Two)
      return getL2Norm();
    else if (type == Norm.TwoRobust)
      return norm2_robust();
    else
      return normInf();
  }

  public double getL1Norm() {
    double sum = 0.0;
    for (int i = 0; i < m_vals.length; i++) {
      sum += m_vals[i];
    }
    return sum;
  }
....

> Remove vector-norms enum to interface from implementations.
> -----------------------------------------------------------
>
>                 Key: HAMA-19
>                 URL: https://issues.apache.org/jira/browse/HAMA-19
>             Project: Hama
>          Issue Type: Improvement
>          Components: interface
>            Reporter: Edward J. Yoon
>            Assignee: Edward J. Yoon
>             Fix For: 0.1.0
>
>         Attachments: HAMA-19.patch
>
>
> Add norms (e.g. one, tow, twoRubust, infinity) to vector interface.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message