-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor!: replace f64 by generics
Scalar
(#13)
* add generic t(raits for domain & image values * add DomainValue to parameters enums * update sigs with the new trait * add image & integrated values generics to the main structure * add num dependency * fix implem code * fix tests * add minimal doc entry for the traits * merge all generic traits into on * update implem * fix warnings is this lint even working correctly?
- Loading branch information
Showing
8 changed files
with
86 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
//! module doc | ||
/// Scalar value trait. | ||
/// | ||
/// This trait is automatically implemented for all types implementing its requirements. | ||
pub trait Scalar: | ||
Clone | ||
+ Copy | ||
+ num::Float | ||
+ num::Signed | ||
+ num::FromPrimitive | ||
+ std::ops::Sub<Output = Self> | ||
+ std::ops::Mul<Output = Self> | ||
+ std::iter::Sum | ||
{ | ||
} | ||
|
||
impl< | ||
X: Clone | ||
+ Copy | ||
+ num::Float | ||
+ num::Signed | ||
+ num::FromPrimitive | ||
+ std::ops::Sub<Output = Self> | ||
+ std::ops::Mul<Output = Self> | ||
+ std::iter::Sum, | ||
> Scalar for X | ||
{ | ||
} |