Skip to content
Snippets Groups Projects
Commit 73a2fa91 authored by Kitwaii's avatar Kitwaii
Browse files

Changed artifactId name and updated javadoc

parent 50820fb8
No related branches found
No related tags found
No related merge requests found
......@@ -2,4 +2,7 @@
*.jar
.project
.classpath
export.jardesc
\ No newline at end of file
export.jardesc
target/
.idea/
*.iml
\ No newline at end of file
......@@ -4,8 +4,13 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.bioimageanalysis.icy</groupId>
<artifactId>icy-nherve-matrix</artifactId>
<parent>
<artifactId>pom-icy</artifactId>
<groupId>org.bioimageanalysis.icy</groupId>
<version>1.0.4</version>
</parent>
<artifactId>nherve-matrix</artifactId>
<version>1.1</version>
<packaging>jar</packaging>
......@@ -46,32 +51,4 @@
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.bioimageanalysis.icy</groupId>
<artifactId>icy-kernel</artifactId>
<version>2.1.0</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>icy</id>
<url>https://icy-nexus.pasteur.fr/repository/Icy/</url>
</repository>
</repositories>
<distributionManagement>
<snapshotRepository>
<id>icy-dev</id>
<name>icy-dev</name>
<url>https://icy-nexus-dev.pasteur.cloud/repository/icy-core/</url>
</snapshotRepository>
<repository>
<id>icy-prod</id>
<name>icy-prod</name>
<url>https://icy-nexus.pasteur.fr/repository/icy-core/</url>
</repository>
</distributionManagement>
</project>
\ No newline at end of file
......@@ -39,8 +39,7 @@ public class CholeskyDecomposition implements java.io.Serializable {
* ------------------------ */
/** Cholesky algorithm for symmetric and positive definite matrix.
@param A Square, symmetric matrix.
@return Structure to access L and isspd flag.
@param Arg Square, symmetric matrix.
*/
public CholeskyDecomposition (Matrix Arg) {
......
......@@ -858,8 +858,7 @@ public class EigenvalueDecomposition implements java.io.Serializable {
* ------------------------ */
/** Check for symmetry, then construct the eigenvalue decomposition
@param A Square matrix
@return Structure to access D and V.
@param Arg Square matrix
*/
public EigenvalueDecomposition (Matrix Arg) {
......
......@@ -3,10 +3,10 @@ package plugins.nherve.matrix;
/** LU Decomposition.
<P>
For an m-by-n matrix A with m >= n, the LU decomposition is an m-by-n
For an m-by-n matrix A with m &gt;= n, the LU decomposition is an m-by-n
unit lower triangular matrix L, an n-by-n upper triangular matrix U,
and a permutation vector piv of length m so that A(piv,:) = L*U.
If m < n, then L is m-by-m and U is m-by-n.
If m &lt; n, then L is m-by-m and U is m-by-n.
<P>
The LU decompostion with pivoting always exists, even if the matrix is
singular, so the constructor will never fail. The primary use of the
......@@ -45,7 +45,6 @@ public class LUDecomposition implements java.io.Serializable {
/** LU Decomposition
@param A Rectangular matrix
@return Structure to access L, U and piv.
*/
public LUDecomposition (Matrix A) {
......
......@@ -26,13 +26,12 @@ import plugins.nherve.matrix.util.Maths;
* printing matrices are also included. All the operations in this version of
* the Matrix Class involve real matrices. Complex matrices may be handled in a
* future version.
* <P>
*
* Five fundamental matrix decompositions, which consist of pairs or triples of
* matrices, permutation vectors, and the like, produce results in five
* decomposition classes. These decompositions are accessed by the Matrix class
* to compute solutions of simultaneous linear equations, determinants, inverses
* and other matrix functions. The five decompositions are:
* <P>
* <UL>
* <LI>Cholesky Decomposition of symmetric, positive definite matrices.
* <LI>LU Decomposition of rectangular matrices.
......@@ -43,9 +42,7 @@ import plugins.nherve.matrix.util.Maths;
* </UL>
* <DL>
* <DT><B>Example of use:</B></DT>
* <P>
* <DD>Solve a linear system A x = b and compute the residual norm, ||b - A x||.
* <P>
*
* <PRE>
* double[][] vals = { { 1., 2., 3 }, { 4., 5., 6. }, { 7., 8., 10. } };
......@@ -202,7 +199,7 @@ public class Matrix implements Cloneable, java.io.Serializable {
*/
/**
* Construct a matrix from a copy of a 2-D array.
* @return Construct a matrix from a copy of a 2-D array.
*
* @param A
* Two-dimensional array of doubles.
......@@ -227,7 +224,7 @@ public class Matrix implements Cloneable, java.io.Serializable {
}
/**
* Make a deep copy of a matrix
* @return Make a deep copy of a matrix
*/
public Matrix copy() {
......@@ -335,7 +332,7 @@ public class Matrix implements Cloneable, java.io.Serializable {
* @param j
* Column index.
* @return A(i,j)
* @exception ArrayIndexOutOfBoundsException
* @throws ArrayIndexOutOfBoundsException Array out of bounds
*/
public double get(int i, int j) {
......@@ -434,9 +431,9 @@ public class Matrix implements Cloneable, java.io.Serializable {
*
* @param r
* Array of row indices.
* @param i0
* @param j0
* Initial column index
* @param i1
* @param j1
* Final column index
* @return A(r(:),j0:j1)
* @exception ArrayIndexOutOfBoundsException
......@@ -467,7 +464,7 @@ public class Matrix implements Cloneable, java.io.Serializable {
* Column index.
* @param s
* A(i,j).
* @exception ArrayIndexOutOfBoundsException
* @throws ArrayIndexOutOfBoundsException array out of bounds
*/
public void set(int i, int j, double s) {
......@@ -1207,13 +1204,14 @@ public class Matrix implements Cloneable, java.io.Serializable {
}
/**
* Read a matrix from a stream. The format is the same the print method, so
* @return Read a matrix from a stream. The format is the same the print method, so
* printed matrices can be read back in (provided they were printed using US
* Locale). Elements are separated by whitespace, all the elements for each
* row appear on a single line, the last row is followed by a blank line.
*
* @param input
* the input stream.
* @throws java.io.IOException IO Exception
*/
public static Matrix read(BufferedReader input) throws java.io.IOException {
......
......@@ -4,7 +4,7 @@ import plugins.nherve.matrix.util.Maths;
/** QR Decomposition.
<P>
For an m-by-n matrix A with m >= n, the QR decomposition is an m-by-n
For an m-by-n matrix A with m &gt;= n, the QR decomposition is an m-by-n
orthogonal matrix Q and an n-by-n upper triangular matrix R so that
A = Q*R.
<P>
......@@ -45,7 +45,6 @@ public class QRDecomposition implements java.io.Serializable {
/** QR Decomposition, computed by Householder reflections.
@param A Rectangular matrix
@return Structure to access R and the Householder vectors and compute Q.
*/
public QRDecomposition (Matrix A) {
......
......@@ -4,12 +4,12 @@ import plugins.nherve.matrix.util.Maths;
/** Singular Value Decomposition.
<P>
For an m-by-n matrix A with m >= n, the singular value decomposition is
For an m-by-n matrix A with m &gt;= n, the singular value decomposition is
an m-by-n orthogonal matrix U, an n-by-n diagonal matrix S, and
an n-by-n orthogonal matrix V so that A = U*S*V'.
<P>
The singular values, sigma[k] = S[k][k], are ordered so that
sigma[0] >= sigma[1] >= ... >= sigma[n-1].
sigma[0] &gt;= sigma[1] &gt;= ... &gt;= sigma[n-1].
<P>
The singular value decompostion always exists, so the constructor will
never fail. The matrix condition number and the effective numerical
......@@ -46,8 +46,7 @@ public class SingularValueDecomposition implements java.io.Serializable {
* ------------------------ */
/** Construct the singular value decomposition
@param A Rectangular matrix
@return Structure to access U, S and V.
@param Arg Rectangular matrix
*/
public SingularValueDecomposition (Matrix Arg) {
......
package plugins.nherve.matrix.util;
public class Maths {
/** sqrt(a^2 + b^2) without under/overflow. **/
public static double hypot(double a, double b) {
double r;
if (Math.abs(a) > Math.abs(b)) {
r = b/a;
r = Math.abs(a)*Math.sqrt(1+r*r);
} else if (b != 0) {
r = a/b;
r = Math.abs(b)*Math.sqrt(1+r*r);
} else {
r = 0.0;
}
return r;
}
}
package plugins.nherve.matrix.util; public class Maths { /** * @return sqrt(a^2 + b^2) without under/overflow. * @param a double * @param b double * **/ public static double hypot(double a, double b) { double r; if (Math.abs(a) > Math.abs(b)) { r = b/a; r = Math.abs(a)*Math.sqrt(1+r*r); } else if (b != 0) { r = a/b; r = Math.abs(b)*Math.sqrt(1+r*r); } else { r = 0.0; } return r; } }
\ No newline at end of file
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment