You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by to...@apache.org on 2003/05/13 21:08:14 UTC

cvs commit: jakarta-commons-sandbox/math/src/java/org/apache/commons/math Freq.java RealMatrix.java RealMatrixImpl.java

tobrien     2003/05/13 12:08:14

  Modified:    math/src/java/org/apache/commons/math Freq.java
                        RealMatrix.java RealMatrixImpl.java
  Log:
  1. Make RealMatrixImpl implement Serializable
  2. Make all currently unimplemented methods throw UnsupportedOperationException
  3. Add solve() method to RealMatrix interface, representing vector
     solution to AX = B, where B is the parameter and A is *this.
  
  Phil
  
  Obtained from: Phil S.
  Submitted by: Phil S.
  Reviewed by: Tim O.
  
  Revision  Changes    Path
  1.2       +1 -1      jakarta-commons-sandbox/math/src/java/org/apache/commons/math/Freq.java
  
  Index: Freq.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/math/src/java/org/apache/commons/math/Freq.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Freq.java	12 May 2003 19:03:41 -0000	1.1
  +++ Freq.java	13 May 2003 19:08:14 -0000	1.2
  @@ -100,7 +100,7 @@
       }
   
       public String toXML() {
  -        return null;
  +        throw new UnsupportedOperationException("not implemented yet");
       }
   
       /** Adds 1 to the frequency count for v */
  
  
  
  1.2       +12 -2     jakarta-commons-sandbox/math/src/java/org/apache/commons/math/RealMatrix.java
  
  Index: RealMatrix.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/math/src/java/org/apache/commons/math/RealMatrix.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RealMatrix.java	12 May 2003 19:03:41 -0000	1.1
  +++ RealMatrix.java	13 May 2003 19:08:14 -0000	1.2
  @@ -221,6 +221,16 @@
        * @return v*this
        * @throws IllegalArgumentException if rowDimension != v.size()
        */
  -    public RealMatrix preMultiply(double[] v);    
  +    public RealMatrix preMultiply(double[] v);  
  +    
  +    /**
  +     * Returns the solution vector for a linear system with coefficient
  +     * matrix = *this and constant vector = b 
  +     * @param b  constant vector
  +     * @return   vector of solution values to AX = b, where A is *this
  +     * @throws   IllegalArgumentException if rowDimension != b.length or matrix 
  +     *           is singular
  +     */
  +    public double[] solve(double[] b);
   }
   
  
  
  
  1.2       +17 -3     jakarta-commons-sandbox/math/src/java/org/apache/commons/math/RealMatrixImpl.java
  
  Index: RealMatrixImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/math/src/java/org/apache/commons/math/RealMatrixImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RealMatrixImpl.java	12 May 2003 19:04:10 -0000	1.1
  +++ RealMatrixImpl.java	13 May 2003 19:08:14 -0000	1.2
  @@ -53,14 +53,16 @@
    */
   
   package org.apache.commons.math;
  +import java.io.Serializable;
   
   /**
    * Implementation for RealMatrix using double[][] array
    * @author  Phil Stetiz
    * @version $Revision$ $Date$
    */
  -public class RealMatrixImpl implements RealMatrix {
  +public class RealMatrixImpl implements RealMatrix, Serializable {
   
  +    /** Entries of the matrix */
       private double data[][];
       
       public RealMatrixImpl() {
  @@ -86,7 +88,7 @@
        * @return  the cloned matrix
        */
       public RealMatrix copy() {
  -        return null;
  +        throw new UnsupportedOperationException("not implemented yet");
       }
       
       /**
  @@ -373,5 +375,17 @@
       public RealMatrix preMultiply(double[] v) {
           throw new UnsupportedOperationException("not implemented yet");
       }
  +    
  +    /**
  +     * Returns the solution vector for a linear system with coefficient
  +     * matrix = *this and constant vector = b 
  +     * @param b  constant vector
  +     * @return   vector of solution values to AX = b, where A is *this
  +     * @throws   IllegalArgumentException if rowDimension != b.length or matrix 
  +     *           is singular
  +     */
  +    public double[] solve(double[] b) {
  +      throw new UnsupportedOperationException("not implemented yet");
  +    } 
       
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org