Optimist  0.0.0
A C++ library for optimization
Loading...
Searching...
No Matches
Optimist::Optimizer::ConstantWeight< Scalar > Class Template Reference

Inertia weight functor, which returns a constant weight. More...

#include <ParticleSwarm.hh>

Public Member Functions

 ConstantWeight ()
 ConstantWeight (const Scalar weight)
Scalar operator() (const Integer, const Integer) const

Private Attributes

Scalar m_weight {1.0}

Detailed Description

template<typename Scalar>
class Optimist::Optimizer::ConstantWeight< Scalar >
Template Parameters
ScalarFloating-point number type.

Constructor & Destructor Documentation

◆ ConstantWeight() [1/2]

template<typename Scalar>
Optimist::Optimizer::ConstantWeight< Scalar >::ConstantWeight ( )
inline

Class constructor with default constant inertia weight equal to 1.0.

◆ ConstantWeight() [2/2]

template<typename Scalar>
Optimist::Optimizer::ConstantWeight< Scalar >::ConstantWeight ( const Scalar weight)
inline

Class constructor that accepts the constant inertia weight.

Parameters
[in]weightConstant inertia weight.

Member Function Documentation

◆ operator()()

template<typename Scalar>
Scalar Optimist::Optimizer::ConstantWeight< Scalar >::operator() ( const Integer ,
const Integer  ) const
inline

Get the inertia weight.

Parameters
[in]iterationCurrent iteration.
[in]max_iterationsMaximum number of iterations.
Returns
The inertia weight.

Member Data Documentation

◆ m_weight

template<typename Scalar>
Scalar Optimist::Optimizer::ConstantWeight< Scalar >::m_weight {1.0}
private

Constant inertia weight.


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