costinformation.h

来自「粗糙集应用软件」· C头文件 代码 · 共 64 行

H
64
字号
//-------------------------------------------------------------------
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Revisions.....:
//===================================================================

#ifndef __COSTINFORMATION_H__
#define __COSTINFORMATION_H__

#include <copyright.h>

#include <kernel/basic/vector.h>

//-------------------------------------------------------------------
// Class prototypes.
//===================================================================

class DecisionTable;
class ifstream;
class Reduct;
class String;

//-------------------------------------------------------------------
// Class.........: CostInformation
// Author........: Aleksander 豩rn
// Date..........:
// Description...: Helper class that keeps information about
//                 attribute costs.
//
// Comments......: To do: Add support for shared costs.
// Revisions.....:
//===================================================================

class CostInformation {
protected:

  //- Member variables..............................................
	Vector(float)         costs_;

protected:

	//- Constructors...................................................
  CostInformation(const CostInformation &in);

public:

  //- Constructor and destructor....................................
	CostInformation();
  virtual ~CostInformation();

  //- Local methods.................................................
  virtual bool          Load(ifstream &stream, const DecisionTable &table, float defaultcost);
  virtual bool          Load(const String &filename, const DecisionTable &table, float defaultcost);

	const Vector(float)  &GetCosts() const {return costs_;}

	virtual float         GetCost(int attribute) const;
	virtual float         GetCost(const Vector(int) &attributes) const;
	virtual float         GetCost(const Reduct &attributes) const;

};

#endif

⌨️ 快捷键说明

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