?? matrix.html
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.5.0_03) on Wed Jul 13 17:40:27 EDT 2005 -->
<TITLE>
Matrix
</TITLE>
<META NAME="keywords" CONTENT="Jama.Matrix class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="Matrix";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../Jama/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../Jama/LUDecomposition.html" title="class in Jama"><B>PREV CLASS</B></A>
<A HREF="../Jama/QRDecomposition.html" title="class in Jama"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../index.html?Jama/Matrix.html" target="_top"><B>FRAMES</B></A>
<A HREF="Matrix.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
Jama</FONT>
<BR>
Class Matrix</H2>
<PRE>
java.lang.Object
<IMG SRC="../resources/inherit.gif" ALT="extended by "><B>Jama.Matrix</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD>java.io.Serializable, java.lang.Cloneable</DD>
</DL>
<HR>
<DL>
<DT><PRE>public class <B>Matrix</B><DT>extends java.lang.Object<DT>implements java.lang.Cloneable, java.io.Serializable</DL>
</PRE>
<P>
Jama = Java Matrix class.
<P>
The Java Matrix Class provides the fundamental operations of numerical
linear algebra. Various constructors create Matrices from two dimensional
arrays of double precision floating point numbers. Various "gets" and
"sets" provide access to submatrices and matrix elements. Several methods
implement basic matrix arithmetic, including matrix addition and
multiplication, matrix norms, and element-by-element array operations.
Methods for reading and 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.
<LI>QR Decomposition of rectangular matrices.
<LI>Singular Value Decomposition of rectangular matrices.
<LI>Eigenvalue Decomposition of both symmetric and nonsymmetric square matrices.
</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.}};
Matrix A = new Matrix(vals);
Matrix b = Matrix.random(3,1);
Matrix x = A.solve(b);
Matrix r = A.times(x).minus(b);
double rnorm = r.normInf();
</PRE></DD>
</DL>
<P>
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../serialized-form.html#Jama.Matrix">Serialized Form</A></DL>
<HR>
<P>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../Jama/Matrix.html#Matrix(double[][])">Matrix</A></B>(double[][] A)</CODE>
<BR>
Construct a matrix from a 2-D array.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../Jama/Matrix.html#Matrix(double[][], int, int)">Matrix</A></B>(double[][] A,
int m,
int n)</CODE>
<BR>
Construct a matrix quickly without checking arguments.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../Jama/Matrix.html#Matrix(double[], int)">Matrix</A></B>(double[] vals,
int m)</CODE>
<BR>
Construct a matrix from a one-dimensional packed array</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../Jama/Matrix.html#Matrix(int, int)">Matrix</A></B>(int m,
int n)</CODE>
<BR>
Construct an m-by-n matrix of zeros.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../Jama/Matrix.html#Matrix(int, int, double)">Matrix</A></B>(int m,
int n,
double s)</CODE>
<BR>
Construct an m-by-n constant matrix.</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../Jama/Matrix.html" title="class in Jama">Matrix</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../Jama/Matrix.html#arrayLeftDivide(Jama.Matrix)">arrayLeftDivide</A></B>(<A HREF="../Jama/Matrix.html" title="class in Jama">Matrix</A> B)</CODE>
<BR>
Element-by-element left division, C = A.\B</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../Jama/Matrix.html" title="class in Jama">Matrix</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../Jama/Matrix.html#arrayLeftDivideEquals(Jama.Matrix)">arrayLeftDivideEquals</A></B>(<A HREF="../Jama/Matrix.html" title="class in Jama">Matrix</A> B)</CODE>
<BR>
Element-by-element left division in place, A = A.\B</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../Jama/Matrix.html" title="class in Jama">Matrix</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../Jama/Matrix.html#arrayRightDivide(Jama.Matrix)">arrayRightDivide</A></B>(<A HREF="../Jama/Matrix.html" title="class in Jama">Matrix</A> B)</CODE>
<BR>
Element-by-element right division, C = A./B</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../Jama/Matrix.html" title="class in Jama">Matrix</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../Jama/Matrix.html#arrayRightDivideEquals(Jama.Matrix)">arrayRightDivideEquals</A></B>(<A HREF="../Jama/Matrix.html" title="class in Jama">Matrix</A> B)</CODE>
<BR>
Element-by-element right division in place, A = A./B</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../Jama/Matrix.html" title="class in Jama">Matrix</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../Jama/Matrix.html#arrayTimes(Jama.Matrix)">arrayTimes</A></B>(<A HREF="../Jama/Matrix.html" title="class in Jama">Matrix</A> B)</CODE>
<BR>
Element-by-element multiplication, C = A.*B</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../Jama/Matrix.html" title="class in Jama">Matrix</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../Jama/Matrix.html#arrayTimesEquals(Jama.Matrix)">arrayTimesEquals</A></B>(<A HREF="../Jama/Matrix.html" title="class in Jama">Matrix</A> B)</CODE>
<BR>
Element-by-element multiplication in place, A = A.*B</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../Jama/CholeskyDecomposition.html" title="class in Jama">CholeskyDecomposition</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../Jama/Matrix.html#chol()">chol</A></B>()</CODE>
<BR>
Cholesky Decomposition</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.Object</CODE></FONT></TD>
<TD><CODE><B><A HREF="../Jama/Matrix.html#clone()">clone</A></B>()</CODE>
<BR>
Clone the Matrix object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../Jama/Matrix.html#cond()">cond</A></B>()</CODE>
<BR>
Matrix condition (2 norm)</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../Jama/Matrix.html" title="class in Jama">Matrix</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../Jama/Matrix.html#constructWithCopy(double[][])">constructWithCopy</A></B>(double[][] A)</CODE>
<BR>
Construct a matrix from a copy of a 2-D array.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../Jama/Matrix.html" title="class in Jama">Matrix</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../Jama/Matrix.html#copy()">copy</A></B>()</CODE>
<BR>
Make a deep copy of a matrix</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../Jama/Matrix.html#det()">det</A></B>()</CODE>
<BR>
Matrix determinant</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../Jama/EigenvalueDecomposition.html" title="class in Jama">EigenvalueDecomposition</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../Jama/Matrix.html#eig()">eig</A></B>()</CODE>
<BR>
Eigenvalue Decomposition</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../Jama/Matrix.html#get(int, int)">get</A></B>(int i,
int j)</CODE>
<BR>
Get a single element.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> double[][]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../Jama/Matrix.html#getArray()">getArray</A></B>()</CODE>
<BR>
Access the internal two-dimensional array.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> double[][]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../Jama/Matrix.html#getArrayCopy()">getArrayCopy</A></B>()</CODE>
<BR>
Copy the internal two-dimensional array.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../Jama/Matrix.html#getColumnDimension()">getColumnDimension</A></B>()</CODE>
<BR>
Get column dimension.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> double[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../Jama/Matrix.html#getColumnPackedCopy()">getColumnPackedCopy</A></B>()</CODE>
<BR>
Make a one-dimensional column packed copy of the internal array.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../Jama/Matrix.html" title="class in Jama">Matrix</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../Jama/Matrix.html#getMatrix(int[], int[])">getMatrix</A></B>(int[] r,
int[] c)</CODE>
<BR>
Get a submatrix.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../Jama/Matrix.html" title="class in Jama">Matrix</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../Jama/Matrix.html#getMatrix(int[], int, int)">getMatrix</A></B>(int[] r,
int j0,
int j1)</CODE>
<BR>
Get a submatrix.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../Jama/Matrix.html" title="class in Jama">Matrix</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../Jama/Matrix.html#getMatrix(int, int, int[])">getMatrix</A></B>(int i0,
int i1,
int[] c)</CODE>
<BR>
Get a submatrix.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -