当前位置: 首页>>代码示例>>C++>>正文


C++ ArgumentRules类代码示例

本文整理汇总了C++中ArgumentRules的典型用法代码示例。如果您正苦于以下问题:C++ ArgumentRules类的具体用法?C++ ArgumentRules怎么用?C++ ArgumentRules使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ArgumentRules类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ArgumentRules

/* Get argument rules */
const ArgumentRules& Func_Mcmc::getArgumentRules( void ) const
{
    
    static ArgumentRules argumentRules = ArgumentRules();
    static bool          rulesSet = false;
    
    if ( !rulesSet )
    {
        argumentRules.push_back( new ArgumentRule("model"   , Model::getClassTypeSpec()                   , ArgumentRule::BY_VALUE ) );
        argumentRules.push_back( new ArgumentRule("monitors", WorkspaceVector<Monitor>::getClassTypeSpec(), ArgumentRule::BY_VALUE ) );
        argumentRules.push_back( new ArgumentRule("moves"   , WorkspaceVector<Move>::getClassTypeSpec()   , ArgumentRule::BY_VALUE ) );
        
        std::vector<std::string> options;
        options.push_back( "sequential" );
        options.push_back( "random" );
        options.push_back( "single" );
        
        argumentRules.push_back( new OptionRule( "moveschedule", new RlString( "random" ), options ) );
        argumentRules.push_back( new ArgumentRule("nruns"   , Natural::getClassTypeSpec()                   , ArgumentRule::BY_VALUE, ArgumentRule::ANY, new Natural(1) ) );
        
        rulesSet = true;
    }
    
    return argumentRules;
}
开发者ID:wrightaprilm,项目名称:revbayes,代码行数:26,代码来源:Func_Mcmc.cpp

示例2: MethodTable

/** Make member methods for this class */
RevLanguage::MethodTable TimeTree::makeMethods( void ) const
{
    MethodTable methods = MethodTable();
    
    ArgumentRules* nnodesArgRules = new ArgumentRules();
    methods.addFunction("nnodes", new MemberProcedure(Natural::getClassTypeSpec(),          nnodesArgRules   ) );

    ArgumentRules* ntipsArgRules = new ArgumentRules();
    methods.addFunction("ntips", new MemberProcedure(Natural::getClassTypeSpec(),          ntipsArgRules   ) );

    ArgumentRules* heightArgRules = new ArgumentRules();
    methods.addFunction("rootAge", new MemberProcedure(RealPos::getClassTypeSpec(),          heightArgRules   ) );

    ArgumentRules* namesArgRules = new ArgumentRules();
    methods.addFunction("names", new MemberProcedure(ModelVector<RlString>::getClassTypeSpec(),  namesArgRules    ) );

    ArgumentRules* rescaleArgRules = new ArgumentRules();
    rescaleArgRules->push_back( new ArgumentRule( "factor", RealPos::getClassTypeSpec(), ArgumentRule::BY_VALUE ) );
    methods.addFunction("rescale", new MemberProcedure(RlUtils::Void,                       rescaleArgRules  ) );
    
    // Insert inherited methods
    methods.insertInheritedMethods( ModelObject<RevBayesCore::TimeTree>::makeMethods() );
    
    return methods;
}
开发者ID:vivianaayus,项目名称:revbayes,代码行数:26,代码来源:RlTimeTree.cpp

示例3: MethodTable

/* Get method specifications */
const MethodTable& RateMatrix::getMethods(void) const {
    
    static MethodTable    methods                     = MethodTable(); 
    static bool           methodsSet                  = false;
    
    if ( methodsSet == false ) {
        
        // add method for call "x[]" as a function
        ArgumentRules* squareBracketArgRules = new ArgumentRules();
        squareBracketArgRules->push_back( new ArgumentRule( "index" , true, Natural::getClassTypeSpec() ) );
        methods.addFunction("[]",  new MemberProcedure( ModelVector<RealPos>::getClassTypeSpec(), squareBracketArgRules) );
        
        
        // add method for call "x[]" as a function
        ArgumentRules* sizeArgRules = new ArgumentRules();
        methods.addFunction("size",  new MemberProcedure( Natural::getClassTypeSpec(), sizeArgRules) );
        
        // necessary call for proper inheritance
        methods.setParentTable( &ModelObject<RevBayesCore::RateMatrix>::getMethods() );
        methodsSet = true;
    }
    
    
    return methods;
}
开发者ID:SylerWang,项目名称:RevBayes,代码行数:26,代码来源:RlRateMatrix.cpp

