FWIW, one approach might be to separate DSL into several. E.g. RLikeOps and MatlabLikeOps or WhateverOps, none of which is imported by default. and then the code would have to say "import RLikeOps._" to enalbe R-like DSL, and vice versa.
But matlab style '*.' symbol unfortunately doesn't seem to work in scala without backquotes. apparently scala treats '.' 'as a keyword and can't reduce it as a part of anything else. On Sat, Jul 27, 2013 at 6:43 PM, Dmitriy Lyubimov <[email protected]> wrote: > > > > On Sat, Jul 27, 2013 at 6:31 PM, Dmitriy Lyubimov <[email protected]>wrote: > >> >> >> >> > >>> > diagv(1 /: s) >>> > >>> >>> But since this is just the inverse of the matrix, and I imagine it's >>> actually >>> clearer to do just diagv(s).inverse instead of diagv(1 /: s) >>> >>> >> Well. DSL is just the icing. Nobody's taking the cake away. >> >> in a sense that, once/if/when Mahout supports inverse(), it would be >> exactly how one might use it. DSL is not about implementation, it is about >> semantic sugar only. It only maps to what exists. >> >> On a side note, it never actually occurred to me to call pinv() or >> solve() on a diagonal matrix. Or orthonormal for that matter. Their >> identities are so appealing it kind of becomes second nature after some >> time. the only use for solve() i had is actually for solving linear >> equations. In my R prototype for SSVD [1] one will find exactly the same >> style code, i.e. diag(1/e$values) . >> >> pardon, this should read "non-signular" of course, an honest typo. > > >> Even then you probably actually want leftInverse() and rightInverse(), >> not just inverse, which is only defined for *non *singular square >> matrices and would be equal right and left inverses in that case. Which >> oddly enough brings us back to left-associative and right-associative >> operations. >> >> [1] >> https://cwiki.apache.org/confluence/download/attachments/27832158/ssvd.R?version=1&modificationDate=1323358453000 >> >> >
