亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? catgraph.java

?? 自己編的ID3算法很小但效果很好
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
package id3;
import java.io.*;
import java.util.*;
import shared.*;
import shared.Error;

/** CatGraph is a directed graph whose nodes have references to Categorizers.
 * Edges are labelled with the category number they match. The CatGraph can be
 * either complete or sparse. This is decided at the time of creation and
 * cannot be changed thereafter.								<P>
 *
 * For complete graphs:									<P>
 * Each node's first edge must be labelled either UNKNOWN_CATEGORY_VAL or
 * FIRST_CATEGORY_VAL. Each additional edge must be labelled with the next
 * category in ascending order.								<P>
 *
 * For sparse graphs:									<P>
 * A node may have zero or more children. Detection of a child can be done
 * using the get_child_if_exists() function, which returns a reference to the
 * child node if it exists, and otherwise returns a NULL reference.            <P>
 *
 * @author James Louis	2/25/2001	Ported to Java.
 * @author Jay DeSouza	8/13/97	Added handling for sparse graphs
 * @author Richard Long	8/20/93	Initial revision (.c)
 * @author Richard Long	8/19/93	Initial revision (.h)
 */
public class CatGraph {
    /** The CGraph object containing the graph used for this CatGraph.
     */
    protected CGraph cGraph;
    /** TRUE if the graph is allocated, FALSE if the graph is set to NULL.
     */
    boolean graphAlloc;
    /** TRUE if the graph is sparsely generated.
     */
    boolean isSparse;
    /** Logging options for this class.
     */
    protected LogOptions logOptions = new LogOptions();
    /** Distribution display help string.
     */
    protected String distDispHelp = "This option specifies whether to display the "+
    "distribution of instances of the nodes in the graph while displaying. ";
    /** The default value for distribution display. The default is FALSE.
     */
    protected boolean defaultDistDisp = false;
    
    
    /** Sets the logging level for this object.
     * @param level	The new logging level.
     */
    public void set_log_level(int level){logOptions.set_log_level(level);}
    
    /** Returns the logging level for this object.
     * @return The logging level for this object.
     */
    public int  get_log_level(){return logOptions.get_log_level();}
    
    /** Sets the stream to which logging options are displayed.
     * @param strm	The stream to which logs will be written.
     */
    public void set_log_stream(Writer strm)
    {logOptions.set_log_stream(strm);}
    
    /** Returns the stream to which logs for this object are written.
     * @return The stream to which logs for this object are written.
     */
    public Writer get_log_stream(){return logOptions.get_log_stream();}
    
    /** Returns the LogOptions object for this object.
     * @return The LogOptions object for this object.
     */
    public LogOptions get_log_options(){return logOptions;}
    
    /** Sets the LogOptions object for this object.
     * @param opt	The new LogOptions object.
     */
    public void set_log_options(LogOptions opt)
    {logOptions.set_log_options(opt);}
    
    /** Sets the logging message prefix for this object.
     * @param file	The file name to be displayed in the prefix of log messages.
     * @param line	The line number to be displayed in the prefix of log messages.
     * @param lvl1 The log level of the statement being logged.
     * @param lvl2	The level of log messages being displayed.
     */
    public void set_log_prefixes(String file, int line,int lvl1, int lvl2)
    {logOptions.set_log_prefixes(file, line, lvl1, lvl2);}
    
    /** Constructor.
     * @param isGraphSparse	TRUE if this CatGraph is sparsely populated. FALSE
     * otherwise.
     */
    public CatGraph(boolean isGraphSparse) {
        cGraph = new CGraph();
        isSparse = isGraphSparse;
        graphAlloc = true;
        logOptions = new LogOptions();
        logOptions.LOG(3, "CatGraph::CatGraph(Bool isGraphSparse): isSparse = "
        + isSparse + " is_sparse() = " + is_sparse() + '\n');
    }
    
    /** Constructor.
     * @param aGraph		CGraph on which all operations will take place. It
     * should remain unchanged while a part of this
     * CatGraph object.
     * @param isGraphSparse	TRUE if this CatGraph is sparsely populated. FALSE
     * otherwise.
     */
    public CatGraph(CGraph aGraph, boolean isGraphSparse) {
        cGraph = aGraph;
        isSparse = isGraphSparse;
        graphAlloc = false;
        logOptions = new LogOptions();
        logOptions.LOG(6, "CatGraph::CatGraph(CGraph, Bool): isSparse = "
        + isSparse + " is_sparse() = " + is_sparse() + '\n');
    }
    
