⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 matrix.html

📁 weka是机器学习和数据挖掘领域最有影响力的开源项目之一
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<!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_10) on Fri Jan 26 16:34:50 NZDT 2007 --><TITLE>Matrix</TITLE><META NAME="keywords" CONTENT="weka.core.matrix.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="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="http://www.cs.waikato.ac.nz/ml/weka/" target="_blank"><FONT CLASS="NavBarFont1"><B>Weka's home</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../../weka/core/matrix/Maths.html" title="class in weka.core.matrix"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../weka/core/matrix/QRDecomposition.html" title="class in weka.core.matrix"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../index.html?weka/core/matrix/Matrix.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="Matrix.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;&nbsp;<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:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<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">weka.core.matrix</FONT><BR>Class Matrix</H2><PRE>java.lang.Object  <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>weka.core.matrix.Matrix</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD>java.io.Serializable, java.lang.Cloneable</DD></DL><DL><DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../weka/classifiers/functions/pace/PaceMatrix.html" title="class in weka.classifiers.functions.pace">PaceMatrix</A></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/> Adapted from the <a href="http://math.nist.gov/javanumerics/jama/" target="_blank">JAMA</a> package. Additional methods are tagged with the  <code>@author</code> tag.<P><P><DL><DT><B>Version:</B></DT>  <DD>$Revision: 1.6 $</DD><DT><B>Author:</B></DT>  <DD>The Mathworks and NIST, Fracpete (fracpete at waikato dot ac dot nz)</DD><DT><B>See Also:</B><DD><A HREF="../../../serialized-form.html#weka.core.matrix.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="../../../weka/core/matrix/Matrix.html#Matrix(double[][])">Matrix</A></B>(double[][]&nbsp;A)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Construct a matrix from a 2-D array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../weka/core/matrix/Matrix.html#Matrix(double[][], int, int)">Matrix</A></B>(double[][]&nbsp;A,       int&nbsp;m,       int&nbsp;n)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Construct a matrix quickly without checking arguments.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../weka/core/matrix/Matrix.html#Matrix(double[], int)">Matrix</A></B>(double[]&nbsp;vals,       int&nbsp;m)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Construct a matrix from a one-dimensional packed array</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../weka/core/matrix/Matrix.html#Matrix(int, int)">Matrix</A></B>(int&nbsp;m,       int&nbsp;n)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Construct an m-by-n matrix of zeros.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../weka/core/matrix/Matrix.html#Matrix(int, int, double)">Matrix</A></B>(int&nbsp;m,       int&nbsp;n,       double&nbsp;s)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Construct an m-by-n constant matrix.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../weka/core/matrix/Matrix.html#Matrix(java.io.Reader)">Matrix</A></B>(java.io.Reader&nbsp;r)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reads a matrix from a reader.</TD></TR></TABLE>&nbsp;<!-- ========== 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>&nbsp;<A HREF="../../../weka/core/matrix/Matrix.html" title="class in weka.core.matrix">Matrix</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/core/matrix/Matrix.html#arrayLeftDivide(weka.core.matrix.Matrix)">arrayLeftDivide</A></B>(<A HREF="../../../weka/core/matrix/Matrix.html" title="class in weka.core.matrix">Matrix</A>&nbsp;B)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;<A HREF="../../../weka/core/matrix/Matrix.html" title="class in weka.core.matrix">Matrix</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/core/matrix/Matrix.html#arrayLeftDivideEquals(weka.core.matrix.Matrix)">arrayLeftDivideEquals</A></B>(<A HREF="../../../weka/core/matrix/Matrix.html" title="class in weka.core.matrix">Matrix</A>&nbsp;B)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;<A HREF="../../../weka/core/matrix/Matrix.html" title="class in weka.core.matrix">Matrix</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/core/matrix/Matrix.html#arrayRightDivide(weka.core.matrix.Matrix)">arrayRightDivide</A></B>(<A HREF="../../../weka/core/matrix/Matrix.html" title="class in weka.core.matrix">Matrix</A>&nbsp;B)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;<A HREF="../../../weka/core/matrix/Matrix.html" title="class in weka.core.matrix">Matrix</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/core/matrix/Matrix.html#arrayRightDivideEquals(weka.core.matrix.Matrix)">arrayRightDivideEquals</A></B>(<A HREF="../../../weka/core/matrix/Matrix.html" title="class in weka.core.matrix">Matrix</A>&nbsp;B)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;<A HREF="../../../weka/core/matrix/Matrix.html" title="class in weka.core.matrix">Matrix</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/core/matrix/Matrix.html#arrayTimes(weka.core.matrix.Matrix)">arrayTimes</A></B>(<A HREF="../../../weka/core/matrix/Matrix.html" title="class in weka.core.matrix">Matrix</A>&nbsp;B)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;<A HREF="../../../weka/core/matrix/Matrix.html" title="class in weka.core.matrix">Matrix</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/core/matrix/Matrix.html#arrayTimesEquals(weka.core.matrix.Matrix)">arrayTimesEquals</A></B>(<A HREF="../../../weka/core/matrix/Matrix.html" title="class in weka.core.matrix">Matrix</A>&nbsp;B)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;<A HREF="../../../weka/core/matrix/CholeskyDecomposition.html" title="class in weka.core.matrix">CholeskyDecomposition</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/core/matrix/Matrix.html#chol()">chol</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Cholesky Decomposition</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;java.lang.Object</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/core/matrix/Matrix.html#clone()">clone</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Clone the Matrix object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;double</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/core/matrix/Matrix.html#cond()">cond</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Matrix condition (2 norm)</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../../../weka/core/matrix/Matrix.html" title="class in weka.core.matrix">Matrix</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/core/matrix/Matrix.html#constructWithCopy(double[][])">constructWithCopy</A></B>(double[][]&nbsp;A)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;<A HREF="../../../weka/core/matrix/Matrix.html" title="class in weka.core.matrix">Matrix</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/core/matrix/Matrix.html#copy()">copy</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;double</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/core/matrix/Matrix.html#det()">det</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Matrix determinant</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../weka/core/matrix/EigenvalueDecomposition.html" title="class in weka.core.matrix">EigenvalueDecomposition</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/core/matrix/Matrix.html#eig()">eig</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Eigenvalue Decomposition</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;double</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/core/matrix/Matrix.html#get(int, int)">get</A></B>(int&nbsp;i,    int&nbsp;j)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get a single element.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;double[][]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/core/matrix/Matrix.html#getArray()">getArray</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Access the internal two-dimensional array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;double[][]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/core/matrix/Matrix.html#getArrayCopy()">getArrayCopy</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Copy the internal two-dimensional array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/core/matrix/Matrix.html#getColumnDimension()">getColumnDimension</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get column dimension.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -