Replies: 3 comments 5 replies
-
Thanks for sharing your idea. I understand what you mean but it feels complex and hard to explain to me. Right now, |
Beta Was this translation helpful? Give feedback.
-
I just came across an old discussion about the same idea: #2753 |
Beta Was this translation helpful? Give feedback.
-
Or, the diagonal matrix with entries 1, -1, 1 along the diagonal (I think mathjs has a function to produce that) times [[1,2],[3,4],[5,6]] also gives what you wanted in your original question. |
Beta Was this translation helpful? Give feedback.
-
Hello, I think it would be useful if something like
math.dotMultiply([1, -1, 1], [[1, 2], [3, 4], [5, 6]])
would return[[1, 2], [-3, -4], [5, 6]]
as currently this results in a dimension mismatch.The logic could be, check if the shape of the second argument can be obtained from the shape of the first agument by replacing all scalars with something that can be multiplied with a scalar (e.g. a scalar, a vector, a matrix), in that case, do scalar multiplication.
Beta Was this translation helpful? Give feedback.
All reactions