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

📄 binaryoutcomecurve.cpp

📁 ROSETTA C++库是一个C++类库和例程集合
💻 CPP
字号:
//-------------------------------------------------------------------
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Revisions.....:
//===================================================================

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

#include <kernel/structures/binaryoutcomecurve.h>

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

#include <kernel/system/fstream.h>

//-------------------------------------------------------------------
// Methods for class BinaryOutcomeCurve.
//===================================================================

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

BinaryOutcomeCurve::BinaryOutcomeCurve() {
}

BinaryOutcomeCurve::BinaryOutcomeCurve(const BinaryOutcomeCurve &/*in*/) {
}

BinaryOutcomeCurve::~BinaryOutcomeCurve() {
}

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

IMPLEMENTIDMETHODS(BinaryOutcomeCurve, BINARYOUTCOMECURVE, Structure)

//-------------------------------------------------------------------
// Methods inherited from Persistent.
//===================================================================

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

bool
BinaryOutcomeCurve::Load(ifstream &stream) {
	return Load(stream, false);
}

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

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

bool
BinaryOutcomeCurve::Load(ifstream &stream, bool swap) {

	Vector(int)   targets;
	Vector(float) outputs;

	bool sort = false;

	// Load the pairs...
	if (!Load(stream, targets, outputs, swap, sort))
		return false;

	// ... and create the curve.
	if (!Create(targets, outputs))
		return false;

	return true;

}

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

bool
BinaryOutcomeCurve::Load(const String &filename, bool swap) {

	ifstream stream;

	if (!IOKit::Open(stream, filename))
		return false;

	return Load(stream, swap);

}

//-------------------------------------------------------------------
// Method........: Load
// Author........: Aleksander 豩rn
// Date..........:
// Description...: Loads a set of (target, output) pairs, as
//                 output from a ROSETTA calibration curve with
//                 a single object per group.
//
//                 A third number per line may also be supplied, which
//                 indicates a sorting key the pairs are to be sorted
//                 by. The sorting key is typically an object index.
//                 This helps one to "auto-align" the pairs from
//                 different classifiers.
//
//                 Sorting can be turned off by the sort flag, even
//                 if sorting keys are present.
//
//                 The pairs are read as (output, target) if the
//                 swap flag is set.
// Comments......:
// Revisions.....: A

⌨️ 快捷键说明

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