Skip to content

Commit f7ff6a0

Browse files
committed
Check input array size
1 parent 0b90ff5 commit f7ff6a0

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/inner.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ where
2121
{
2222
type Elem = A;
2323
fn inner<St: Data<Elem = A>>(&self, rhs: &ArrayBase<St, Ix1>) -> A {
24+
assert_eq!(self.len(), rhs.len());
2425
Zip::from(self)
2526
.and(rhs)
2627
.fold_while(A::zero(), |acc, s, r| FoldWhile::Continue(acc + s.conj() * *r))

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ pub use convert::*;
6363
pub use diagonal::*;
6464
pub use eigh::*;
6565
pub use generate::*;
66+
pub use inner::*;
6667
pub use layout::*;
6768
pub use norm::*;
6869
pub use operator::*;

0 commit comments

Comments
 (0)