Non-commutative algebra (Re: [eigen] On a flexible API for submatrices, slicing, indexing, masking, etc.)

[ Thread Index | Date Index | More Archives ]

Dear Gael,

Am 23.12.2016 um 10:12 schrieb Gael Guennebaud:

my opinion is that we need both, because using free functions is only way to write generic code for both scalar, arrays, and other custom type. E.g.:


could boils done to sign(x) if x is a scalar.


For binary operators, does not reflect that the role of a and b is symmetric, so I agree that dot(a,b) might look better.

That brings up a question, which may only concern my work.
Does Eigen actually assume, that the floating point types are commuting?
I'm asking since I have a  programme that normalizes the input of an object
we physicist call Hamiltonian and it consists of anti-commuting variables,
i.e. a * b == -b * a . For examples it calculates commutators consisting of
matrices containing these objects and simplifies the resulting expression.
Would it be safe to use Eigen for these types?
For those types I (currently) only need scalar products,
no advanced linear algebra.

Best regards,

Mail converted by MHonArc 2.6.19+