News for hackers. Stuff that matters.
Re:Einstein Notation applied in programming by JadeNB on Saturday March 07, 2015 @05:21PM (#9163319)
> I've never seen a cross product being defined in that way using Einstein notation.

In fact, I can't understand this use of the notation—namely,

    C_i = A_{i + 1 `mod` 3}B_{i + 2 `mod` 3}
—and am not sure that it's correct. There is no free variable on the right-hand side, so I'm not sure over what to sum. Even if this were fixed, we'd need something like, as you say, the Levi–Civita symbol, since a given entry of the cross product is not a sum but a difference.
Re:Einstein Notation applied in programming by QuantumRoar on Saturday March 07, 2015 @10:09PM (#9164343)
Oh, you're right. I just glanced over the equation and I thought I should recommend the standard notation.

But as you stated, the cross product is clearly wrong as given by the author. There's obviously no other way than defining it with a totally antisymmetric quantity like the Levi-Civita symbol.

Re:Einstein Notation applied in programming by hzhou321 on Tuesday March 10, 2015 @03:27PM (#9180010)
When there is no free variable, there is no sum, just the loop.

But you are right the the notion does not work as is because complicated subscript support is not implemented yet. But the equation is listed before the programming part is mentioned and it is an illustration of idea, so I believe it is ok.

It is not difficult to add the implementation, although it will be tedious (but still behind the surface). It is matter of how useful it is. And you are probably right that implementing a Levi-Civita syntax might be more straight forward.

Re:Einstein Notation applied in programming by hzhou321 on Wednesday March 11, 2015 @12:39AM (#9182610)
Oh I noticed my mistake, now corrected.