We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b370565 commit 729edc0Copy full SHA for 729edc0
ndarray-linalg/src/eig.rs
@@ -203,3 +203,25 @@ where
203
))
204
}
205
206
+
207
+#[cfg(test)]
208
+mod tests {
209
+ use crate::MaybeOwnedMatrix;
210
211
+ #[test]
212
+ fn test_maybe_owned_matrix() {
213
+ let a = array![[1.0, 2.0], [3.0, 4.0]];
214
+ let a_ptr = a.as_ptr();
215
+ let a1 = MaybeOwnedMatrix::into_owned(a);
216
+ assert_eq!(a_ptr, a1.as_ptr());
217
218
+ let b = a1.clone();
219
+ let b1 = MaybeOwnedMatrix::into_owned(&b);
220
+ assert_eq!(b, b1);
221
+ assert_ne!(b.as_ptr(), b1.as_ptr());
222
223
+ let b2 = MaybeOwnedMatrix::into_owned(&*b);
224
+ assert_eq!(b, b2);
225
+ assert_ne!(b.as_ptr(), b2.as_ptr());
226
+ }
227
+}
0 commit comments