    /** Checks if this CatGraph is sparsely populated.
     * @return TRUE if this CatGraph is sparsely populated.
     */
    public boolean is_sparse() {
        return isSparse;
    }
    
    /** Returns the number of Nodes in this CatGraph.
     * @return The number of Nodes in this CatGraph.
     */
    public int num_nodes() {
        return cGraph.number_of_nodes();
    }
    
    /** Returns the number of leaves in this CatGraph.
     * @return The number of leaves in this CatGraph.
     */
    public int num_leaves() {
        return cGraph.num_leaves();
    }
    
    /** Returns the CGraph stored in this CatGraph object.
     * @return The CGraph stored in this CatGraph object.
     */
    public CGraph get_graph() {
        return cGraph;
    }
    
    /** Returns the number of attributes stored in this CatGraph.
     * @return The number of attributes stored in this CatGraph.
     * @param maxAttr	The maximum number of attributes stored in the CatGraph.
     */
    public int num_attr(int maxAttr) {
        return cGraph.num_attr(logOptions.get_log_options() , maxAttr);
    }
    
    /** Creates a new Node.
     * @return The new Node.
     * @param cat		The Categorizer to be stored in the new Node.
     * @param level The level for the new node placement.
     */
    public Node create_node(NodeCategorizer[] cat, int level) {
        NodeInfo nodeInfo = cGraph.get_prototype() .create_my_type(level);
        nodeInfo.set_categorizer(cat);
        MLJ.ASSERT(cat[0] == null, "CatGraph::create_node: cat != NULL");
        return cGraph.new_node(nodeInfo);
    }
    
    /** Creates a directed Edge from Node "from" to Node "to". Assigns the Edge
     * the value "edgeLabel" and gets ownership of the AugCategory.             <P>
     * For non-sparse graphs:                                                 <BR>
     * The category given must be the category following the category for
     * the previous Edge.                                                       <BR>
     * The first Edge must have label UNKNOWN_CATEGORY_VAL or
     * FIRST_CATEGORY_VAL.
     *
     * @param from		The Node that is the source of the directed Edge.
     * @param to		The Node that is the destination of the directed Edge.
     * @param edgeLabel	The category to be assigned to the new Edge.
     */
    public void connect(Node from,Node to,
    AugCategory edgeLabel) {
        // grab these values in advance.  Makes debugging easier too.
        NodeInfo fromInfo =(NodeInfo) get_graph() .entry(from);
        NodeInfo toInfo =(NodeInfo) get_graph() .entry(to);
        NodeCategorizer fromCat = fromInfo.get_categorizer();
        NodeCategorizer toCat = toInfo.get_categorizer();
        
        if (!fromCat.in_graph())
            Error.fatalErr("CatGraph::connect: the \'from\' node "
            +fromCat.description()
            + " is not in the graph");
        if (!toCat.in_graph())
            Error.fatalErr("CatGraph::connect: the \'to\' node "
            +toCat.description()
            + " is not in the graph");
        logOptions.LOG(8, "CatGraph::connect: isSparse = " +isSparse
        + " is_sparse() = " +is_sparse()
        + " !is_sparse() = " +!is_sparse() + '\n');
        if (!is_sparse()) {
            if (from.outdeg() == 0 && edgeLabel.num() != Globals.FIRST_CATEGORY_VAL &&
            edgeLabel.num() != Globals.UNKNOWN_CATEGORY_VAL)
                Error.fatalErr("CatGraph::connect: The first edge must have label "
                +Globals.FIRST_CATEGORY_VAL+ " or "
                +Globals.UNKNOWN_CATEGORY_VAL+ ".  Given label was " +edgeLabel.num());
            if (from.outdeg() != 0 &&
            edgeLabel.num() != ((AugCategory) cGraph.inf(from.last_adj_edge())) .num() + 1)
                Error.fatalErr("CatGraph::connect: Edge label "
                + ((AugCategory) cGraph.inf(from.last_adj_edge())) .num() + 1
                + " must follow edge label "
                + ((AugCategory) cGraph.inf(from.last_adj_edge())) .num()
                + "; got edge label " + edgeLabel.num());
        }
        for(Edge edgePtr = from.First_Adj_Edge(0) ; edgePtr != null ; edgePtr = edgePtr.Succ_Adj_Edge(from))
            if ((cGraph.inf(edgePtr)) == edgeLabel) {
                Error.err("CatGraph::connect: Attempting to add a duplicate edge: "
                +edgeLabel
                + ".  Edge " + (cGraph.inf(edgePtr)) + " already exists. ");
            }
        cGraph.new_edge(from, to, edgeLabel);
        edgeLabel = null;
    }
    
