Skip to content

Commit bfd48ca

Browse files
committed
Comparison compuite
Signed-off-by: Nicholas Gates <[email protected]>
1 parent fe5dfde commit bfd48ca

File tree

3 files changed

+1
-89
lines changed

3 files changed

+1
-89
lines changed

vortex-compute/Cargo.toml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,7 @@ vortex-vector = { workspace = true }
2828
num-traits = { workspace = true }
2929

3030
[features]
31-
default = [
32-
"arithmetic",
33-
"comparison",
34-
"filter",
35-
"logical",
36-
]
31+
default = ["arithmetic", "comparison", "filter", "logical"]
3732

3833
arithmetic = []
3934
comparison = []

vortex-compute/src/arithmetic/mod.rs

Lines changed: 0 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -100,84 +100,3 @@ macro_rules! impl_floats {
100100
impl_floats!(f16);
101101
impl_floats!(f32);
102102
impl_floats!(f64);
103-
104-
/// Performs addition that returns None instead of wrapping around on overflow.
105-
pub trait CheckedAdd<Rhs = Self> {
106-
/// The result type after performing the operation.
107-
type Output;
108-
109-
/// Perform the operation.
110-
fn checked_add(self, other: Rhs) -> Option<Self::Output>;
111-
}
112-
113-
impl<A, Rhs, Output> CheckedAdd<Rhs> for A
114-
where
115-
A: Checked<Add, Rhs, Output = Output>,
116-
{
117-
type Output = Output;
118-
119-
fn checked_add(self, other: Rhs) -> Option<Self::Output> {
120-
self.checked_op(other)
121-
}
122-
}
123-
124-
/// Performs subtraction that returns None instead of wrapping around on underflow.
125-
pub trait CheckedSub<Rhs = Self> {
126-
/// The result type after performing the operation.
127-
type Output;
128-
129-
/// Perform the operation.
130-
fn checked_sub(self, other: Rhs) -> Option<Self::Output>;
131-
}
132-
133-
impl<A, Rhs, Output> CheckedSub<Rhs> for A
134-
where
135-
A: Checked<Sub, Rhs, Output = Output>,
136-
{
137-
type Output = Output;
138-
139-
fn checked_sub(self, other: Rhs) -> Option<Self::Output> {
140-
self.checked_op(other)
141-
}
142-
}
143-
144-
/// Performs multiplication that returns None instead of wrapping around on underflow or overflow.
145-
pub trait CheckedMul<Rhs = Self> {
146-
/// The result type after performing the operation.
147-
type Output;
148-
149-
/// Perform the operation.
150-
fn checked_mul(self, other: Rhs) -> Option<Self::Output>;
151-
}
152-
153-
impl<A, Rhs, Output> CheckedMul<Rhs> for A
154-
where
155-
A: Checked<Mul, Rhs, Output = Output>,
156-
{
157-
type Output = Output;
158-
159-
fn checked_mul(self, other: Rhs) -> Option<Self::Output> {
160-
self.checked_op(other)
161-
}
162-
}
163-
164-
/// Performs division that returns None instead of panicking on division by zero and instead of
165-
/// wrapping around on underflow and overflow.
166-
pub trait CheckedDiv<Rhs = Self> {
167-
/// The result type after performing the operation.
168-
type Output;
169-
170-
/// Perform the operation.
171-
fn checked_div(self, other: Rhs) -> Option<Self::Output>;
172-
}
173-
174-
impl<A, Rhs, Output> CheckedDiv<Rhs> for A
175-
where
176-
A: Checked<Div, Rhs, Output = Output>,
177-
{
178-
type Output = Output;
179-
180-
fn checked_div(self, other: Rhs) -> Option<Self::Output> {
181-
self.checked_op(other)
182-
}
183-
}

vortex-compute/src/comparison/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ mod collection;
1010
mod pvector;
1111

1212
/// Trait for comparison operations.
13-
///
14-
/// It may be easier to use the specific traits like [`CompareLessThan`], [`CompareGreaterThan`], etc.
1513
pub trait Compare<Op, Rhs = Self> {
1614
/// The result type after performing the operation.
1715
type Output;

0 commit comments

Comments
 (0)