From 1af2a2a253dc64b266de37d951d3deb182eb1fc8 Mon Sep 17 00:00:00 2001 From: Phil Steitz Date: Mon, 7 Jun 2004 03:26:31 +0000 Subject: [PATCH] Formatting only, Eliminated tabs and trailing spaces. git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@141285 13f79535-47bb-0310-9956-ffa450edef68 --- .../math/linear/InvalidMatrixException.java | 16 ++-- .../math/linear/MatrixIndexException.java | 16 ++-- .../commons/math/linear/RealMatrix.java | 82 +++++++++--------- .../commons/math/linear/RealMatrixImpl.java | 84 +++++++++---------- .../apache/commons/math/linear/package.html | 4 +- 5 files changed, 101 insertions(+), 101 deletions(-) diff --git a/src/java/org/apache/commons/math/linear/InvalidMatrixException.java b/src/java/org/apache/commons/math/linear/InvalidMatrixException.java index ef10e66c9..6772c9f0c 100644 --- a/src/java/org/apache/commons/math/linear/InvalidMatrixException.java +++ b/src/java/org/apache/commons/math/linear/InvalidMatrixException.java @@ -1,12 +1,12 @@ /* * Copyright 2004 The Apache Software Foundation. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -22,23 +22,23 @@ import org.apache.commons.lang.exception.NestableRuntimeException; * Thrown when a system attempts an operation on a matrix, and * that matrix does not satisfy the preconditions for the * aforementioned operation. - * @version $Revision: 1.5 $ $Date: 2004/06/02 00:06:18 $ + * @version $Revision: 1.6 $ $Date: 2004/06/07 03:26:31 $ */ public class InvalidMatrixException extends NestableRuntimeException { - + /** Serializable version identifier */ static final long serialVersionUID = 5318837237354354107L; - + /** * Default constructor. */ public InvalidMatrixException() { this(null, null); } - + /** * Construct an exception with the given message. - * @param message descriptive error message. + * @param message descriptive error message. */ public InvalidMatrixException(String message) { this(message, null); diff --git a/src/java/org/apache/commons/math/linear/MatrixIndexException.java b/src/java/org/apache/commons/math/linear/MatrixIndexException.java index 130fb2555..830407fd4 100644 --- a/src/java/org/apache/commons/math/linear/MatrixIndexException.java +++ b/src/java/org/apache/commons/math/linear/MatrixIndexException.java @@ -1,12 +1,12 @@ /* * Copyright 2004 The Apache Software Foundation. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -21,23 +21,23 @@ import org.apache.commons.lang.exception.NestableRuntimeException; /** * Thrown when an operation addresses a matrix coordinate (row,col) * which is outside of the dimensions of a matrix. - * @version $Revision: 1.5 $ $Date: 2004/06/02 00:06:18 $ + * @version $Revision: 1.6 $ $Date: 2004/06/07 03:26:31 $ */ public class MatrixIndexException extends NestableRuntimeException { - + /** Serializable version identifier */ static final long serialVersionUID = -1341109412864309526L; - + /** * Default constructor. */ public MatrixIndexException() { this(null, null); } - + /** * Construct an exception with the given message. - * @param message descriptive error message. + * @param message descriptive error message. */ public MatrixIndexException(String message) { this(message, null); diff --git a/src/java/org/apache/commons/math/linear/RealMatrix.java b/src/java/org/apache/commons/math/linear/RealMatrix.java index d3ceb70e9..20f58e7a3 100644 --- a/src/java/org/apache/commons/math/linear/RealMatrix.java +++ b/src/java/org/apache/commons/math/linear/RealMatrix.java @@ -1,12 +1,12 @@ /* * Copyright 2003-2004 The Apache Software Foundation. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -18,7 +18,7 @@ package org.apache.commons.math.linear; /** * Interface defining a real-valued matrix with basic algebraic operations - * @version $Revision: 1.18 $ $Date: 2004/06/05 22:28:10 $ + * @version $Revision: 1.19 $ $Date: 2004/06/07 03:26:31 $ */ public interface RealMatrix { @@ -28,7 +28,7 @@ public interface RealMatrix { * @return matrix copy */ RealMatrix copy(); - + /** * Compute the sum of this and m. * @@ -36,8 +36,8 @@ public interface RealMatrix { * @return this + m * @throws IllegalArgumentException if m is not the same size as this */ - RealMatrix add(RealMatrix m) throws IllegalArgumentException; - + RealMatrix add(RealMatrix m) throws IllegalArgumentException; + /** * Compute this minus m. * @@ -45,8 +45,8 @@ public interface RealMatrix { * @return this + m * @throws IllegalArgumentException if m is not the same size as this */ - RealMatrix subtract(RealMatrix m) throws IllegalArgumentException; - + RealMatrix subtract(RealMatrix m) throws IllegalArgumentException; + /** * Returns the result of adding d to each entry of this. * @@ -54,7 +54,7 @@ public interface RealMatrix { * @return d + this */ RealMatrix scalarAdd(double d); - + /** * Returns the result multiplying each entry of this by d. * @@ -62,17 +62,17 @@ public interface RealMatrix { * @return d * this */ RealMatrix scalarMultiply(double d); - + /** * Returns the result postmultiplying this by m. * * @param m matrix to postmultiply by * @return this * m - * @throws IllegalArgumentException + * @throws IllegalArgumentException * if columnDimension(this) != rowDimension(m) */ RealMatrix multiply(RealMatrix m) throws IllegalArgumentException; - + /** * Returns the result premultiplying this by m. * @param m matrix to premultiply by @@ -81,14 +81,14 @@ public interface RealMatrix { * if rowDimension(this) != columnDimension(m) */ public RealMatrix preMultiply(RealMatrix m) throws IllegalArgumentException; - + /** * Returns matrix entries as a two-dimensional array. * * @return 2-dimensional array of entries */ double[][] getData(); - + /** * Overwrites the underlying data for the matrix with * a fresh copy of data. @@ -96,7 +96,7 @@ public interface RealMatrix { * @param data 2-dimensional array of entries */ void setData(double[][] data); - + /** * Returns the * maximum absolute row sum norm of the matrix. @@ -104,17 +104,17 @@ public interface RealMatrix { * @return norm */ double getNorm(); - + /** * Returns the entries in row number row as an array. * * @param row the row to be fetched * @return array of entries in the row - * @throws MatrixIndexException if the specified row is greater + * @throws MatrixIndexException if the specified row is greater * than the number of rows in this matrix */ double[] getRow(int row) throws MatrixIndexException; - + /** * Returns the entries in column number col as an array. * @@ -124,37 +124,37 @@ public interface RealMatrix { * than the number of columns in this matrix */ double[] getColumn(int col) throws MatrixIndexException; - + /** * Returns the entry in the specified row and column. * - * @param row row location of entry to be fetched + * @param row row location of entry to be fetched * @param column column location of entry to be fetched * @return matrix entry in row,column - * @throws MatrixIndexException if the specified coordinate is outside + * @throws MatrixIndexException if the specified coordinate is outside * the dimensions of this matrix */ double getEntry(int row, int column) throws MatrixIndexException; - + /** * Sets the entry in the specified row and column to the specified value. * - * @param row row location of entry to be set + * @param row row location of entry to be set * @param column column location of entry to be set - * @param value value to set + * @param value value to set * @throws MatrixIndexException if the specified coordinate is outside * he dimensions of this matrix */ - void setEntry(int row, int column, double value) + void setEntry(int row, int column, double value) throws MatrixIndexException; - + /** * Returns the transpose of this matrix. * * @return transpose matrix */ RealMatrix transpose(); - + /** * Returns the inverse of this matrix. * @@ -162,40 +162,40 @@ public interface RealMatrix { * @throws InvalidMatrixException if this is not invertible */ RealMatrix inverse() throws InvalidMatrixException; - + /** * Returns the determinant of this matrix. * * @return determinant */ double getDeterminant(); - + /** * Is this a square matrix? * @return true if the matrix is square (rowDimension = columnDimension) */ boolean isSquare(); - + /** * Is this a singular matrix? * @return true if the matrix is singular */ boolean isSingular(); - + /** * Returns the number of rows in the matrix. * * @return rowDimension */ int getRowDimension(); - + /** * Returns the number of columns in the matrix. * * @return columnDimension */ int getColumnDimension(); - + /** * Returns the * trace of the matrix (the sum of the elements on the main diagonal). @@ -203,7 +203,7 @@ public interface RealMatrix { * @return trace */ double getTrace(); - + /** * Returns the result of multiplying this by the vector v. * @@ -212,7 +212,7 @@ public interface RealMatrix { * @throws IllegalArgumentException if columnDimension != v.size() */ double[] operate(double[] v) throws IllegalArgumentException; - + /** * Returns the (row) vector result of premultiplying this by the vector v. * @@ -220,23 +220,23 @@ public interface RealMatrix { * @return v*this * @throws IllegalArgumentException if rowDimension != v.size() */ - double[] preMultiply(double[] v) throws IllegalArgumentException; - + double[] preMultiply(double[] v) throws IllegalArgumentException; + /** * 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 this.rowDimension != b.length + * @throws IllegalArgumentException if this.rowDimension != b.length * @throws InvalidMatrixException if this matrix is not square or is singular */ double[] solve(double[] b) throws IllegalArgumentException, InvalidMatrixException; - + /** * Returns a matrix of (column) solution vectors for linear systems with * coefficient matrix = this and constant vectors = columns of - * b. + * b. * * @param b matrix of constant vectors forming RHS of linear systems to * to solve diff --git a/src/java/org/apache/commons/math/linear/RealMatrixImpl.java b/src/java/org/apache/commons/math/linear/RealMatrixImpl.java index 1379aff48..01bb5bd7e 100644 --- a/src/java/org/apache/commons/math/linear/RealMatrixImpl.java +++ b/src/java/org/apache/commons/math/linear/RealMatrixImpl.java @@ -1,12 +1,12 @@ /* * Copyright 2003-2004 The Apache Software Foundation. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -20,7 +20,7 @@ import java.io.Serializable; /** * Implementation for RealMatrix using a double[][] array to store entries * and - * LU decompostion to support linear system + * LU decompostion to support linear system * solution and inverse. *

* The LU decompostion is performed as needed, to support the following operations: