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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? indiscernibilitygraph.cpp

?? 粗慥集成算法集合 ,并有詳細(xì)的文檔資料和測(cè)試數(shù)據(jù)處
?? CPP
字號(hào):
//-------------------------------------------------------------------
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Revisions.....:
//===================================================================

#include <stdafx.h> // Precompiled headers.
#include <copyright.h>

#include <kernel/structures/indiscernibilitygraph.h>
#include <kernel/structures/discernibilitymatrix.h>
#include <kernel/structures/decisiontable.h>
#include <kernel/structures/generalizeddecision.h>

#include <kernel/utilities/partitionkit.h>
#include <kernel/utilities/discerner.h>
#include <kernel/utilities/creator.h>

#include <kernel/basic/map.h>

//-------------------------------------------------------------------
// Static helpers (file scope).
//===================================================================

//-------------------------------------------------------------------
// Method........: StaticVerifyNames
// Author........: Aleksander 豩rn
// Date..........:
// Description...: Verifies validity of index (unmasked) of attribute
//                 that specifies node names.
//
//                 Also checks that attribute is valid for unique
//                 object naming (with a masked table).
// Comments......:
// Revisions.....:
//===================================================================

static bool
StaticVerifyNames(int index, const DecisionTable &table) {

	if (index == Undefined::Integer())
		return true;

	// Verify range.
	if (index < 0 || index >= table.GetNoAttributes(false))
		return false;

	Vector(int) values, cardinalities;

	// Get value set.
	if (!table.GetValueSet(values, cardinalities, index, false))
		return false;

	// Verify "1-1"-ness with the masked table.
	if (values.size() != table.GetNoObjects(true))
		return false;

	return true;

}

//-------------------------------------------------------------------
// Methods for class IndiscernibilityGraph.
//===================================================================

//-------------------------------------------------------------------
// Constructors/destructor.
//===================================================================

//-------------------------------------------------------------------
// Method........: Constructor
// Author........: Aleksander 豩rn
// Date..........:
// Description...: Copy constructor
// Comments......:
// Revisions.....:
//===================================================================

IndiscernibilityGraph::IndiscernibilityGraph(const IndiscernibilityGraph &in) : Graph(in) {
}

//-------------------------------------------------------------------
// Method........: Constructor
// Author........: Aleksander 豩rn
// Date..........:
// Description...: Empty constructor
// Comments......:
// Revisions.....:
//===================================================================

IndiscernibilityGraph::IndiscernibilityGraph() {
}

//-------------------------------------------------------------------
// Method........: Destructor.
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Comments......:
// Revisions.....:
//===================================================================

IndiscernibilityGraph::~IndiscernibilityGraph() {
}

//-------------------------------------------------------------------
// Methods inherited from Identifier.
//===================================================================

IMPLEMENTIDMETHODS(IndiscernibilityGraph, INDISCERNIBILITYGRAPH, Graph)

//-------------------------------------------------------------------
// New methods.
//===================================================================

//-------------------------------------------------------------------
// Method........: AreIndiscernible
// Author........: Aleksander 豩rn
// Date..........:
// Description...: Given objects x and y (or more precisely, object
//                 indices i and j) and the discernibility matrix M,
//                 returns true iff x and y are indiscernible.
//
//                 Default implementation returns true iff M(x, y)
//                 contains less than k elements. Can be overloaded to
//                 provide other behaviours.
//
// Comments......: Called from the Create method. The AddEdges1 and
//                 AddEdges2 methods should be generalized to allow
//                 similar flexibility through a related AreIndiscernible
//                 method.
//
// Revisions.....:
//===================================================================

bool
IndiscernibilityGraph::AreIndiscernible(int i, int j, const DiscernibilityMatrix &matrix, int cardinality) const {

	if (matrix.IsEmpty(i, j))
		return true;

	// Assuming that only non-empty entries are stored in the matrix.
	if (cardinality == 0)
		return false;

	return (matrix.GetEntry(i, j)->Count(true) <= cardinality);

}

//-------------------------------------------------------------------
// Method........: AreIndiscernible
// Author........: Aleksander 豩rn
// Date..........:
// Description...: Given objects x and y (or more precisely, object
//                 indices i and j) and the decision table to which they
//                 belong, returns true iff x and y are indiscernible.
//
//                 Can be overloaded to provide other behaviours, e.g.,
//                 Euclidian or Mahalonobis distance.
//
// Comments......: Called from the AddEdges1 method.
// Revisions.....:
//===================================================================

bool
IndiscernibilityGraph::AreIndiscernible(int i, int j, const DecisionTable &table, bool masked, const Discerner &discerner, bool all, int cardinality) const {
	return AreIndiscernible(i, j, table, masked, discerner, all, cardinality, table.GetNoAttributes(masked));
}

bool
IndiscernibilityGraph::AreIndiscernible(int i, int j, const DecisionTable &table, bool masked, const Discerner &discerner, bool all, int cardinality, int no_attributes) const {

	int k, count = 0;

	// Are objects (i, j) indiscernible?
	for (k = 0; k < no_attributes; k++) {
		if (all || table.IsCondition(k, masked)) {
			int value_i = table.GetEntry(i, k, masked);
			int value_j = table.GetEntry(j, k, masked);
			if (discerner.Discerns(k, value_i, value_j)) {
				count++;
				if (count > cardinality)
					return false;
			}
		}
	}

	return true;

}

//-------------------------------------------------------------------
// Method........: Create
// Author........: Aleksander 豩rn
// Date..........:
// Description...: Constructs a graph (V, E).
//
//                 V: The set of nodes. One node per object in the
//                    discernibility matrix.
//                 E: The set of edges. Typically, an edge is present
//                    between node i and node j iff entry (i, j) in
//                    the matrix is empty.
//
// Comments......:
// Revisions.....:
//===================================================================

bool
IndiscernibilityGraph::Create(const DiscernibilityMatrix &matrix, int cardinality) {

	// Delete current graph contents.
	Clear();

	int i, j, no_objects = matrix.GetDimension();

	// Initialize node set.
	for (i = 0; i < no_objects; i++) {
		if (!AddNode(i))
			return false;
	}

	// Create edge matrix.
	if (!MakeAdjacencyMatrix())
		return false;

	// Add an undirected edge between two objects if the objects are indiscernible.
	// Assume a symmetric matrix.
	for (i = 0; i < no_objects; i++) {
		for (j = 0; j <= i; j++) {
			if (AreIndiscernible(i, j, matrix, cardinality)) {
				if (!SetEdgeByIndex(i, j, true) || !SetEdgeByValue(j, i, true))
					return false;
			}
		}
	}

	return true;

}

//-------------------------------------------------------------------
// Method........: Create
// Author........: Aleksander 豩rn
// Date..........:
// Description...: Constructs a graph (V, E).
//
//                 V: The set of nodes. One node per object in the
//                    table.
//                 E: The set of edges. An edge is present between
//                    node i and node j iff objects i and j are
//                    indiscernible.
//
//                 table:
//                    The decision table to work on.
//                 masked:
//                    Work on a masked table?
//                 discerner:
//                    Defines the discernibility predicate.
//                 all:       (default true)
//                    For discernibility, consider all attributes
//                    (i.e., both condition and decision attributes)
//                    or condition attributes only?
//                 names:     (default Undefined::Integer())
//                    The index (unmasked) of a 1-1 attribute in the
//                    table that defines node names. If Undefined,
//                    no names are used.
//                 decisions: (default NULL)
//                    If supplied, returned in-place. In effect
//                    defines the generalized decision values for
//                    each object, since it compiles the decision
//                    values of all indiscernible objects, i.e.,
//                    neighbouring nodes.
//
// Comments......: The table can be masked to change the attribute
//                 subset under consideration.
//
//                 Creation of graph can be done quicker if we know
//                 that the indiscernibility relation is an
//                 equivalence relation. Hence, a specialized
//                 implementation is provided if the discernibility
//                 predicate does not use a IDG. Then, strict inequality
//                 assumed used.
//
//                 Can be optimized by only considering one
//                 representative from each equivalence class.
//
// Revisions.....:
//===================================================================

bool
IndiscernibilityGraph::Create(const DecisionTable &table, bool masked, const Discerner &discerner, bool all, int cardinality, int names, GeneralizedDecision::Handles *decisions) {

	// Delete current graph contents.
	Clear();

	int no_objects    = table.GetNoObjects(masked);
	int no_attributes = table.GetNoAttributes(masked);

	// Current implementation is not perfect...
	if (table.GetNoObjects(true) != table.GetNoObjects(false)) {
		Message::Error("Current implementation does not handle masked objects.");
		return false;
	}

	// Verify validity of name attribute.
	if (!StaticVerifyNames(names, table)) {
		Message::Error("Name attribute not accepted. Does it assign unique names?");
		return false;
	}

	int i;

	// Initialize node set.
	for (i = 0; i < no_objects; i++) {
		int name = (names == Undefined::Integer()) ? i : table.GetEntry(i, names, false);
		if (!AddNode(name))
			return false;
	}

	// Create edge matrix.
	if (!MakeAdjacencyMatrix())
		return false;

	// Add edges.
	if (discerner.HasIDGs() || (cardinality > 0)) {
		if (!AddEdges1(table, masked, discerner, all, cardinality, names, decisions))
			return false;
	}
	else {
		if (!AddEdges2(table, masked, all, names, decisions))
			return false;
	}

	// Set index of attribute graph node values refer to (if any).
	SetAttribute(names);

	return true;

}