示例4: MethodTable

/* Get method specifications */
const RevLanguage::MethodTable& RealNodeValTree::getMethods(void) const {
    
    static MethodTable    methods                     = MethodTable();
    static bool           methodsSet                  = false;
    
    if ( methodsSet == false )
    {
        
        ArgumentRules* meanArgRules = new ArgumentRules();
        methods.addFunction("mean", new MemberFunction<RealNodeValTree,Real>( this, meanArgRules ) );
        
        ArgumentRules* tipmeanArgRules = new ArgumentRules();
        methods.addFunction("tipMean", new MemberFunction<RealNodeValTree,Real>( this, tipmeanArgRules ) );
        
        ArgumentRules* stdevArgRules = new ArgumentRules();
        methods.addFunction("stdev", new MemberFunction<RealNodeValTree,RealPos>(  this, stdevArgRules ) );
        
        ArgumentRules* rootArgRules = new ArgumentRules();
        methods.addFunction("rootVal", new MemberProcedure(Real::getClassTypeSpec(), rootArgRules ) );
        
        ArgumentRules* clampArgRules = new ArgumentRules();
        clampArgRules->push_back(new ArgumentRule("data", false, AbstractCharacterData::getClassTypeSpec()));
        clampArgRules->push_back(new ArgumentRule("dataIndex", false, Natural::getClassTypeSpec()));
        methods.addFunction("clampAt", new MemberProcedure(RealNodeValTree::getClassTypeSpec(), clampArgRules ) );
        
        // necessary call for proper inheritance
        methods.setParentTable( &ModelObject<RevBayesCore::RealNodeContainer>::getMethods() );
        methodsSet = true;
    }
    
    
    return methods;
}
开发者ID:SylerWang,项目名称:RevBayes,代码行数:34,代码来源:RlRealNodeValTree.cpp

示例5: MethodTable

/* Get method specifications */
const MethodTable& ParallelMcmcmc::getMethods(void) const {
    
    static MethodTable   methods    = MethodTable();
    static bool          methodsSet = false;
    
    if ( methodsSet == false ) {
        ArgumentRules* runArgRules = new ArgumentRules();
        runArgRules->push_back( new ArgumentRule("generations", true, Natural::getClassTypeSpec()) );
        methods.addFunction("run", new MemberProcedure( RlUtils::Void, runArgRules) );
        
        ArgumentRules* burninArgRules = new ArgumentRules();
        burninArgRules->push_back( new ArgumentRule("generations", true, Natural::getClassTypeSpec()) );
        burninArgRules->push_back( new ArgumentRule("tuningInterval", true, Natural::getClassTypeSpec()) );
        methods.addFunction("burnin", new MemberProcedure( RlUtils::Void, burninArgRules) );
        
        ArgumentRules* operatorSummaryArgRules = new ArgumentRules();
        methods.addFunction("operatorSummary", new MemberProcedure( RlUtils::Void, operatorSummaryArgRules) );
        
        // necessary call for proper inheritance
        methods.setParentTable( &RevObject::getMethods() );
        methodsSet = true;
    }
    
    return methods;
}
开发者ID:SylerWang,项目名称:RevBayes,代码行数:26,代码来源:RlParallelMcmcmc.cpp

示例6: ArgumentRules

Trace::Trace(const RevBayesCore::Trace &t) : WorkspaceToCoreWrapperObject<RevBayesCore::Trace>( new RevBayesCore::Trace( t ) )
{

    ArgumentRules* summarizeArgRules = new ArgumentRules();
    summarizeArgRules->push_back( new ArgumentRule("burnin", Natural::getClassTypeSpec(), ArgumentRule::BY_VALUE, ArgumentRule::ANY, new Natural(0)) );
    methods.addFunction("summarize", new MemberProcedure( RlUtils::Void, summarizeArgRules) );

}
开发者ID:wrightaprilm,项目名称:revbayes,代码行数:8,代码来源:RlTrace.cpp

示例7: ArgumentRules

Model::Model() : WorkspaceToCoreWrapperObject<RevBayesCore::Model>()
{
 
    ArgumentRules* dotArgRules = new ArgumentRules();
    dotArgRules->push_back( new ArgumentRule("file", RlString::getClassTypeSpec()  , ArgumentRule::BY_VALUE ) );
    dotArgRules->push_back( new ArgumentRule("verbose", RlBoolean::getClassTypeSpec(), ArgumentRule::BY_VALUE, ArgumentRule::ANY, new RlBoolean(false) ) );
    dotArgRules->push_back( new ArgumentRule("bg", RlString::getClassTypeSpec(), ArgumentRule::BY_VALUE, ArgumentRule::ANY, new RlString("lavenderblush2") ) );
    methods.addFunction("graph", new MemberProcedure( RlUtils::Void, dotArgRules) );

}
开发者ID:wrightaprilm,项目名称:revbayes,代码行数:10,代码来源:RlModel.cpp

示例8: ArgumentRules

TraceTree::TraceTree(const RevBayesCore::TraceTree &m) : WorkspaceToCoreWrapperObject<RevBayesCore::TraceTree>( new RevBayesCore::TraceTree( m ) )
{
    
    ArgumentRules* summarizeArgRules = new ArgumentRules();
    summarizeArgRules->push_back( new ArgumentRule("burninFraction",      Probability::getClassTypeSpec(), "The fraction of samples to disregard as burnin.", ArgumentRule::BY_VALUE, ArgumentRule::ANY, new Probability(0.1)) );
    summarizeArgRules->push_back( new ArgumentRule("credibleTreeSetSize", Probability::getClassTypeSpec(), "The size of the credible set to print.", ArgumentRule::BY_VALUE, ArgumentRule::ANY, new Probability(0.95)) );
    summarizeArgRules->push_back( new ArgumentRule("minCladeProbability", Probability::getClassTypeSpec(), "The minimum clade probability used when printing.", ArgumentRule::BY_VALUE, ArgumentRule::ANY, new Probability(0.05)) );
    this->methods.addFunction( new MemberProcedure( "summarize", RlUtils::Void, summarizeArgRules) );
    
}
开发者ID:hscarter,项目名称:revbayes,代码行数:10,代码来源:RlTraceTree.cpp

示例9: ArgumentRules

/** Get argument rules */
const ArgumentRules& Func_readBranchLengthTrees::getArgumentRules( void ) const {
    
    static ArgumentRules argumentRules = ArgumentRules();
    static bool rulesSet = false;
    
    if (!rulesSet) {
        argumentRules.push_back( new ArgumentRule( "file", RlString::getClassTypeSpec(), ArgumentRule::BY_VALUE ) );
        rulesSet = true;
    }
    
    return argumentRules;
}
开发者ID:wrightaprilm,项目名称:revbayes,代码行数:13,代码来源:Func_readBranchLengthTrees.cpp

示例10: ArgumentRules

/** Get argument rules */
const ArgumentRules& Func_readCharacterDataUniversal::getArgumentRules( void ) const {
    
    static ArgumentRules argumentRules = ArgumentRules();
    static bool rulesSet = false;
    if (!rulesSet)
        {
        argumentRules.push_back( new ArgumentRule( "file", RlString::getClassTypeSpec(), ArgumentRule::BY_VALUE ) );
        argumentRules.push_back( new ArgumentRule( "alwaysReturnAsVector", RlBoolean::getClassTypeSpec(), ArgumentRule::BY_VALUE, ArgumentRule::ANY, new RlBoolean(false) ) );
        rulesSet = true;
        }
    return argumentRules;
}
开发者ID:wrightaprilm,项目名称:revbayes,代码行数:13,代码来源:Func_readCharacterDataUniversal.cpp

示例11: ArgumentRules

/* Get argument rules */
const ArgumentRules& Func_varianceCovarianceMatrix::getArgumentRules( void ) const {
    
    static ArgumentRules argumentRules = ArgumentRules();
    static bool rulesSet = false;
    if ( !rulesSet )
        {
        argumentRules.push_back( new ArgumentRule( "standardDeviations"  , ModelVector<RealPos>::getClassTypeSpec(), ArgumentRule::BY_CONSTANT_REFERENCE ) );
        argumentRules.push_back( new ArgumentRule( "correlationCoefficients", ModelVector<Real>::getClassTypeSpec(), ArgumentRule::BY_CONSTANT_REFERENCE ) );
        rulesSet = true;
        }
    return argumentRules;
}
开发者ID:wrightaprilm,项目名称:revbayes,代码行数:13,代码来源:Func_varianceCovarianceMatrix.cpp

示例12: ArgumentRules

/** Get argument rules */
const ArgumentRules& Func_contributors::getArgumentRules( void ) const {
    
    static ArgumentRules argumentRules = ArgumentRules();
    static bool rulesSet = false;
    
    if ( !rulesSet ) {
        
        argumentRules.push_back( new ArgumentRule( "all", true, RlBoolean::getClassTypeSpec(), new RlBoolean(false) ) );
        rulesSet = true;
    }
    
    return argumentRules;
}
开发者ID:SylerWang,项目名称:RevBayes,代码行数:14,代码来源:Func_contributors.cpp

示例13: ArgumentRules

PowerPosteriorAnalysis::PowerPosteriorAnalysis() : WorkspaceToCoreWrapperObject<RevBayesCore::PowerPosteriorAnalysis>()
{

    ArgumentRules* runArgRules = new ArgumentRules();
    runArgRules->push_back( new ArgumentRule("generations", Natural::getClassTypeSpec(), "The number of generations to run.", ArgumentRule::BY_VALUE, ArgumentRule::ANY ) );
    methods.addFunction( new MemberProcedure( "run", RlUtils::Void, runArgRules) );

    ArgumentRules* burninArgRules = new ArgumentRules();
    burninArgRules->push_back( new ArgumentRule("generations"   , Natural::getClassTypeSpec(), "The number of generations to run.", ArgumentRule::BY_VALUE, ArgumentRule::ANY ) );
    burninArgRules->push_back( new ArgumentRule("tuningInterval", Natural::getClassTypeSpec(), "The frequency when the moves are tuned (usually between 50 and 1000).", ArgumentRule::BY_VALUE, ArgumentRule::ANY ) );
    methods.addFunction( new MemberProcedure( "burnin", RlUtils::Void, burninArgRules) );

}
开发者ID:hscarter,项目名称:revbayes,代码行数:13,代码来源:RlPowerPosteriorAnalysis.cpp

示例14: ArgumentRules

/** Get argument rules */
const ArgumentRules& Func_license::getArgumentRules( void ) const {
    
    static ArgumentRules argumentRules = ArgumentRules();
    static bool rulesSet = false;
    
    if ( !rulesSet ) {
        
        argumentRules.push_back( new ArgumentRule( "all", RlBoolean::getClassTypeSpec(), ArgumentRule::BY_VALUE, ArgumentRule::ANY, new RlBoolean(false) ) );
        rulesSet = true;
    }
    
    return argumentRules;
}
开发者ID:vivianaayus,项目名称:revbayes,代码行数:14,代码来源:Func_license.cpp

示例15: ArgumentRules

/** Get argument rules */
const ArgumentRules& Func_type::getArgumentRules( void ) const {
    
    static ArgumentRules argumentRules = ArgumentRules();
    static bool rulesSet = false;
    
    if ( !rulesSet ) {
        
        argumentRules.push_back( new ArgumentRule( "x", true, RevObject::getClassTypeSpec() ) );
        rulesSet = true;
    }
    
    return argumentRules;
}
开发者ID:SylerWang,项目名称:RevBayes,代码行数:14,代码来源:Func_type.cpp


注:本文中的ArgumentRules类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。