Closed federkamm closed 7 years ago
It is possible to scale a vector using
vector * scalar
but not using
scalar * vector
Is there a rationale for the missing "scalar * vector" operator? Beside me prefering to write the scalar in front of the vector it is also more efficient in regard of the evaluation order without parantesis
scalar1 * scalar2 * vector == (scalar1 * scalar2) * vector
evaluates in optimal order (n+1 flops where n is the dimension of vector). But
vector * scalar1 * scalar 2 == (vector * scalar1) * scalar2
causes extra evaluations (2n flops) and one is forced to write parantesis for an optimal evaluation order
vector * (scalar1 * scalar2) [ == scalar1 * scalar2 * vector ] vector * (scalar1 / scalar2) [ == scalar1 / scalar2 * vector ]
Please consider adding the "scalar * vector" operator.
Done, see latest develop branch.
It is possible to scale a vector using
but not using
Is there a rationale for the missing "scalar * vector" operator? Beside me prefering to write the scalar in front of the vector it is also more efficient in regard of the evaluation order without parantesis
evaluates in optimal order (n+1 flops where n is the dimension of vector). But
causes extra evaluations (2n flops) and one is forced to write parantesis for an optimal evaluation order
Please consider adding the "scalar * vector" operator.