aicad 1.0.0-rc.1

A library to solve Constraint satisfaction problems with Multi-valued decision diagrams and, optionnaly, neural networks
Documentation
//! The Python functions that set and read the number of threads of the worker pool.

use pyo3::prelude::*;

/// Sets the number of threads of the worker pool (see [`crate::utils::set_num_threads`]). The
/// Python wrapper has already checked that `n` is a positive integer.
#[pyfunction]
pub(crate) fn set_num_threads(n: usize) {
    crate::utils::set_num_threads(n);
}

/// The number of threads of the worker pool: the value last set, or the default.
#[pyfunction]
pub(crate) fn get_num_threads() -> usize {
    crate::utils::num_threads()
}

/// Seeds every source of randomness of the crate, so that a later run reproduces itself given the
/// same seed. See [`crate::set_seed`].
#[pyfunction]
pub(crate) fn set_seed(seed: u64) {
    crate::set_seed(seed);
}