    /** Returns the number of children the specified Node has.
     * @return The number of children the specified Node has.
     * @param parent	The specified Node.
     */
    public int num_children(Node parent) {
        return parent.outdeg();
    }
    
    /** Returns the NodeCategorizer stored in the specified Node.
     * @return The NodeCategorizer stored in the specified Node.
     * @param nodePtr The Node containing the NodeCategorizer.
     */
    public NodeCategorizer get_categorizer(Node nodePtr) {
        return((NodeInfo) cGraph.inf(nodePtr)) .get_categorizer();
    }
    
    /** Checks if specified Node is in this NatGraph object.
     * @return TRUE if the Node is a node that is in the CatGraph. Otherwise,
     * returns FALSE.
     * @param node			The Node to be looked for.
     * @param fatalOnFalse	TRUE if an error message should be displayed if the
     * specified Node is not in the CatGraph, FALSE
     * otherwise.
     */
    public boolean check_node_in_graph(Node node,
    boolean fatalOnFalse) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美大片在线观看一区| 日韩高清不卡一区二区| 91同城在线观看| 亚洲色图在线看| 色婷婷亚洲综合| 亚洲韩国精品一区| 国产精品久久久久久亚洲毛片| 天堂蜜桃91精品| 欧美亚洲一区三区| 偷拍自拍另类欧美| 欧美tk—视频vk| 国产99久久久国产精品潘金| 综合av第一页| 欧美日韩黄色一区二区| 精品伊人久久久久7777人| 欧美激情综合网| 欧美综合视频在线观看| 日韩精品一二三| 久久精品人人做人人爽人人| 波多野结衣中文字幕一区| 亚洲一区二区在线播放相泽| 日韩亚洲国产中文字幕欧美| 丁香网亚洲国际| 亚洲国产日日夜夜| 欧美不卡视频一区| 99久久精品国产一区| 欧美成人一区二区三区| 成人国产精品免费网站| 午夜影院久久久| 国产亚洲午夜高清国产拍精品| 91麻豆6部合集magnet| 欧美a级一区二区| 中文字幕不卡在线播放| 欧美日韩一区二区在线视频| 国产一区二区看久久| 一区二区三区波多野结衣在线观看| 3atv一区二区三区| 成人av在线网站| 日韩高清电影一区| 亚洲视频综合在线| 337p亚洲精品色噜噜噜| 国产成人综合在线| 亚洲最快最全在线视频| 久久久不卡影院| 国产欧美日韩视频一区二区| 午夜免费久久看| 国产清纯白嫩初高生在线观看91| 欧美亚洲免费在线一区| 国产成人亚洲精品狼色在线| 午夜久久久久久| 中文字幕一区二区三区在线观看 | 麻豆国产91在线播放| 中文字幕一区二区5566日韩| 欧美一级高清片| 91老师片黄在线观看| 国产在线精品免费av| 亚洲成人精品在线观看| 国产精品国产馆在线真实露脸 | 亚洲乱码一区二区三区在线观看| 欧美一区二区三区免费视频| 色综合久久久久综合| 国产乱子轮精品视频| 亚洲欧美色一区| 久久这里只精品最新地址| 欧美男人的天堂一二区| 91视频观看免费| 欧美精品一区二区三区蜜臀| 色哟哟一区二区| 国产精品一级在线| 免费观看在线综合| 亚洲一级电影视频| 国产精品国产三级国产| 国产校园另类小说区| 欧美一级久久久久久久大片| 欧美系列在线观看| 91在线观看视频| 成人污视频在线观看| 国产一区视频在线看| 免费观看一级特黄欧美大片| 亚洲一区二区综合| 一区二区三区国产精华| 国产精品国产精品国产专区不片| 久久精品一二三| 亚洲精品在线观| 日韩欧美中文字幕制服| 777午夜精品免费视频| 91久久香蕉国产日韩欧美9色| 成人成人成人在线视频| 国产成人免费在线视频| 国产一区在线精品| 国产精品自拍在线| 国内精品久久久久影院薰衣草 | 91色视频在线| 国产大片一区二区| 国产精品亚洲午夜一区二区三区 | 成人精品免费网站| 国产一区二区三区不卡在线观看 | 日韩你懂的在线播放| 欧美区一区二区三区| 一本色道亚洲精品aⅴ| 99精品久久99久久久久| av在线不卡电影| 成人av中文字幕| 97国产一区二区| 91视频精品在这里| 久久99深爱久久99精品| 伦理电影国产精品| 免费成人结看片| 久久av资源网| 国内精品视频一区二区三区八戒| 国产在线视频一区二区| 国产乱对白刺激视频不卡| 国产精品 欧美精品| 成人在线一区二区三区| 成人午夜看片网址| 99视频精品在线| 一本久久a久久精品亚洲 | 91丨porny丨中文| 一本久道中文字幕精品亚洲嫩| 在线观看一区二区视频| 精品视频在线看| 91精品婷婷国产综合久久性色| 欧美一二三四区在线| 26uuu欧美| 日本一区二区免费在线| 国产女人aaa级久久久级| 91精选在线观看| 精品国产免费人成电影在线观看四季| 2019国产精品| 国产精品对白交换视频 | 亚洲男人的天堂网| 亚洲国产精品视频| 日本欧美在线观看| 国产精品自拍三区| 色婷婷综合久久久久中文一区二区 | 色素色在线综合| 欧美日韩国产综合一区二区三区 | 国产精品久久久久久户外露出 | 亚洲视频在线一区| 午夜欧美电影在线观看| 激情丁香综合五月| voyeur盗摄精品| 欧美日韩一区二区欧美激情| 日韩视频123| 中文欧美字幕免费| 一区二区国产视频| 美女网站色91| 成人不卡免费av| 欧美裸体一区二区三区| 色综合久久久久综合体| 欧美一区二区三区爱爱| 久久久久99精品国产片| 亚洲免费观看高清完整| 日本午夜精品视频在线观看| 国产精品一级二级三级| 欧美日韩免费观看一区三区| 精品不卡在线视频| 亚洲欧美经典视频| 免费在线看一区| 成人综合婷婷国产精品久久| 欧美亚洲综合色| 久久伊人蜜桃av一区二区| 亚洲精品免费看| 捆绑变态av一区二区三区| 99久久精品费精品国产一区二区| 884aa四虎影成人精品一区| 国产精品网站在线观看| 日日欢夜夜爽一区| 成人精品小蝌蚪| 91麻豆精品国产91久久久久 | 免费高清在线一区| 不卡视频在线看| 日韩亚洲欧美成人一区| 国产精品色婷婷久久58| 日韩高清在线不卡| 色综合天天综合色综合av| 欧美mv和日韩mv国产网站| 亚洲欧美精品午睡沙发| 亚洲在线一区二区三区| 国产一区二区三区最好精华液| 欧美性一二三区| 久久久久久免费网| 婷婷久久综合九色综合伊人色| 成人精品小蝌蚪| 精品福利视频一区二区三区| 一区二区三区四区视频精品免费 | 91精品午夜视频| 亚洲蜜臀av乱码久久精品蜜桃| 国产一区二区在线看| 欧美日本一道本| 国产精品午夜在线观看| 久久av老司机精品网站导航| 国产乱码精品一区二区三区忘忧草| 欧美性猛交xxxxxxxx| 国产精品三级视频| 国内精品在线播放| 9191久久久久久久久久久| 自拍偷拍国产亚洲| 国产成a人无v码亚洲福利| 日韩限制级电影在线观看|