📄 discretefunction.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_04) on Tue Jun 22 19:42:08 EDT 2004 --><TITLE>DiscreteFunction (JavaBayes API)</TITLE><META NAME="keywords" CONTENT="BayesianNetworks.DiscreteFunction class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){ parent.document.title="DiscreteFunction (JavaBayes API)";}</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="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>JavaBayes API</EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../BayesianNetworks/ConvertInterchangeFormat.html" title="class in BayesianNetworks"><B>PREV CLASS</B></A> <A HREF="../BayesianNetworks/DiscreteVariable.html" title="class in BayesianNetworks"><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="DiscreteFunction.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">BayesianNetworks</FONT><BR>Class DiscreteFunction</H2><PRE>java.lang.Object <IMG SRC="../resources/inherit.gif" ALT="extended by"><B>BayesianNetworks.DiscreteFunction</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD>java.io.Serializable</DD></DL><DL><DT><B>Direct Known Subclasses:</B> <DD><A HREF="../BayesianNetworks/ProbabilityFunction.html" title="class in BayesianNetworks">ProbabilityFunction</A></DD></DL><HR><DL><DT>public class <B>DiscreteFunction</B><DT>extends java.lang.Object<DT>implements java.io.Serializable</DL><P><DL><DT><B>See Also:</B><DD><A HREF="../serialized-form.html#BayesianNetworks.DiscreteFunction">Serialized Form</A></DL><HR><P><!-- ======== NESTED CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Field Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected double[]</CODE></FONT></TD><TD><CODE><B><A HREF="../BayesianNetworks/DiscreteFunction.html#values">values</A></B></CODE><BR> </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected <A HREF="../BayesianNetworks/DiscreteVariable.html" title="class in BayesianNetworks">DiscreteVariable</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../BayesianNetworks/DiscreteFunction.html#variables">variables</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"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../BayesianNetworks/DiscreteFunction.html#DiscreteFunction()">DiscreteFunction</A></B>()</CODE><BR> Default constructor for a DiscreteFunction.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../BayesianNetworks/DiscreteFunction.html#DiscreteFunction(BayesianNetworks.DiscreteVariable[], double[])">DiscreteFunction</A></B>(<A HREF="../BayesianNetworks/DiscreteVariable.html" title="class in BayesianNetworks">DiscreteVariable</A>[] pvs, double[] v)</CODE><BR> Simple constructor for DiscreteFunction.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../BayesianNetworks/DiscreteFunction.html#DiscreteFunction(int, int)">DiscreteFunction</A></B>(int n_vb, int n_vl)</CODE><BR> Simple constructor for DiscreteFunction.</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> double</CODE></FONT></TD><TD><CODE><B><A HREF="../BayesianNetworks/DiscreteFunction.html#evaluate(BayesianNetworks.DiscreteVariable[], int[])">evaluate</A></B>(<A HREF="../BayesianNetworks/DiscreteVariable.html" title="class in BayesianNetworks">DiscreteVariable</A>[] pvs, int[] value_indexes)</CODE><BR> Evaluate a function given a (possibly partial) instantiation of variables through the indexes.</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="../BayesianNetworks/DiscreteFunction.html#get_index(int)">get_index</A></B>(int ind)</CODE><BR> Get a DiscreteVariable object with a particular index.</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="../BayesianNetworks/DiscreteFunction.html#get_indexes()">get_indexes</A></B>()</CODE><BR> Get an array with all the indexes of the DiscreteVariable objects in the current DiscreteFunction.</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="../BayesianNetworks/DiscreteFunction.html#get_position_from_indexes(BayesianNetworks.DiscreteVariable[], int[])">get_position_from_indexes</A></B>(<A HREF="../BayesianNetworks/DiscreteVariable.html" title="class in BayesianNetworks">DiscreteVariable</A>[] pvs, int[] variable_indexes)</CODE><BR> Get position in a function from a (possibly partial) instantiation of variables through the indexes.</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="../BayesianNetworks/DiscreteFunction.html#get_value(int)">get_value</A></B>(int index)</CODE><BR> Get a value of the current DiscreteFunction given the position of the value in the array of values.</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="../BayesianNetworks/DiscreteFunction.html#get_values()">get_values</A></B>()</CODE><BR> Get all values of the current DiscreteFunction.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../BayesianNetworks/DiscreteVariable.html" title="class in BayesianNetworks">DiscreteVariable</A></CODE></FONT></TD><TD><CODE><B><A HREF="../BayesianNetworks/DiscreteFunction.html#get_variable(int)">get_variable</A></B>(int index)</CODE><BR> Get a variable in the current DiscreteFunction.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../BayesianNetworks/DiscreteVariable.html" title="class in BayesianNetworks">DiscreteVariable</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../BayesianNetworks/DiscreteFunction.html#get_variables()">get_variables</A></B>()</CODE><BR> Get the variables in the current DiscreteFunction.</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="../BayesianNetworks/DiscreteFunction.html#memberOf(int)">memberOf</A></B>(int index)</CODE><BR> Check whether an index is present in the function.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../BayesianNetworks/DiscreteFunction.html" title="class in BayesianNetworks">DiscreteFunction</A></CODE></FONT></TD><TD><CODE><B><A HREF="../BayesianNetworks/DiscreteFunction.html#multiply(BayesianNetworks.DiscreteVariable[], BayesianNetworks.DiscreteFunction)">multiply</A></B>(<A HREF="../BayesianNetworks/DiscreteVariable.html" title="class in BayesianNetworks">DiscreteVariable</A>[] dvs, <A HREF="../BayesianNetworks/DiscreteFunction.html" title="class in BayesianNetworks">DiscreteFunction</A> mult)</CODE><BR> Multiply two DiscreteFunction objects.</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="../BayesianNetworks/DiscreteFunction.html#normalize_first()">normalize_first</A></B>()</CODE><BR> Normalize a function (in-place) assuming that it is a conditional distribution for the first variable</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="../BayesianNetworks/DiscreteFunction.html#normalize()">normalize</A></B>()</CODE><BR> Normalize a function (in-place).</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="../BayesianNetworks/DiscreteFunction.html#number_values()">number_values</A></B>()</CODE><BR> Return the number of values in the current DiscreteFunction.</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="../BayesianNetworks/DiscreteFunction.html#number_variables()">number_variables</A></B>()</CODE><BR> Return the number of DiscreteVariable objects in the current DiscreteFunction.</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="../BayesianNetworks/DiscreteFunction.html#print()">print</A></B>()</CODE><BR> Print method for DiscreteFunction.</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="../BayesianNetworks/DiscreteFunction.html#print(java.io.PrintStream)">print</A></B>(java.io.PrintStream out)</CODE><BR> Print method for DiscreteFunction into a PrintStream.</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="../BayesianNetworks/DiscreteFunction.html#set_value(int, double)">set_value</A></B>(int index, double v)</CODE><BR> Set a value in the current DiscreteFunction given its position in the array of values.</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="../BayesianNetworks/DiscreteFunction.html#set_values(double[])">set_values</A></B>(double[] vs)</CODE><BR> Set the values in the DiscreteFunction.</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="../BayesianNetworks/DiscreteFunction.html#set_variable(int, BayesianNetworks.DiscreteVariable)">set_variable</A></B>(int index, <A HREF="../BayesianNetworks/DiscreteVariable.html" title="class in BayesianNetworks">DiscreteVariable</A> dv)</CODE><BR> Set a DiscreteVariable in the current DiscreteFunction given its position in the array of values.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../BayesianNetworks/DiscreteFunction.html" title="class in BayesianNetworks">DiscreteFunction</A></CODE></FONT></TD><TD><CODE><B><A HREF="../BayesianNetworks/DiscreteFunction.html#sum_out(BayesianNetworks.DiscreteVariable[], boolean[])">sum_out</A></B>(<A HREF="../BayesianNetworks/DiscreteVariable.html" title="class in BayesianNetworks">DiscreteVariable</A>[] dvs, boolean[] markers)</CODE><BR> Sum out some variables in the function.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.Object</B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD></TR></TABLE><A NAME="variables"><!-- --></A><H3>variables</H3><PRE>protected <A HREF="../BayesianNetworks/DiscreteVariable.html" title="class in BayesianNetworks">DiscreteVariable</A>[] <B>variables</B></PRE><DL><DL></DL></DL><HR><A NAME="values"><!-- --></A><H3>values</H3><PRE>protected double[] <B>values</B></PRE><DL><DL></DL></DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="DiscreteFunction()"><!-- --></A><H3>DiscreteFunction</H3><PRE>public <B>DiscreteFunction</B>()</PRE><DL><DD>Default constructor for a DiscreteFunction.<P></DL><HR><A NAME="DiscreteFunction(int, int)"><!-- --></A><H3>DiscreteFunction</H3><PRE>public <B>DiscreteFunction</B>(int n_vb, int n_vl)</PRE><DL><DD>Simple constructor for DiscreteFunction.<P><DT><B>Parameters:</B><DD><CODE>n_vb</CODE> - Number of variables in the function.<DD><CODE>n_vl</CODE> - Number of values in the function.</DL><HR><A NAME="DiscreteFunction(BayesianNetworks.DiscreteVariable[], double[])"><!-- --></A><H3>DiscreteFunction</H3>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -