Created
April 5, 2016 13:03
-
-
Save davll/a57025771dc9e279a30c75f084c9ba8a to your computer and use it in GitHub Desktop.
vectormath lib pastes
This file contains hidden or 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
| /// Comparison | |
| pub trait Cmp { | |
| /// Corresponding boolean type | |
| type Bool; | |
| /// Test equality | |
| fn eq(self, rhs: Self) -> Self::Bool; | |
| /// Test inequality | |
| fn ne(self, rhs: Self) -> Self::Bool; | |
| /// Test greater than | |
| fn gt(self, rhs: Self) -> Self::Bool; | |
| /// Test less than | |
| fn lt(self, rhs: Self) -> Self::Bool; | |
| /// Test greater than or equal to | |
| fn ge(self, rhs: Self) -> Self::Bool; | |
| /// Test less than or equal to | |
| fn le(self, rhs: Self) -> Self::Bool; | |
| } | |
| /// Selection | |
| pub trait Select : Cmp { | |
| /// Element-wise selection | |
| fn sel(self, rhs: Self, cond: Self::Bool); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment