📄 utils.html
字号:
</DL><HR><A NAME="sm(double, double)"><!-- --></A><H3>sm</H3><PRE>public static boolean <B>sm</B>(double a, double b)</PRE><DL><DD>Tests if a is smaller than b.<DD><DL><DT><B>Parameters:</B><DD><CODE>a</CODE> - a double<DD><CODE>b</CODE> - a double</DL></DD></DL><HR><A NAME="gr(double, double)"><!-- --></A><H3>gr</H3><PRE>public static boolean <B>gr</B>(double a, double b)</PRE><DL><DD>Tests if a is smaller than b.<DD><DL><DT><B>Parameters:</B><DD><CODE>a</CODE> - a double<DD><CODE>b</CODE> - a double</DL></DD></DL><HR><A NAME="log2(double)"><!-- --></A><H3>log2</H3><PRE>public static double <B>log2</B>(double a)</PRE><DL><DD>Returns the logarithm of a for base 2.<DD><DL><DT><B>Parameters:</B><DD><CODE>a</CODE> - a double</DL></DD></DL><HR><A NAME="maxIndex(double[])"><!-- --></A><H3>maxIndex</H3><PRE>public static int <B>maxIndex</B>(double[] doubles)</PRE><DL><DD>Returns index of maximum element in a given array of doubles. First maximum is returned.<DD><DL><DT><B>Parameters:</B><DD><CODE>doubles</CODE> - the array of doubles<DT><B>Returns:</B><DD>the index of the maximum element</DL></DD></DL><HR><A NAME="maxIndex(int[])"><!-- --></A><H3>maxIndex</H3><PRE>public static int <B>maxIndex</B>(int[] ints)</PRE><DL><DD>Returns index of maximum element in a given array of integers. First maximum is returned.<DD><DL><DT><B>Parameters:</B><DD><CODE>ints</CODE> - the array of integers<DT><B>Returns:</B><DD>the index of the maximum element</DL></DD></DL><HR><A NAME="mean(double[])"><!-- --></A><H3>mean</H3><PRE>public static double <B>mean</B>(double[] vector)</PRE><DL><DD>Computes the mean for an array of doubles.<DD><DL><DT><B>Parameters:</B><DD><CODE>vector</CODE> - the array<DT><B>Returns:</B><DD>the mean</DL></DD></DL><HR><A NAME="minIndex(int[])"><!-- --></A><H3>minIndex</H3><PRE>public static int <B>minIndex</B>(int[] ints)</PRE><DL><DD>Returns index of minimum element in a given array of integers. First minimum is returned.<DD><DL><DT><B>Parameters:</B><DD><CODE>ints</CODE> - the array of integers<DT><B>Returns:</B><DD>the index of the minimum element</DL></DD></DL><HR><A NAME="minIndex(double[])"><!-- --></A><H3>minIndex</H3><PRE>public static int <B>minIndex</B>(double[] doubles)</PRE><DL><DD>Returns index of minimum element in a given array of doubles. First minimum is returned.<DD><DL><DT><B>Parameters:</B><DD><CODE>doubles</CODE> - the array of doubles<DT><B>Returns:</B><DD>the index of the minimum element</DL></DD></DL><HR><A NAME="normalize(double[])"><!-- --></A><H3>normalize</H3><PRE>public static void <B>normalize</B>(double[] doubles)</PRE><DL><DD>Normalizes the doubles in the array by their sum.<DD><DL><DT><B>Parameters:</B><DD><CODE>doubles</CODE> - the array of double<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if sum is Zero or NaN</DL></DD></DL><HR><A NAME="normalize(double[], double)"><!-- --></A><H3>normalize</H3><PRE>public static void <B>normalize</B>(double[] doubles, double sum)</PRE><DL><DD>Normalizes the doubles in the array using the given value.<DD><DL><DT><B>Parameters:</B><DD><CODE>doubles</CODE> - the array of double<DD><CODE>sum</CODE> - the value by which the doubles are to be normalized<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if sum is zero or NaN</DL></DD></DL><HR><A NAME="round(double)"><!-- --></A><H3>round</H3><PRE>public static int <B>round</B>(double value)</PRE><DL><DD>Rounds a double to the next nearest integer value. The JDK version of it doesn't work properly.<DD><DL><DT><B>Parameters:</B><DD><CODE>value</CODE> - the double value<DT><B>Returns:</B><DD>the resulting integer value</DL></DD></DL><HR><A NAME="roundDouble(double, int)"><!-- --></A><H3>roundDouble</H3><PRE>public static double <B>roundDouble</B>(double value, int afterDecimalPoint)</PRE><DL><DD>Rounds a double to the given number of decimal places.<DD><DL><DT><B>Parameters:</B><DD><CODE>value</CODE> - the double value<DD><CODE>afterDecimalPoint</CODE> - the number of digits after the decimal point<DT><B>Returns:</B><DD>the double rounded to the given precision</DL></DD></DL><HR><A NAME="sort(int[])"><!-- --></A><H3>sort</H3><PRE>public static int[] <B>sort</B>(int[] array)</PRE><DL><DD>Sorts a given array of integers in ascending order and returns an array of integers with the positions of the elements of the original array in the sorted array. The sort is stable. (Equal elements remain in their original order.)<DD><DL><DT><B>Parameters:</B><DD><CODE>array</CODE> - this array is not changed by the method!<DT><B>Returns:</B><DD>an array of integers with the positions in the sorted array.</DL></DD></DL><HR><A NAME="sort(double[])"><!-- --></A><H3>sort</H3><PRE>public static int[] <B>sort</B>(double[] array)</PRE><DL><DD>Sorts a given array of doubles in ascending order and returns an array of integers with the positions of the elements of the original array in the sorted array. NOTE THESE CHANGES: the sort is no longer stable and it doesn't use safe floating-point comparisons anymore. Occurrences of Double.NaN are treated as Double.MAX_VALUE<DD><DL><DT><B>Parameters:</B><DD><CODE>array</CODE> - this array is not changed by the method!<DT><B>Returns:</B><DD>an array of integers with the positions in the sorted array.</DL></DD></DL><HR><A NAME="stableSort(double[])"><!-- --></A><H3>stableSort</H3><PRE>public static int[] <B>stableSort</B>(double[] array)</PRE><DL><DD>Sorts a given array of doubles in ascending order and returns an array of integers with the positions of the elements of the original array in the sorted array. The sort is stable (Equal elements remain in their original order.) Occurrences of Double.NaN are treated as Double.MAX_VALUE<DD><DL><DT><B>Parameters:</B><DD><CODE>array</CODE> - this array is not changed by the method!<DT><B>Returns:</B><DD>an array of integers with the positions in the sorted array.</DL></DD></DL><HR><A NAME="variance(double[])"><!-- --></A><H3>variance</H3><PRE>public static double <B>variance</B>(double[] vector)</PRE><DL><DD>Computes the variance for an array of doubles.<DD><DL><DT><B>Parameters:</B><DD><CODE>vector</CODE> - the array<DT><B>Returns:</B><DD>the variance</DL></DD></DL><HR><A NAME="sum(double[])"><!-- --></A><H3>sum</H3><PRE>public static double <B>sum</B>(double[] doubles)</PRE><DL><DD>Computes the sum of the elements of an array of doubles.<DD><DL><DT><B>Parameters:</B><DD><CODE>doubles</CODE> - the array of double</DL></DD></DL><HR><A NAME="sum(int[])"><!-- --></A><H3>sum</H3><PRE>public static int <B>sum</B>(int[] ints)</PRE><DL><DD>Computes the sum of the elements of an array of integers.<DD><DL><DT><B>Parameters:</B><DD><CODE>ints</CODE> - the array of integers</DL></DD></DL><HR><A NAME="xlogx(int)"><!-- --></A><H3>xlogx</H3><PRE>public static double <B>xlogx</B>(int c)</PRE><DL><DD>Returns c*log2(c) for a given integer value c.<DD><DL><DT><B>Parameters:</B><DD><CODE>c</CODE> - an integer value</DL></DD></DL><HR><A NAME="main(java.lang.String[])"><!-- --></A><H3>main</H3><PRE>public static void <B>main</B>(java.lang.String[] ops)</PRE><DL><DD>Main method for testing this class.<DD><DL><DT><B>Parameters:</B><DD><CODE>ops</CODE> - some dummy options</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <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="../../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="../../weka/core/Tag.html"><B>PREV CLASS</B></A> NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="Utils.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | <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><!-- =========== END OF NAVBAR =========== --><HR></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -