📄 eventtreespace.h
字号:
//////////////////////////////////////////////////////////////////////////// Copyright (c) 2000, Yusuke Miyao/// You may distribute under the terms of the Artistic License.////// <id>$Id: EventTreeSpace.h,v 1.2 2002/12/18 04:22:40 yusuke Exp $</id>/// <collection>Maximum Entropy Estimator</collection>/// <name>EventTreeSpace.h</name>/// <overview>An event space with event trees</overview>/////////////////////////////////////////////////////////////////////////#ifndef Amis_EventTreeSpace_h_#define Amis_EventTreeSpace_h_#include <amis/EventTreeSpaceBase.h>#include <amis/VectorOnFile.h>#include <vector>AMIS_NAMESPACE_BEGIN///////////////////////////////////////////////////////////////////////// <classdef>/// <name>EventTreeSpaceOnMemory</name>/// <overview>On-memory implementation of EventTreeSpace</overview>/// <desc>A set of all possible events described in a tree structure in the task</desc>/// <body>template < class Feature >class EventTreeSpaceOnMemory : public EventTreeSpaceBase< Feature > {private: std::vector< EventTree< Feature > > event_list;public: EventTreeSpaceOnMemory( void ) {} virtual ~EventTreeSpaceOnMemory() {}public: const std::string eventSpaceName( void ) const { return "EventTreeSpaceOnMemory<" + Feature::featureTypeName() + ">"; } /// Get the name of this classprivate: void push( EventTree< Feature >& event ) { /* event_list.push_back( EventTree< Feature >() ); event_list.back().swap( event ); */ event_list.push_back( event ); } /// Add a new event to an event listpublic: const EventTree< Feature >& operator[]( int i ) const { return event_list[ i ]; } /// Get the i-th event};/// </body>/// </classdef>///////////////////////////////////////////////////////////////////////// <classdef>/// <name>EventTreeSpaceOnFile</name>/// <overview>On-file implementation of EventTreeSpace</overview>/// <desc>A set of all possible events described in a tree structure in the task</desc>/// <body>template < class Feature >class EventTreeSpaceOnFile : public EventTreeSpaceBase< Feature > {private: VectorOnFile< EventTree< Feature > > event_list;public: const std::string eventSpaceName( void ) const { return "EventTreeSpaceOnFile<" + Feature::featureTypeName() + ">"; } /// Get the name of this classpublic: EventTreeSpaceOnFile( objstream* s ) : event_list( s ) {} virtual ~EventTreeSpaceOnFile() {}private: void push( EventTree< Feature >& event ) { event_list.push_back( event ); } /// Add a new event to an event listpublic: const EventTree< Feature >& operator[]( int i ) const { return event_list[ i ]; } /// Get the i-th event};/// </body>/// </classdef>AMIS_NAMESPACE_END#endif // EventTreeSpace_h_// end of EventTreeSpace.h
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -