📄 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.4.2_05) on Mon Mar 07 15:27:47 NZDT 2005 --><TITLE>Matrix</TITLE><META NAME="keywords" CONTENT="weka.core.Matrix class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){ parent.document.title="Matrix";}</SCRIPT></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=3 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="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="../../../Tutorial.pdf"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="http://www.cs.waikato.ac.nz/ml/weka/index.html"><FONT CLASS="NavBarFont1"><B>Weka's home</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="../../weka/core/Instances.html" title="class in weka.core"><B>PREV CLASS</B></A> <A HREF="../../weka/core/Optimization.html" title="class in weka.core"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.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">weka.core</FONT><BR>Class Matrix</H2><PRE>java.lang.Object <IMG SRC="../../resources/inherit.gif" ALT="extended by"><B>weka.core.Matrix</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD>java.lang.Cloneable, java.io.Serializable</DD></DL><DL><DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../weka/classifiers/evaluation/ConfusionMatrix.html" title="class in weka.classifiers.evaluation">ConfusionMatrix</A>, <A HREF="../../weka/classifiers/CostMatrix.html" title="class in weka.classifiers">CostMatrix</A></DD></DL><HR><DL><DT>public class <B>Matrix</B><DT>extends java.lang.Object<DT>implements java.lang.Cloneable, java.io.Serializable</DL><P>Class for performing operations on a matrix of floating-point values.<P><P><DL><DT><B>Version:</B></DT> <DD>$Revision: 1.18 $</DD><DT><B>Author:</B></DT> <DD>Gabi Schmidberger (gabi@cs.waikato.ac.nz), Yong Wang (yongwang@cs.waikato.ac.nz), Eibe Frank (eibe@cs.waikato.ac.nz), Len Trigg (eibe@cs.waikato.ac.nz)</DD><DT><B>See Also:</B><DD><A HREF="../../serialized-form.html#weka.core.Matrix">Serialized Form</A></DL><HR><P><!-- ======== NESTED CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../weka/core/Matrix.html#Matrix(double[][])">Matrix</A></B>(double[][] array)</CODE><BR> Constructs a matrix using a given array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../weka/core/Matrix.html#Matrix(int, int)">Matrix</A></B>(int nr, int nc)</CODE><BR> Constructs a matrix and initializes it with default values.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../weka/core/Matrix.html#Matrix(java.io.Reader)">Matrix</A></B>(java.io.Reader r)</CODE><BR> Reads a matrix from a reader.</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"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../weka/core/Matrix.html" title="class in weka.core">Matrix</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Matrix.html#add(weka.core.Matrix)">add</A></B>(<A HREF="../../weka/core/Matrix.html" title="class in weka.core">Matrix</A> other)</CODE><BR> Returns the sum of this matrix with another.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Matrix.html#addElement(int, int, double)">addElement</A></B>(int rowIndex, int columnIndex, double value)</CODE><BR> Add a value to an element.</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="../../weka/core/Matrix.html#clone()">clone</A></B>()</CODE><BR> Creates and returns a clone of this object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Matrix.html#eigenvalueDecomposition(double[][], double[])">eigenvalueDecomposition</A></B>(double[][] V, double[] d)</CODE><BR> Performs Eigenvalue Decomposition using Householder QR Factorization This function is adapted from the CERN Jet Java libraries, for it the following copyright applies (see also, text on top of file) Copyright (C) 1999 CERN - European Organization for Nuclear Research.</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="../../weka/core/Matrix.html#getColumn(int)">getColumn</A></B>(int index)</CODE><BR> Gets a column of the matrix and returns it as a double 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="../../weka/core/Matrix.html#getElement(int, int)">getElement</A></B>(int rowIndex, int columnIndex)</CODE><BR> Returns the value of a cell in the matrix.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../weka/core/Matrix.html" title="class in weka.core">Matrix</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Matrix.html#getL()">getL</A></B>()</CODE><BR> Returns the L part of the 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="../../weka/core/Matrix.html#getRow(int)">getRow</A></B>(int index)</CODE><BR> Gets a row of the matrix and returns it as double array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../weka/core/Matrix.html" title="class in weka.core">Matrix</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Matrix.html#getU()">getU</A></B>()</CODE><BR> Returns the U part of the matrix.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Matrix.html#isSymmetric()">isSymmetric</A></B>()</CODE><BR> Returns true if the matrix is symmetric.</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="../../weka/core/Matrix.html#LUDecomposition()">LUDecomposition</A></B>()</CODE><BR> Performs a LUDecomposition on the matrix.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Matrix.html#main(java.lang.String[])">main</A></B>(java.lang.String[] ops)</CODE><BR> Main method for testing this class.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../weka/core/Matrix.html" title="class in weka.core">Matrix</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Matrix.html#multiply(weka.core.Matrix)">multiply</A></B>(<A HREF="../../weka/core/Matrix.html" title="class in weka.core">Matrix</A> b)</CODE><BR> Returns the multiplication of two matrices</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="../../weka/core/Matrix.html#numColumns()">numColumns</A></B>()</CODE><BR> Returns the number of columns in the matrix.</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="../../weka/core/Matrix.html#numRows()">numRows</A></B>()</CODE><BR> Returns the number of rows in the 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="../../weka/core/Matrix.html#regression(weka.core.Matrix, double)">regression</A></B>(<A HREF="../../weka/core/Matrix.html" title="class in weka.core">Matrix</A> y, double ridge)</CODE><BR> Performs a (ridged) linear regression.</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="../../weka/core/Matrix.html#regression(weka.core.Matrix, double[], double)">regression</A></B>(<A HREF="../../weka/core/Matrix.html" title="class in weka.core">Matrix</A> y, double[] w, double ridge)</CODE><BR> Performs a weighted (ridged) linear regression.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Matrix.html#setColumn(int, double[])">setColumn</A></B>(int index, double[] newColumn)</CODE><BR> Sets a column of the matrix to the given column.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Matrix.html#setElement(int, int, double)">setElement</A></B>(int rowIndex, int columnIndex, double value)</CODE><BR> Sets an element of the matrix to the given value.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Matrix.html#setRow(int, double[])">setRow</A></B>(int index, double[] newRow)</CODE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -