On Fri, Jul 5, 2013 at 1:15 AM, Dmitriy Lyubimov <dlie...@gmail.com> wrote:
> For anyone good at scala DSLs, the following is the puzzle i can't seem to > figure at the moment. > > I mentioned before that I implemented assignment notations to a row or a > block, e.g. for a row vector : A(5,::) := (1,2,3) > > what it really translates into in this particular case is > > A.viewRow(5).assign(new Vector(new double[]{1,2,3})) > > > One thing i can't quite figure for in-core matrix DSL is how to translate > element assignments such as > > A(5,5) := 2.0 > > into A.setQuick(5,5,2.0) > > while still having > > val k = A(5,5) > > translating into > val k = A.getQuick(5,5). > > > it could be implemented with a "elementView" analogue but would require the > element view object creation -- which is, first, a big no-no (too > expensive) for a simple solitary element assignment (or read-out) > operation, and secondly, reading the element such as A(5,5) * 2.0 would > also involve view element object creation with implicit conversion to > Double whereas it is not even needed at all in this case. > > at this point i have only a very obvious apply(Double,Double):Double = > m.getQuick(...), i.e. only element reads are supported with that syntax. > > I am guessing Jake, if anyone, might have an idea here... thanks. > Hmmm... right off the top of my head, no. But my play-DSL is pretty free of operators, as that level of scala cleverness worries me a little, when it comes to making sure we're sticking to efficient operations under the hood. > > > > On Thu, Jul 4, 2013 at 11:23 PM, Dmitriy Lyubimov <dlie...@gmail.com> > wrote: > > > FWIW, Givens streaming qr will be a bit more economical on memory than > > Householder's since it doesn't need the full buffer to compute R and > > doesn't need to keep entire original matrix around. > > > > > > On Thu, Jul 4, 2013 at 11:15 PM, Dmitriy Lyubimov <dlie...@gmail.com > >wrote: > > > >> Ted, > >> > >> would it make sense to port parts of QR in-core row-wise Givens solver > >> out of SSVD to work on any Matrix? I know givens method is advertised as > >> stable but not sure if it is the fastest accepted one. I guess they are > all > >> about the same. > >> > >> If yes, i will need also to port the UpperTriangular matrix to adhere to > >> all the bells and wistles, and also have some sort of RowShift matrix (a > >> much simpler analogue of Pivoted matrix for row-rolled buffers). would > that > >> make sense? > >> > >> thanks. > >> -D > >> > >> > > > -- -jake