Skip to main content

Pool

Struct Pool 

Source
pub struct Pool<const N: usize, const NSYMS: usize> {
    pub progresses: Vec<CycleProgress<N, NSYMS>>,
    pub handles: Vec<JoinHandle<Candidate<N, NSYMS>>>,
    pub sigint: Arc<AtomicBool>,
}
Expand description

Run the algorithm on a set of populations simultaneously using multithreading.

Set sigint to true to stop the iterations manually.

Fields§

§progresses: Vec<CycleProgress<N, NSYMS>>§handles: Vec<JoinHandle<Candidate<N, NSYMS>>>§sigint: Arc<AtomicBool>

Implementations§

Source§

impl<const N: usize, const NSYMS: usize> Pool<N, NSYMS>

Source

pub fn new( gas: Arc<Gas<N, NSYMS>>, nthreads: usize, sigint: Arc<AtomicBool>, ) -> Pool<N, NSYMS>

Source

pub fn is_finished(&self) -> bool

Source

pub fn winner(&mut self, gas: Arc<Gas<N, NSYMS>>) -> Candidate<N, NSYMS>

Auto Trait Implementations§

§

impl<const N: usize, const NSYMS: usize> Freeze for Pool<N, NSYMS>

§

impl<const N: usize, const NSYMS: usize> !RefUnwindSafe for Pool<N, NSYMS>

§

impl<const N: usize, const NSYMS: usize> Send for Pool<N, NSYMS>

§

impl<const N: usize, const NSYMS: usize> Sync for Pool<N, NSYMS>

§

impl<const N: usize, const NSYMS: usize> Unpin for Pool<N, NSYMS>

§

impl<const N: usize, const NSYMS: usize> UnsafeUnpin for Pool<N, NSYMS>

§

impl<const N: usize, const NSYMS: usize> !UnwindSafe for Pool<N, NSYMS>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V