Skip to content

Commit

Permalink
Don't use debug asserts #7
Browse files Browse the repository at this point in the history
  • Loading branch information
jurihock committed Jun 19, 2023
1 parent 4f27ba4 commit 09a6235
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ impl<T, F> QDFT<T, F>
pub fn size(&self) -> usize { self.size }

pub fn qdft_scalar(&mut self, sample: &T, dft: &mut [Complex::<F>]) {
debug_assert_eq!(dft.len(), self.size);
assert_eq!(dft.len(), self.size);

let inputs = &mut self.inputs;
let outputs = &mut self.outputs;
Expand Down Expand Up @@ -186,7 +186,7 @@ impl<T, F> QDFT<T, F>
}

pub fn iqdft_scalar(&mut self, dft: &[Complex::<F>], sample: &mut T) {
debug_assert_eq!(dft.len(), self.size);
assert_eq!(dft.len(), self.size);

let mut result = F::zero();

Expand All @@ -207,7 +207,7 @@ impl<T, F> QDFT<T, F>

#[inline]
pub fn qdft_vector(&mut self, samples: &[T], dfts: &mut [Complex::<F>]) {
debug_assert_eq!(dfts.len(), samples.len() * self.size);
assert_eq!(dfts.len(), samples.len() * self.size);
for i in 0 .. samples.len() {
let j = i * self.size .. (i + 1) * self.size;
self.qdft_scalar(&samples[i], &mut dfts[j]);
Expand All @@ -216,7 +216,7 @@ impl<T, F> QDFT<T, F>

#[inline]
pub fn iqdft_vector(&mut self, dfts: &[Complex::<F>], samples: &mut [T]) {
debug_assert_eq!(dfts.len(), samples.len() * self.size);
assert_eq!(dfts.len(), samples.len() * self.size);
for i in 0 .. samples.len() {
let j = i * self.size .. (i + 1) * self.size;
self.iqdft_scalar(&dfts[j], &mut samples[i]);
Expand Down

0 comments on commit 09a6235

Please sign in to comment.