use thiserror::Error;
use crate::FloatNumber;
#[derive(Debug, PartialEq, Error)]
pub enum KmeansError<T>
where
T: FloatNumber,
{
#[error("The number of segments must be greater than zero")]
InvalidSegments,
#[error("The number of iterations must be greater than zero")]
InvalidIterations,
#[error("Tolerance must be greater than zero and not NaN: {0}")]
InvalidTolerance(T),
#[error("Unexpected pixels length: {actual}, expected: {expected}")]
UnexpectedLength { actual: usize, expected: usize },
}