3 ms·
Math libraries are an exception. You want this: d + A*B*(c*(a*b)) Not this: vector_add(mv_multiply(matrix_multiply(A,B),vector_dot(a,b)*c),d)
by jjoonathan 6y ago
Math libraries are an exception. You want this:
d + A*B*(c*(a*b))
Not this:
vector_add(mv_multiply(matrix_multiply(A,B),vector_dot(a,b)*c),d)
- jcelerier 6y agoso are expression grammar libraries, etc
- wtetzner 6y agoIt'd be cool to have the Haskell feature of putting backticks around a binary function so you can use it infix, e.g.: ((A `mmul` B) `mvmul` (a `vdot` b) * c) `vadd` d Still not as nice as operators, but not terrible either.
- flohofwoe 6y agoYou can get this with clang's vector extension (https://clang.llvm.org/docs/LanguageExtensions.html#vectors-and-extended-vectors https://clang.llvm.org/docs/LanguageExtensions.html#vectors-...), and this would make a lot of sense to add to the C standard. IMHO vector math is about the only place where operator overloading is acceptable in C++.