Uploaded image for project: 'Hama'
  1. Hama
  2. HAMA-765

Add apply method to Vector/Matrix

    XMLWordPrintableJSON

    Details

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

      Description

      Add 'apply' method to Vector/Matrix to allow ad-hoc function apply to the elements of a Vector/Matrix.

      For example, if a function f( x ) needs to apply to the elements of a vector v, then we can use

      ------------
      DoubleFunction fun = new DoubleFunction() {
      public double apply(double element)

      { // do what ever }

      };
      v.apply(fun);
      ------------

      This method borrows the style of functional programming by allowing a function to apply to all the elements of a Vector/Matrix. It can simply the coding, especially for those algorithms where Vector/Matrix operations are heavily used.

        Attachments

        1. HAMA-765.patch
          53 kB
          Yexi Jiang
        2. HAMA-765.patch
          52 kB
          Yexi Jiang
        3. HAMA-765.patch
          38 kB
          Yexi Jiang
        4. HAMA-765.patch
          23 kB
          Yexi Jiang

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: