You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Use LazyStrings in error messages
* Use string function instead of String constructor
* LazyString in DimensionMismatch messages
* Add tests
* Use ColumnNorm only on Julia v1.10+
* Fix tests
* Reinstate missing variable
* Add tests for throw_mul_axes_err with custom axes
Copy file name to clipboardExpand all lines: src/mul.jl
+14-4Lines changed: 14 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -92,18 +92,28 @@ check_mul_axes(A) = nothing
92
92
_check_mul_axes(::Number, ::Number) =nothing
93
93
_check_mul_axes(::Number, _) =nothing
94
94
_check_mul_axes(_, ::Number) =nothing
95
-
_check_mul_axes(A, B) =axes(A, 2) ==axes(B, 1) ||throw(DimensionMismatch("Second axis of A, $(axes(A,2)), and first axis of B, $(axes(B,1)) must match"))
95
+
_check_mul_axes(A, B) =axes(A, 2) ==axes(B, 1) ||throw_mul_axes_err(axes(A,2), axes(B,1))
96
+
@noinlinefunctionthrow_mul_axes_err(axA2, axB1)
97
+
throw(
98
+
DimensionMismatch(
99
+
LazyString("second axis of A, ", axA2, ", and first axis of B, ", axB1, ", must match")))
@boundscheckaxes(M.A,1) ==axes(M.C,1) ||throw(DimensionMismatch("First axis of A, $(axes(M.A,1)), and first axis of C, $(axes(M.C,1))must match"))
56
-
@boundscheckaxes(M.B,2) ==axes(M.C,2) ||throw(DimensionMismatch("Second axis of B, $(axes(M.B,2)), and second axis of C, $(axes(M.C,2))must match"))
55
+
@boundscheckaxes(M.A,1) ==axes(M.C,1) ||throw(DimensionMismatch(LazyString("First axis of A, ", axes(M.A,1), ", and first axis of C, ", axes(M.C,1), "must match")))
56
+
@boundscheckaxes(M.B,2) ==axes(M.C,2) ||throw(DimensionMismatch(LazyString("Second axis of B, ", axes(M.B,2), ", and second axis of C, ", axes(M.C,2), "must match")))
0 commit comments