▲ | AnimalMuppet 4 days ago | |
Depends on what you're trying to understand. Let's say I have matrices, and I've overloaded * for multiplying a matrix by a matrix, and a matrix by a vector, and a matrix by a number. And now I write
If I'm trying to understand this as one of a series of steps of linear algebra that I'm trying to make sure are right, that is far more comprehensible than
because it uses math notation, and that's closer to the way linear algebra is written.But if I take the exact same line and try to understand exactly which functions get called, because I'm worried about numerical stability or performance or something, then the first approach hides the details and the second one is easier to understand. This is always the way it goes with abstraction. Abstraction hides the details, so we can think at a higher level. And that's good, when you're trying to think at the higher level. When you're not, then abstraction just hides what you're really trying to understand. | ||
▲ | fluorinerocket 4 days ago | parent [-] | |
but is it element by element multiplication, or matrix multiplication? I honestly just prefer calling matmul. |