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.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140826 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Tim O'Brien 2003-05-13 19:08:14 +00:00
parent 9b7cfb86b2
commit ccf6befd5f
3 changed files with 30 additions and 6 deletions

View File

@ -100,7 +100,7 @@ public class Freq {
}
public String toXML() {
return null;
throw new UnsupportedOperationException("not implemented yet");
}
/** Adds 1 to the frequency count for v */

View File

@ -57,7 +57,7 @@ package org.apache.commons.math;
/**
* Interface defining a real-valued matrix with basic algebraic operations
* @author Phil Steitz
* @version $Revision: 1.1 $ $Date: 2003/05/12 19:03:41 $
* @version $Revision: 1.2 $ $Date: 2003/05/13 19:08:14 $
*/
public interface RealMatrix {
@ -221,6 +221,16 @@ public interface RealMatrix {
* @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);
}

View File

@ -53,14 +53,16 @@
*/
package org.apache.commons.math;
import java.io.Serializable;
/**
* Implementation for RealMatrix using double[][] array
* @author Phil Stetiz
* @version $Revision: 1.1 $ $Date: 2003/05/12 19:04:10 $
* @version $Revision: 1.2 $ $Date: 2003/05/13 19:08:14 $
*/
public class RealMatrixImpl implements RealMatrix {
public class RealMatrixImpl implements RealMatrix, Serializable {
/** Entries of the matrix */
private double data[][];
public RealMatrixImpl() {
@ -86,7 +88,7 @@ public class RealMatrixImpl implements RealMatrix {
* @return the cloned matrix
*/
public RealMatrix copy() {
return null;
throw new UnsupportedOperationException("not implemented yet");
}
/**
@ -374,4 +376,16 @@ public class RealMatrixImpl implements RealMatrix {
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");
}
}