[−][src]Struct argmin::solver::particleswarm::ParticleSwarm
Methods
impl<'a, O> ParticleSwarm<'a, O> where
O: ArgminOp<Output = f64>,
<O as ArgminOp>::Param: Position,
[src]
O: ArgminOp<Output = f64>,
<O as ArgminOp>::Param: Position,
pub fn new(
cost_function: O,
search_region: (O::Param, O::Param),
num_particles: usize,
weight_momentum: f64,
weight_particle: f64,
weight_swarm: f64
) -> Result<Self, Error>
[src]
cost_function: O,
search_region: (O::Param, O::Param),
num_particles: usize,
weight_momentum: f64,
weight_particle: f64,
weight_swarm: f64
) -> Result<Self, Error>
Constructor
Parameters:
cost_function
: cost functioninit_temp
: initial temperature
pub fn set_iter_callback(
&mut self,
callback: &'a mut dyn FnMut(&O::Param, f64, &Vec<Particle<O::Param>>)
)
[src]
&mut self,
callback: &'a mut dyn FnMut(&O::Param, f64, &Vec<Particle<O::Param>>)
)
Set callback
Trait Implementations
impl<'a, O> Solver<O> for ParticleSwarm<'a, O> where
O: ArgminOp<Output = f64>,
<O as ArgminOp>::Param: Position,
<O as ArgminOp>::Hessian: Clone + Default,
[src]
O: ArgminOp<Output = f64>,
<O as ArgminOp>::Param: Position,
<O as ArgminOp>::Hessian: Clone + Default,
const NAME: &'static str
[src]
fn next_iter(
&mut self,
_op: &mut OpWrapper<O>,
_state: &IterState<O>
) -> Result<ArgminIterData<O>, Error>
[src]
&mut self,
_op: &mut OpWrapper<O>,
_state: &IterState<O>
) -> Result<ArgminIterData<O>, Error>
Perform one iteration of algorithm
fn init(
&mut self,
_op: &mut OpWrapper<O>,
_state: &IterState<O>
) -> Result<Option<ArgminIterData<O>>, Error>
[src]
&mut self,
_op: &mut OpWrapper<O>,
_state: &IterState<O>
) -> Result<Option<ArgminIterData<O>>, Error>
Initializes the algorithm Read more
fn terminate_internal(&mut self, state: &IterState<O>) -> TerminationReason
[src]
Checks whether basic termination reasons apply. Read more
fn terminate(&mut self, _state: &IterState<O>) -> TerminationReason
[src]
Checks whether the algorithm must be terminated
impl<'a, O> Serialize for ParticleSwarm<'a, O> where
O: ArgminOp<Output = f64>,
<O as ArgminOp>::Param: Position,
O: Serialize,
O::Param: Serialize,
[src]
O: ArgminOp<Output = f64>,
<O as ArgminOp>::Param: Position,
O: Serialize,
O::Param: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de, 'a, O> Deserialize<'de> for ParticleSwarm<'a, O> where
O: ArgminOp<Output = f64>,
<O as ArgminOp>::Param: Position,
O: Deserialize<'de>,
O::Param: Deserialize<'de>,
[src]
O: ArgminOp<Output = f64>,
<O as ArgminOp>::Param: Position,
O: Deserialize<'de>,
O::Param: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl<'a, O> !Send for ParticleSwarm<'a, O>
impl<'a, O> !Sync for ParticleSwarm<'a, O>
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,