//-------------------------------------------------------------------
// Method........: AddEdges1
// Author........: Aleksander 豩rn
// Date..........:
// Description...: Helper, called from Create. Adds edges to graph.
//                 General O(n^2) implementation.
//
// Comments......: Future optimization: Compute equivalence classes
//                 and consider representatives in the computations.
//
// Revisions.....: 990717 A

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产麻豆精品在线观看| 成人美女视频在线看| 国产欧美一区二区三区在线看蜜臀| 色哟哟精品一区| 激情久久五月天| 亚洲午夜久久久久久久久久久 | 国产精品视频yy9299一区| 9191精品国产综合久久久久久| 国产suv精品一区二区6| 亚洲国产综合色| 欧美激情中文不卡| 日韩欧美亚洲一区二区| 色呦呦国产精品| 成人激情午夜影院| 激情欧美一区二区| 免费看日韩a级影片| 亚洲欧美日韩精品久久久久| 国产亚洲自拍一区| 日韩精品一区二区在线| 欧美色倩网站大全免费| 91香蕉国产在线观看软件| 国产成人鲁色资源国产91色综| 青青草视频一区| 亚洲成人激情社区| 亚洲制服欧美中文字幕中文字幕| 日本一区二区免费在线| 久久亚洲精品小早川怜子| 欧美精品丝袜中出| 欧美日韩一区在线观看| 91浏览器在线视频| av午夜精品一区二区三区| 国产黄色成人av| 国产美女视频91| 黄色小说综合网站| 久久www免费人成看片高清| 日韩成人一区二区| 日本欧美一区二区三区乱码| 日韩国产欧美三级| 日韩av一区二区三区四区| 亚洲国产精品影院| 亚洲国产一二三| 亚洲国产精品久久久男人的天堂| 亚洲自拍偷拍图区| 亚洲一区av在线| 五月婷婷激情综合| 欧美aaaaa成人免费观看视频| 奇米色一区二区三区四区| 免费成人在线观看| 国内精品久久久久影院一蜜桃| 狠狠久久亚洲欧美| 国产suv精品一区二区6| 99久久精品国产精品久久| 97久久超碰精品国产| 一本到不卡精品视频在线观看| 91久久免费观看| 欧美日韩国产小视频在线观看| 欧美精品第一页| 欧美成人免费网站| 久久久久久黄色| 亚洲男人的天堂av| 亚洲成人动漫在线观看| 美女脱光内衣内裤视频久久网站| 国产一区三区三区| av一区二区三区四区| 精品视频一区 二区 三区| 欧美一区二区二区| 国产日韩欧美a| 亚洲综合成人网| 精品一区二区三区免费播放| 福利一区在线观看| 在线观看免费亚洲| 日韩精品一区二区三区在线观看| 国产视频一区在线播放| 亚洲最新在线观看| 久久99国内精品| 丰满亚洲少妇av| 欧美日韩大陆在线| 中文字幕二三区不卡| 一区二区免费在线播放| 久久精品99国产精品| a级精品国产片在线观看| 91精品啪在线观看国产60岁| 国产精品人人做人人爽人人添| 亚洲午夜久久久久久久久电影院| 国产一区二区网址| 欧美图片一区二区三区| 精品电影一区二区| 亚洲综合视频在线观看| 国产精品一二三区| 欧美日韩色综合| 国产精品久久夜| 九九**精品视频免费播放| 99视频精品全部免费在线| 日韩欧美一卡二卡| 一区二区三区精密机械公司| 国产在线不卡一区| 91精品国产综合久久久久久久久久 | 亚洲激情六月丁香| 国内欧美视频一区二区| 在线视频中文字幕一区二区| 国产亚洲精品aa午夜观看| 午夜视频久久久久久| caoporn国产精品| 久久综合久久综合久久综合| 日日摸夜夜添夜夜添国产精品| 99在线热播精品免费| 久久久久久久国产精品影院| 免费在线观看成人| 欧美性xxxxxxxx| 亚洲九九爱视频| 成人午夜免费电影| 精品久久人人做人人爽| 日韩精品成人一区二区三区| 色综合久久中文字幕综合网| 国产精品私人自拍| 国产一区二区三区精品视频| 日韩精品自拍偷拍| 日韩综合一区二区| 欧美日韩一区二区在线观看视频 | 一区二区三区四区在线播放| 国产成人av电影在线观看| 日韩精品一区二区三区视频| 日韩av在线发布| 精品视频999| 亚洲综合色自拍一区| 日本高清免费不卡视频| 亚洲素人一区二区| 成人免费观看av| 国产精品丝袜在线| 不卡视频在线看| 国产精品无圣光一区二区| 国产精品乡下勾搭老头1| 26uuu国产日韩综合| 精品一区二区三区免费观看 | 欧美三级三级三级| 玉足女爽爽91| 欧美综合天天夜夜久久| 亚洲激情成人在线| 欧美色图片你懂的| 香港成人在线视频| 欧美一级久久久| 麻豆国产一区二区| 精品日产卡一卡二卡麻豆| 经典三级视频一区| 久久久噜噜噜久久人人看| 国产精品资源网| 国产欧美1区2区3区| 99国产精品国产精品毛片| 亚洲私人黄色宅男| 欧美日产国产精品| 日本不卡一区二区三区| 精品理论电影在线| 成人一区在线观看| 亚洲精品成人精品456| 欧美性猛片aaaaaaa做受| 日韩精品乱码av一区二区| 日韩一区二区在线观看| 国产精品自拍毛片| 国产精品久久久久婷婷| 色综合天天性综合| 午夜精品福利一区二区三区av| 欧美一区二区网站| 国产成人午夜片在线观看高清观看| 中文字幕一区免费在线观看| 欧美中文字幕一区二区三区| 日本伊人色综合网| 国产喂奶挤奶一区二区三区| 99精品黄色片免费大全| 日韩国产精品久久| 国产三级一区二区三区| 一本大道av一区二区在线播放 | voyeur盗摄精品| 亚洲1区2区3区4区| 国产视频一区二区三区在线观看| 色菇凉天天综合网| 精品在线播放免费| 亚洲精品综合在线| 日韩欧美卡一卡二| 91亚洲精品久久久蜜桃| 日韩电影免费一区| 国产精品久久久久久久岛一牛影视| 欧美日本乱大交xxxxx| 国产精品性做久久久久久| 午夜精品久久久久影视| 久久久综合激的五月天| 欧美制服丝袜第一页| 国产在线不卡视频| 亚洲18色成人| 国产精品久久综合| 日韩亚洲欧美中文三级| 91啪九色porn原创视频在线观看| 久久精品99久久久| 亚洲一区二区三区在线播放| 久久久久久久久蜜桃| 欧美美女黄视频| 91在线播放网址| 国产成人综合在线观看| 首页欧美精品中文字幕| 亚洲欧洲综合另类| 国产亚洲精品7777|