📄 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.6.0_01) on Mon Jul 30 16:05:53 CEST 2007 -->
<TITLE>
Matrix (Java Machine Learning Library 0.0.11)
</TITLE>
<META NAME="date" CONTENT="2007-07-30">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Matrix (Java Machine Learning Library 0.0.11)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= 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="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="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="class-use/Matrix.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </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="../../../../gov/nist/math/jama/LUDecomposition.html" title="class in gov.nist.math.jama"><B>PREV CLASS</B></A>
<A HREF="../../../../gov/nist/math/jama/QRDecomposition.html" title="class in gov.nist.math.jama"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?gov/nist/math/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">
gov.nist.math.jama</FONT>
<BR>
Class Matrix</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>gov.nist.math.jama.Matrix</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD>java.lang.Cloneable</DD>
</DL>
<HR>
<DL>
<DT><PRE>public class <B>Matrix</B><DT>extends java.lang.Object<DT>implements java.lang.Cloneable</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>Version:</B></DT>
<DD>5 August 1998</DD>
<DT><B>Author:</B></DT>
<DD>The MathWorks, Inc. and the National Institute of Standards and Technology.</DD>
</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="../../../../gov/nist/math/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="../../../../gov/nist/math/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="../../../../gov/nist/math/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="../../../../gov/nist/math/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="../../../../gov/nist/math/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="../../../../gov/nist/math/jama/Matrix.html" title="class in gov.nist.math.jama">Matrix</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../gov/nist/math/jama/Matrix.html#arrayLeftDivide(gov.nist.math.jama.Matrix)">arrayLeftDivide</A></B>(<A HREF="../../../../gov/nist/math/jama/Matrix.html" title="class in gov.nist.math.jama">Matrix</A> B)</CODE>
<BR>
Element-by-element left division, C = A.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../gov/nist/math/jama/Matrix.html" title="class in gov.nist.math.jama">Matrix</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../gov/nist/math/jama/Matrix.html#arrayLeftDivideEquals(gov.nist.math.jama.Matrix)">arrayLeftDivideEquals</A></B>(<A HREF="../../../../gov/nist/math/jama/Matrix.html" title="class in gov.nist.math.jama">Matrix</A> B)</CODE>
<BR>
Element-by-element left division in place, A = A.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../gov/nist/math/jama/Matrix.html" title="class in gov.nist.math.jama">Matrix</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../gov/nist/math/jama/Matrix.html#arrayRightDivide(gov.nist.math.jama.Matrix)">arrayRightDivide</A></B>(<A HREF="../../../../gov/nist/math/jama/Matrix.html" title="class in gov.nist.math.jama">Matrix</A> B)</CODE>
<BR>
Element-by-element right division, C = A.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../gov/nist/math/jama/Matrix.html" title="class in gov.nist.math.jama">Matrix</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../gov/nist/math/jama/Matrix.html#arrayRightDivideEquals(gov.nist.math.jama.Matrix)">arrayRightDivideEquals</A></B>(<A HREF="../../../../gov/nist/math/jama/Matrix.html" title="class in gov.nist.math.jama">Matrix</A> B)</CODE>
<BR>
Element-by-element right division in place, A = A.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../gov/nist/math/jama/Matrix.html" title="class in gov.nist.math.jama">Matrix</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../gov/nist/math/jama/Matrix.html#arrayTimes(gov.nist.math.jama.Matrix)">arrayTimes</A></B>(<A HREF="../../../../gov/nist/math/jama/Matrix.html" title="class in gov.nist.math.jama">Matrix</A> B)</CODE>
<BR>
Element-by-element multiplication, C = A.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../gov/nist/math/jama/Matrix.html" title="class in gov.nist.math.jama">Matrix</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../gov/nist/math/jama/Matrix.html#arrayTimesEquals(gov.nist.math.jama.Matrix)">arrayTimesEquals</A></B>(<A HREF="../../../../gov/nist/math/jama/Matrix.html" title="class in gov.nist.math.jama">Matrix</A> B)</CODE>
<BR>
Element-by-element multiplication in place, A = A.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../gov/nist/math/jama/CholeskyDecomposition.html" title="class in gov.nist.math.jama">CholeskyDecomposition</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../gov/nist/math/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="../../../../gov/nist/math/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="../../../../gov/nist/math/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="../../../../gov/nist/math/jama/Matrix.html" title="class in gov.nist.math.jama">Matrix</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../gov/nist/math/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="../../../../gov/nist/math/jama/Matrix.html" title="class in gov.nist.math.jama">Matrix</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../gov/nist/math/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="../../../../gov/nist/math/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="../../../../gov/nist/math/jama/EigenvalueDecomposition.html" title="class in gov.nist.math.jama">EigenvalueDecomposition</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../gov/nist/math/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="../../../../gov/nist/math/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="../../../../gov/nist/math/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="../../../../gov/nist/math/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="../../../../gov/nist/math/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="../../../../gov/nist/math/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">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -