amismodelformatitem.h

来自「Amis - A maximum entropy estimator 一个最大」· C头文件 代码 · 共 30 行

H
30
字号
#ifndef Amis_AmisModelFormatItem_h_#define Amis_AmisModelFormatItem_h_#include <amis/ModelFormatLauncher.h>#include <amis/Property.h>AMIS_NAMESPACE_BEGINtemplate < class FormatForLambda, class FormatForAlpha >class AmisModelFormatItem : public ModelFormatLauncherItem {public:  AmisModelFormatItem( const std::string& name, const std::string& desc = "" )    : ModelFormatLauncherItem( name, desc ) {}  ModelFormatPtr launch( Property* property ) {    if ( property->getFeatureWeightType() == LAMBDA ) {      return ModelFormatPtr( new FormatForLambda() );    } else if ( property->getFeatureWeightType() == ALPHA ) {      return ModelFormatPtr( new FormatForAlpha() );    } else {      throw IllegalPropertyError( "Unknown feature type: " + property->getFeatureWeightType() );    }  }};AMIS_NAMESPACE_END#endif // Amis_AmisModelFormatItem_h_// end of AmisModelFormatItem.h

⌨️ 快捷键说明

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