📄 vectors.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:54 CEST 2007 -->
<TITLE>
Vectors (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="Vectors (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/Vectors.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="../../../../../net/sf/javaml/clustering/mcl/SparseVector.html" title="class in net.sf.javaml.clustering.mcl"><B>PREV CLASS</B></A>
NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?net/sf/javaml/clustering/mcl/Vectors.html" target="_top"><B>FRAMES</B></A>
<A HREF="Vectors.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 | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <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">
net.sf.javaml.clustering.mcl</FONT>
<BR>
Class Vectors</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>net.sf.javaml.clustering.mcl.Vectors</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>Vectors</B><DT>extends java.lang.Object</DL>
</PRE>
<P>
Static vector manipulation routines for Matlab porting and other numeric operations. The routines work for int and double partly; the class is extended as needed. <p> TODO: The question remains whether it makes sense to have a formal IntVector, analoguous to IntMatrix that allows performing search and indexing operations, such as views, etc.
<P>
<P>
<DL>
<DT><B>Author:</B></DT>
<DD>heinrich</DD>
</DL>
<HR>
<P>
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_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>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../net/sf/javaml/clustering/mcl/Vectors.html#colwidth">colwidth</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../net/sf/javaml/clustering/mcl/Vectors.html#ndigits">ndigits</A></B></CODE>
<BR>
</TD>
</TR>
</TABLE>
<!-- ======== 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="../../../../../net/sf/javaml/clustering/mcl/Vectors.html#Vectors()">Vectors</A></B>()</CODE>
<BR>
</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>static void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../net/sf/javaml/clustering/mcl/Vectors.html#add(int[], int)">add</A></B>(int[] vec,
int scalar)</CODE>
<BR>
add a scalar to the vector</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../net/sf/javaml/clustering/mcl/Vectors.html#cast(double[])">cast</A></B>(double[] vec)</CODE>
<BR>
cast a double[] to an int[]</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static double[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../net/sf/javaml/clustering/mcl/Vectors.html#cast(int[])">cast</A></B>(int[] vec)</CODE>
<BR>
cast a double[] to an int[]</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static double[][]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../net/sf/javaml/clustering/mcl/Vectors.html#chooseElements(double[][], int[], int[])">chooseElements</A></B>(double[][] matrix,
int[] rows,
int[] cols)</CODE>
<BR>
Create a matrix that contains the rows and columns of the argument matrix in the order given by rows and cols</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static double[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../net/sf/javaml/clustering/mcl/Vectors.html#chooseElements(double[], int[])">chooseElements</A></B>(double[] vector,
int[] keep)</CODE>
<BR>
Create vector that contains the elements of the argument in the order as given by keep</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int[][]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../net/sf/javaml/clustering/mcl/Vectors.html#chooseElements(int[][], int[], int[])">chooseElements</A></B>(int[][] matrix,
int[] rows,
int[] cols)</CODE>
<BR>
Create a matrix that contains the rows and columns of the argument matrix in the order given by rows and cols</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../net/sf/javaml/clustering/mcl/Vectors.html#chooseElements(int[], int[])">chooseElements</A></B>(int[] vector,
int[] keep)</CODE>
<BR>
Create vector that contains the elements of the argument in the order as given by keep</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static double[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../net/sf/javaml/clustering/mcl/Vectors.html#concat(double[], double[])">concat</A></B>(double[] x,
double[] y)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static double[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../net/sf/javaml/clustering/mcl/Vectors.html#concat(double[], double[], double[])">concat</A></B>(double[] x,
double[] y,
double[] z)</CODE>
<BR>
w = [x y z]</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static double[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../net/sf/javaml/clustering/mcl/Vectors.html#copy(double[])">copy</A></B>(double[] source)</CODE>
<BR>
copies a the source to the destination</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../net/sf/javaml/clustering/mcl/Vectors.html#copy(int[])">copy</A></B>(int[] source)</CODE>
<BR>
copies a the source to the destination</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static double[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../net/sf/javaml/clustering/mcl/Vectors.html#cumsum(double[])">cumsum</A></B>(double[] vec)</CODE>
<BR>
cumulative sum of the elements, starting at element 0.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../net/sf/javaml/clustering/mcl/Vectors.html#find(int[], int)">find</A></B>(int[] vec,
int val)</CODE>
<BR>
find indices with val</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static double[][]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../net/sf/javaml/clustering/mcl/Vectors.html#increaseSize(double[][], int, int)">increaseSize</A></B>(double[][] matrix,
int morerows,
int morecols)</CODE>
<BR>
Create new matrix of larger size and data of the argument.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static double[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../net/sf/javaml/clustering/mcl/Vectors.html#increaseSize(double[], int)">increaseSize</A></B>(double[] vector,
int moreelements)</CODE>
<BR>
Create new vector of larger size and data of the argument.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int[][]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../net/sf/javaml/clustering/mcl/Vectors.html#increaseSize(int[][], int, int)">increaseSize</A></B>(int[][] matrix,
int morerows,
int morecols)</CODE>
<BR>
Create new matrix of larger size and data of the argument.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../net/sf/javaml/clustering/mcl/Vectors.html#increaseSize(int[], int)">increaseSize</A></B>(int[] vector,
int moreelements)</CODE>
<BR>
Create new vector of larger size and data of the argument.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../net/sf/javaml/clustering/mcl/Vectors.html#max(double[])">max</A></B>(double[] vec)</CODE>
<BR>
maximum value in vec</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../net/sf/javaml/clustering/mcl/Vectors.html#max(int[])">max</A></B>(int[] vec)</CODE>
<BR>
maximum value in vec</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../net/sf/javaml/clustering/mcl/Vectors.html#min(double[])">min</A></B>(double[] vec)</CODE>
<BR>
minimum value in vec</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../net/sf/javaml/clustering/mcl/Vectors.html#min(int[])">min</A></B>(int[] vec)</CODE>
<BR>
minimum value in vec</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static double[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../net/sf/javaml/clustering/mcl/Vectors.html#mult(double[], double)">mult</A></B>(double[] ds,
double d)</CODE>
<BR>
multiplicates the vector with a scalar.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../net/sf/javaml/clustering/mcl/Vectors.html#mult(double[], double[])">mult</A></B>(double[] ds,
double[] dt)</CODE>
<BR>
multiplicates the vector with a vector (inner product).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../net/sf/javaml/clustering/mcl/Vectors.html#ones(int)">ones</A></B>(int len)</CODE>
<BR>
</TD>
</TR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -