CppADCodeGen  HEAD
A C++ Algorithmic Differentiation Package with Source Code Generation
CppAD::cg::ModelLibrary< Base > Class Template Referenceabstract
Inheritance diagram for CppAD::cg::ModelLibrary< Base >:
Inheritance graph
Collaboration diagram for CppAD::cg::ModelLibrary< Base >:
Collaboration graph

Public Member Functions

virtual std::set< std::string > getModelNames ()=0
 
virtual std::unique_ptr< GenericModel< Base > > model (const std::string &modelName)=0
 
virtual void setThreadPoolDisabled (bool disabled)=0
 
virtual bool isThreadPoolDisabled () const =0
 
virtual unsigned int getThreadNumber () const =0
 
virtual void setThreadNumber (unsigned int n)=0
 
virtual ThreadPoolScheduleStrategy getThreadPoolSchedulerStrategy () const =0
 
virtual void setThreadPoolSchedulerStrategy (ThreadPoolScheduleStrategy s)=0
 
virtual void setThreadPoolVerbose (bool v)=0
 
virtual bool isThreadPoolVerbose () const =0
 
virtual void setThreadPoolGuidedMaxWork (float v)=0
 
virtual float getThreadPoolGuidedMaxWork () const =0
 
virtual void setThreadPoolNumberOfTimeMeas (unsigned int n)=0
 
virtual unsigned int getThreadPoolNumberOfTimeMeas () const =0
 

Detailed Description

template<class Base>
class CppAD::cg::ModelLibrary< Base >

Abstract class used to load models

Author
Joao Leal

Definition at line 28 of file model_library.hpp.

Member Function Documentation

◆ getModelNames()

template<class Base >
virtual std::set<std::string> CppAD::cg::ModelLibrary< Base >::getModelNames ( )
pure virtual

Provides the model names in the dynamic library.

Returns
the model names

Implemented in CppAD::cg::FunctorModelLibrary< Base >.

◆ getThreadNumber()

template<class Base >
virtual unsigned int CppAD::cg::ModelLibrary< Base >::getThreadNumber ( ) const
pure virtual

Provides the maximum number of threads used to determine sparse Jacobians and sparse Hessians for the models in this library. This value is only used by the models if they were compiled with multithreading support.

Returns
the maximum number of threads

Implemented in CppAD::cg::FunctorModelLibrary< Base >.

◆ getThreadPoolNumberOfTimeMeas()

template<class Base >
virtual unsigned int CppAD::cg::ModelLibrary< Base >::getThreadPoolNumberOfTimeMeas ( ) const
pure virtual

Provides the number of time measurements taken by each computational task during multithreaded model evaluations. This is used to schedule work accross threads. The higher the value the more accurate the time estimations are but it requires additional calls to retrieve times. This value is only used by the models if they were compiled with multithreading support.

Returns
the number of time measurements to take per task.

Implemented in CppAD::cg::FunctorModelLibrary< Base >.

◆ getThreadPoolSchedulerStrategy()

template<class Base >
virtual ThreadPoolScheduleStrategy CppAD::cg::ModelLibrary< Base >::getThreadPoolSchedulerStrategy ( ) const
pure virtual

Provides the thread scheduling strategy used to determine sparse Jacobians and sparse Hessians for the models in this library. This value is only used by the models if they were compiled with multithreading support.

Returns
the thread scheduling strategy

Implemented in CppAD::cg::FunctorModelLibrary< Base >.

◆ isThreadPoolDisabled()

template<class Base >
virtual bool CppAD::cg::ModelLibrary< Base >::isThreadPoolDisabled ( ) const
pure virtual

Determines whether or not multithreaded model evaluations are disabled.

Returns
true if only the current thread is used to evaluate models.

Implemented in CppAD::cg::FunctorModelLibrary< Base >.

◆ model()

template<class Base >
virtual std::unique_ptr<GenericModel<Base> > CppAD::cg::ModelLibrary< Base >::model ( const std::string &  modelName)
pure virtual

Creates a new GenericModel object that can be used to evaluate the model.

Parameters
modelNameThe model name.
Returns
The model object or nullptr if no model exists with the provided name.

Implemented in CppAD::cg::FunctorModelLibrary< Base >.

◆ setThreadNumber()

template<class Base >
virtual void CppAD::cg::ModelLibrary< Base >::setThreadNumber ( unsigned int  n)
pure virtual

Defines the maximum number of threads used to determine sparse Jacobians and sparse Hessians for the models in this library. This value is only used by the models if they were compiled with multithreading support. It should be defined before using the models.

Parameters
nthe maximum number of threads

Implemented in CppAD::cg::FunctorModelLibrary< Base >.

◆ setThreadPoolDisabled()

template<class Base >
virtual void CppAD::cg::ModelLibrary< Base >::setThreadPoolDisabled ( bool  disabled)
pure virtual

Defines whether or not to disable multithreaded model evaluations. This only works if the models if they were compiled with multithreading support.

Parameters
disabledtrue to only use the current thread to evaluate models.

Implemented in CppAD::cg::FunctorModelLibrary< Base >.

◆ setThreadPoolNumberOfTimeMeas()

template<class Base >
virtual void CppAD::cg::ModelLibrary< Base >::setThreadPoolNumberOfTimeMeas ( unsigned int  n)
pure virtual

Defines the number of time measurements taken by each computational task during multithreaded model evaluations. This is used to schedule work across threads. The higher the value the more accurate the time estimations are but it requires additional calls to retrieve times. This value is only used by the models if they were compiled with multithreading support.

Parameters
nthe number of time measurements to take per task.

Implemented in CppAD::cg::FunctorModelLibrary< Base >.

◆ setThreadPoolSchedulerStrategy()

template<class Base >
virtual void CppAD::cg::ModelLibrary< Base >::setThreadPoolSchedulerStrategy ( ThreadPoolScheduleStrategy  s)
pure virtual

Defines the thread scheduling strategy used to determine sparse Jacobians and sparse Hessians for the models in this library. This value is only used by the models if they were compiled with multithreading support. It should be defined before using the models.

Parameters
sthe thread scheduling strategy

Implemented in CppAD::cg::FunctorModelLibrary< Base >.


The documentation for this class was generated from the following file: