pub struct MaybeThreadPool { /* private fields */ }Expand description
A wrapper for the requested thread-count policy used by optimization callbacks.
Implementations§
Source§impl MaybeThreadPool
impl MaybeThreadPool
Sourcepub fn new(num_threads: usize) -> Self
pub fn new(num_threads: usize) -> Self
Crate a new thread pool with the given number of threads. This is typically used as
user-data for ganesh optimizations.
Sourcepub fn install<R: Send>(
&self,
op: impl FnOnce() -> LadduResult<R> + Send,
) -> LadduResult<R>
pub fn install<R: Send>( &self, op: impl FnOnce() -> LadduResult<R> + Send, ) -> LadduResult<R>
Run the given operation on the current thread pool.
Trait Implementations§
Source§impl Clone for MaybeThreadPool
impl Clone for MaybeThreadPool
Source§fn clone(&self) -> MaybeThreadPool
fn clone(&self) -> MaybeThreadPool
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl CostFunction<MaybeThreadPool, LadduError> for LikelihoodExpression
impl CostFunction<MaybeThreadPool, LadduError> for LikelihoodExpression
Source§fn evaluate(
&self,
parameters: &DVector<f64>,
args: &MaybeThreadPool,
) -> LadduResult<f64>
fn evaluate( &self, parameters: &DVector<f64>, args: &MaybeThreadPool, ) -> LadduResult<f64>
The evaluation of the function at a point
x with the given arguments/user data. Read moreSource§impl CostFunction<MaybeThreadPool, LadduError> for NLL
impl CostFunction<MaybeThreadPool, LadduError> for NLL
Source§fn evaluate(
&self,
parameters: &DVector<f64>,
args: &MaybeThreadPool,
) -> LadduResult<f64>
fn evaluate( &self, parameters: &DVector<f64>, args: &MaybeThreadPool, ) -> LadduResult<f64>
The evaluation of the function at a point
x with the given arguments/user data. Read moreSource§impl CostFunction<MaybeThreadPool, LadduError> for StochasticNLL
impl CostFunction<MaybeThreadPool, LadduError> for StochasticNLL
Source§fn evaluate(
&self,
parameters: &DVector<f64>,
args: &MaybeThreadPool,
) -> LadduResult<f64>
fn evaluate( &self, parameters: &DVector<f64>, args: &MaybeThreadPool, ) -> LadduResult<f64>
The evaluation of the function at a point
x with the given arguments/user data. Read moreSource§impl Debug for MaybeThreadPool
impl Debug for MaybeThreadPool
Source§impl Gradient<MaybeThreadPool, LadduError> for LikelihoodExpression
impl Gradient<MaybeThreadPool, LadduError> for LikelihoodExpression
Source§fn gradient(
&self,
parameters: &DVector<f64>,
args: &MaybeThreadPool,
) -> LadduResult<DVector<f64>>
fn gradient( &self, parameters: &DVector<f64>, args: &MaybeThreadPool, ) -> LadduResult<DVector<f64>>
The evaluation of the gradient at a point
x with the given arguments/user data. Read moreSource§fn evaluate_with_gradient(
&self,
x: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>,
args: &U,
) -> Result<(f64, Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>), E>
fn evaluate_with_gradient( &self, x: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, args: &U, ) -> Result<(f64, Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>), E>
The evaluation of both the function and its gradient at a point
x with the given
arguments/user data. Read moreSource§fn hessian(
&self,
x: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>,
args: &U,
) -> Result<Matrix<f64, Dyn, Dyn, VecStorage<f64, Dyn, Dyn>>, E>
fn hessian( &self, x: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, args: &U, ) -> Result<Matrix<f64, Dyn, Dyn, VecStorage<f64, Dyn, Dyn>>, E>
The evaluation of the hessian at a point
x with the given arguments/user data. Read moreSource§fn gradient_with_hessian(
&self,
x: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>,
args: &U,
) -> Result<(Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, Matrix<f64, Dyn, Dyn, VecStorage<f64, Dyn, Dyn>>), E>
fn gradient_with_hessian( &self, x: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, args: &U, ) -> Result<(Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, Matrix<f64, Dyn, Dyn, VecStorage<f64, Dyn, Dyn>>), E>
The evaluation of both the gradient and hessian at a point
x with the given
arguments/user data. Read moreSource§fn evaluate_with_gradient_and_hessian(
&self,
x: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>,
args: &U,
) -> Result<(f64, Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, Matrix<f64, Dyn, Dyn, VecStorage<f64, Dyn, Dyn>>), E>
fn evaluate_with_gradient_and_hessian( &self, x: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, args: &U, ) -> Result<(f64, Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, Matrix<f64, Dyn, Dyn, VecStorage<f64, Dyn, Dyn>>), E>
The evaluation of the function, gradient, and hessian at a point
x with the given
arguments/user data. Read moreSource§impl Gradient<MaybeThreadPool, LadduError> for NLL
impl Gradient<MaybeThreadPool, LadduError> for NLL
Source§fn gradient(
&self,
parameters: &DVector<f64>,
args: &MaybeThreadPool,
) -> LadduResult<DVector<f64>>
fn gradient( &self, parameters: &DVector<f64>, args: &MaybeThreadPool, ) -> LadduResult<DVector<f64>>
The evaluation of the gradient at a point
x with the given arguments/user data. Read moreSource§fn evaluate_with_gradient(
&self,
x: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>,
args: &U,
) -> Result<(f64, Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>), E>
fn evaluate_with_gradient( &self, x: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, args: &U, ) -> Result<(f64, Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>), E>
The evaluation of both the function and its gradient at a point
x with the given
arguments/user data. Read moreSource§fn hessian(
&self,
x: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>,
args: &U,
) -> Result<Matrix<f64, Dyn, Dyn, VecStorage<f64, Dyn, Dyn>>, E>
fn hessian( &self, x: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, args: &U, ) -> Result<Matrix<f64, Dyn, Dyn, VecStorage<f64, Dyn, Dyn>>, E>
The evaluation of the hessian at a point
x with the given arguments/user data. Read moreSource§fn gradient_with_hessian(
&self,
x: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>,
args: &U,
) -> Result<(Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, Matrix<f64, Dyn, Dyn, VecStorage<f64, Dyn, Dyn>>), E>
fn gradient_with_hessian( &self, x: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, args: &U, ) -> Result<(Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, Matrix<f64, Dyn, Dyn, VecStorage<f64, Dyn, Dyn>>), E>
The evaluation of both the gradient and hessian at a point
x with the given
arguments/user data. Read moreSource§fn evaluate_with_gradient_and_hessian(
&self,
x: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>,
args: &U,
) -> Result<(f64, Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, Matrix<f64, Dyn, Dyn, VecStorage<f64, Dyn, Dyn>>), E>
fn evaluate_with_gradient_and_hessian( &self, x: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, args: &U, ) -> Result<(f64, Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, Matrix<f64, Dyn, Dyn, VecStorage<f64, Dyn, Dyn>>), E>
The evaluation of the function, gradient, and hessian at a point
x with the given
arguments/user data. Read moreSource§impl Gradient<MaybeThreadPool, LadduError> for StochasticNLL
impl Gradient<MaybeThreadPool, LadduError> for StochasticNLL
Source§fn gradient(
&self,
parameters: &DVector<f64>,
args: &MaybeThreadPool,
) -> LadduResult<DVector<f64>>
fn gradient( &self, parameters: &DVector<f64>, args: &MaybeThreadPool, ) -> LadduResult<DVector<f64>>
The evaluation of the gradient at a point
x with the given arguments/user data. Read moreSource§fn evaluate_with_gradient(
&self,
x: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>,
args: &U,
) -> Result<(f64, Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>), E>
fn evaluate_with_gradient( &self, x: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, args: &U, ) -> Result<(f64, Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>), E>
The evaluation of both the function and its gradient at a point
x with the given
arguments/user data. Read moreSource§fn hessian(
&self,
x: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>,
args: &U,
) -> Result<Matrix<f64, Dyn, Dyn, VecStorage<f64, Dyn, Dyn>>, E>
fn hessian( &self, x: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, args: &U, ) -> Result<Matrix<f64, Dyn, Dyn, VecStorage<f64, Dyn, Dyn>>, E>
The evaluation of the hessian at a point
x with the given arguments/user data. Read moreSource§fn gradient_with_hessian(
&self,
x: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>,
args: &U,
) -> Result<(Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, Matrix<f64, Dyn, Dyn, VecStorage<f64, Dyn, Dyn>>), E>
fn gradient_with_hessian( &self, x: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, args: &U, ) -> Result<(Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, Matrix<f64, Dyn, Dyn, VecStorage<f64, Dyn, Dyn>>), E>
The evaluation of both the gradient and hessian at a point
x with the given
arguments/user data. Read moreSource§fn evaluate_with_gradient_and_hessian(
&self,
x: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>,
args: &U,
) -> Result<(f64, Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, Matrix<f64, Dyn, Dyn, VecStorage<f64, Dyn, Dyn>>), E>
fn evaluate_with_gradient_and_hessian( &self, x: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, args: &U, ) -> Result<(f64, Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, Matrix<f64, Dyn, Dyn, VecStorage<f64, Dyn, Dyn>>), E>
The evaluation of the function, gradient, and hessian at a point
x with the given
arguments/user data. Read moreSource§impl LogDensity<MaybeThreadPool, LadduError> for LikelihoodExpression
impl LogDensity<MaybeThreadPool, LadduError> for LikelihoodExpression
Source§fn log_density(
&self,
parameters: &DVector<f64>,
args: &MaybeThreadPool,
) -> LadduResult<f64>
fn log_density( &self, parameters: &DVector<f64>, args: &MaybeThreadPool, ) -> LadduResult<f64>
The log of the evaluation of the density function at a point
x with the given arguments/user data. Read moreSource§impl LogDensity<MaybeThreadPool, LadduError> for NLL
impl LogDensity<MaybeThreadPool, LadduError> for NLL
Source§fn log_density(
&self,
parameters: &DVector<f64>,
args: &MaybeThreadPool,
) -> LadduResult<f64>
fn log_density( &self, parameters: &DVector<f64>, args: &MaybeThreadPool, ) -> LadduResult<f64>
The log of the evaluation of the density function at a point
x with the given arguments/user data. Read moreSource§impl LogDensity<MaybeThreadPool, LadduError> for StochasticNLL
impl LogDensity<MaybeThreadPool, LadduError> for StochasticNLL
Source§fn log_density(
&self,
parameters: &DVector<f64>,
args: &MaybeThreadPool,
) -> LadduResult<f64>
fn log_density( &self, parameters: &DVector<f64>, args: &MaybeThreadPool, ) -> LadduResult<f64>
The log of the evaluation of the density function at a point
x with the given arguments/user data. Read moreimpl Copy for MaybeThreadPool
Auto Trait Implementations§
impl Freeze for MaybeThreadPool
impl RefUnwindSafe for MaybeThreadPool
impl Send for MaybeThreadPool
impl Sync for MaybeThreadPool
impl Unpin for MaybeThreadPool
impl UnsafeUnpin for MaybeThreadPool
impl UnwindSafe for MaybeThreadPool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.