⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 binaryoutcomecomparator.cpp

📁 粗糙集应用软件
💻 CPP
字号:
//-------------------------------------------------------------------
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Revisions.....:
//===================================================================

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

#include <kernel/utilities/binaryoutcomecomparator.h>
#include <kernel/utilities/iokit.h>
#include <kernel/utilities/mathkit.h>
#include <kernel/utilities/permuter.h>

#include <kernel/structures/binaryoutcomecurve.h>

#include <kernel/system/fstream.h>

#include <kernel/basic/algorithm.h>
#include <kernel/basic/message.h>

//-------------------------------------------------------------------
// Methods for class BinaryOutcomeComparator.
//===================================================================

//-------------------------------------------------------------------
// Constructors/destructors.
//===================================================================

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

BinaryOutcomeComparator::BinaryOutcomeComparator() {
}

BinaryOutcomeComparator::BinaryOutcomeComparator(const Vector(String) &filenames, const Vector(bool) &swap) {

	targets_.erase(targets_.begin(), targets_.end());
	outputs_.erase(outputs_.begin(), outputs_.end());

	targets_.reserve(filenames.size());
	outputs_.reserve(filenames.size());

	// Verify dimensions.
	if (filenames.size() != swap.size()) {
		Message::Error("Dimension mismatch in arguments passed to BinaryOutcomeComparator constructor.");
		return;
	}

	int i, last = -1;

	// Load all (target, output) pairs.
	for (i = 0; i < filenames.size(); i++) {
		targets_.push_back(Vector(int)());
		outputs_.push_back(Vector(float)());
		last++;
		if (!LoadPairs(targets_[last], outputs_[last], filenames[i], swap[i])) {
			Message::Error("Failed to load data from " + filenames[i] + ".");
			targets_.erase(targets_.begin() + last);
			outputs_.erase(outputs_.begin() + last);
			last--;
		}
	}

}

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

BinaryOutcomeComparator::~BinaryOutcomeComparator() {
}

//-------------------------------------------------------------------
// Helper methods.
//===================================================================

//-------------------------------------------------------------------
// Method........: LoadPairs
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Comments......:
// Revisions.....: A

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -