mirror of
https://github.com/Magnus167/rustframe.git
synced 2025-08-20 04:19:59 +00:00
Enhance error messages in Broadcastable trait to clarify row and column count mismatches
This commit is contained in:
parent
bdd0a23096
commit
ecb1939ec2
@ -357,9 +357,9 @@ impl<T: Clone> Broadcastable<T> for T {
|
||||
|
||||
impl<T: Clone> Broadcastable<T> for Matrix<T> {
|
||||
fn to_vec(&self, rows: usize, cols: usize) -> Vec<T> {
|
||||
assert_eq!(self.rows, rows, "row count mismatch");
|
||||
assert_eq!(self.cols, cols, "col count mismatch");
|
||||
self.data.clone()
|
||||
assert_eq!(self.rows, rows, "row count mismatch in broadcast");
|
||||
assert_eq!(self.cols, cols, "col count mismatch in broadcast");
|
||||
self.data.clone() // Clone the data for the broadcasted vec
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user