soegaard2
2020-5-29 19:18:25

Matlab uses A\B to “divide with A from the left” (where A and B are matrices).


soegaard2
2020-5-29 19:18:43

Would it look weird to use \ for left divide in Racket?


soegaard2
2020-5-29 19:21:07

Or would mldivide be better (the name Matlab uses as an alternative).


samth
2020-5-29 19:22:17

I think a name is better


gknauth
2020-5-29 19:41:14

One thing that drives me crazy about Scala is a symbol for which I don’t remember the meaning, and Google thinks the symbol is too wonky even for them.


soegaard2
2020-5-29 19:43:05

Matlab has (for the same reason I guess) a single page with all operators listed. They have a few…


soegaard2
2020-5-29 19:44:29

So if (mldivide A B) is “left divide with A” should “right divide with A” be (mrdivide B A) ?


soegaard2
2020-5-29 19:44:48

In Matlab it is: A\B vs B/A.


notjack
2020-5-29 20:16:14

what’s the difference between left division and right division? (I spaced out through most of my linear algebra class…)


notjack
2020-5-29 20:22:46

ah I see: A/B is A * inverse(B), but A\B is inverse(A) * B


soegaard2
2020-5-29 20:43:49

Exactly. I can’t remember that phrase either, so it might be non-standard.


i.am.corpix
2020-5-30 03:50:10

@i.am.corpix has joined the channel


notjack
2020-5-30 06:01:59

@soegaard2 I thought about it more, and I think the way I would phrase the two concepts is “A divided by B” (A/B) and “A divided into B” (A\B). With an OOP-y syntax, I’d write A/B as matrix.divideBy(divisor) and A\B as matrix.divideInto(dividend). So for Racket, maybe (matrix-divide-by matrix divisor) and (matrix-divide-into matrix dividend)?


notjack
2020-5-30 06:06:23

that asks users to remember that grammatically, “divide” is a verb, the subject is the divisor, and the object is the dividend, which seems slightly less arbitrary than “left” and “right”


laurent.orseau
2020-5-30 06:22:49

Probably best to be careful to use precise linear algebra terms here though, not sure divided into is one of them (maybe?)


notjack
2020-5-30 06:46:23

well that sent me down a wikipedia rabbit hole, and I’ve emerged from it believing that the precise mathematical and linguistic terminology is that “divide into” is a monotransitive phrasal verb