#![deny(rustdoc::broken_intra_doc_links)]
use std::{
fmt::LowerExp,
ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Sub, SubAssign},
};
use thiserror::Error;
mod abs;
pub(crate) mod complex;
mod exponential;
mod hyperbolic;
mod logarithm;
mod max_min;
mod neg_assign;
pub(crate) mod pow;
mod real;
mod reciprocal;
pub(crate) mod sqrt;
mod trigonometric;
pub use abs::{Abs, AbsComplexErrors, AbsInputErrors, AbsRealErrors};
pub use complex::{
Arg, ArgErrors, ArgInputErrors, ComplexScalarConstructors, ComplexScalarGetParts,
ComplexScalarMutateParts, ComplexScalarSetParts, Conjugate,
};
pub use exponential::{Exp, ExpErrors, ExpInputErrors};
pub use hyperbolic::{
ACosH, ACosHErrors, ACosHInputErrors, ASinH, ASinHErrors, ASinHInputErrors, ATanH, ATanHErrors,
ATanHInputErrors, CosH, CosHErrors, CosHInputErrors, HyperbolicFunctions, SinH, SinHErrors,
SinHInputErrors, TanH, TanHComplexErrors, TanHComplexInputErrors, TanHRealErrors,
TanHRealInputErrors,
};
pub use logarithm::{
Ln, Log2, Log10, LogarithmComplexErrors, LogarithmComplexInputErrors, LogarithmFunctions,
LogarithmRealErrors, LogarithmRealInputErrors,
};
pub use max_min::{Max, Min};
pub use neg_assign::NegAssign;
pub use pow::{
Pow, PowComplexBaseRealExponentErrors, PowComplexBaseRealExponentInputErrors, PowIntExponent,
PowIntExponentErrors, PowIntExponentInputErrors, PowRealBaseRealExponentErrors,
PowRealBaseRealExponentInputErrors,
};
pub use real::{Clamp, Classify, ExpM1, Hypot, Ln1p, TotalCmp};
pub use reciprocal::{Reciprocal, ReciprocalErrors, ReciprocalInputErrors};
pub use sqrt::{
Sqrt, SqrtComplexErrors, SqrtComplexInputErrors, SqrtRealErrors, SqrtRealInputErrors,
};
pub use trigonometric::{
ACos, ACosComplexErrors, ACosComplexInputErrors, ACosRealErrors, ACosRealInputErrors, ASin,
ASinComplexErrors, ASinComplexInputErrors, ASinRealErrors, ASinRealInputErrors, ATan, ATan2,
ATan2Errors, ATan2InputErrors, ATanComplexErrors, ATanComplexInputErrors, ATanRealErrors,
ATanRealInputErrors, Cos, CosErrors, CosInputErrors, Sin, SinErrors, SinInputErrors, Tan,
TanComplexErrors, TanComplexInputErrors, TanRealErrors, TanRealInputErrors,
TrigonometricFunctions,
};
pub trait Arithmetic = Sized
+ Add<Output = Self>
+ for<'a> Add<&'a Self, Output = Self>
+ AddAssign
+ for<'a> AddAssign<&'a Self>
+ Sub<Output = Self>
+ for<'a> Sub<&'a Self, Output = Self>
+ SubAssign
+ for<'a> SubAssign<&'a Self>
+ Mul<Output = Self>
+ for<'a> Mul<&'a Self, Output = Self>
+ MulAssign
+ for<'a> MulAssign<&'a Self>
+ Div<Output = Self>
+ for<'a> Div<&'a Self, Output = Self>
+ DivAssign
+ for<'a> DivAssign<&'a Self>
+ Neg<Output = Self>
+ NegAssign
+ LowerExp;
#[derive(Debug, Error)]
pub enum FunctionErrors<InputError: std::error::Error, OutputError: std::error::Error> {
#[error("the input value is not valid accordingly to the used validation policy!")]
Input {
#[from] source: InputError,
},
#[error("the output value is not valid accordingly to the used validation policy!")]
Output {
#[source] #[backtrace] source: OutputError,
},
}
pub trait MulAddRef {
fn mul_add_ref(self, b: &Self, c: &Self) -> Self;
}
pub trait Rounding {
fn kernel_ceil(self) -> Self;
fn kernel_floor(self) -> Self;
fn kernel_fract(self) -> Self;
fn kernel_round(self) -> Self;
fn kernel_round_ties_even(self) -> Self;
fn kernel_trunc(self) -> Self;
}
pub trait Sign {
fn kernel_copysign(self, sign: &Self) -> Self;
fn kernel_signum(self) -> Self;
fn kernel_is_sign_negative(&self) -> bool;
fn kernel_is_sign_positive(&self) -> bool;
}