Re: [sqlite] sparse matrix in scientific computing with sqlite

2009-10-16 Thread Dan Bishop
Michael Chen wrote: > --this is my first version for the purpose of storing sparse numerical > matrix in sql > --please let me know how to fix the bug at the end of the file, and how to > tune the performance > --or any better reference, thanks! > > .explain-- return

Re: [sqlite] sparse matrix in scientific computing with sqlite

2009-10-16 Thread Michael Chen
yes, that's what I am thinking of too. This big table is in charge of store all matrix, keep track of all index changes, and rollback when needed. I will only extract a tiny part from this big table in format like a sparse matrix, and put it in C array, then the available numerical routines, such a

Re: [sqlite] sparse matrix in scientific computing with sqlite

2009-10-16 Thread Stephan Wehner
On Fri, Oct 16, 2009 at 1:41 PM, Michael Chen wrote: > rdbms is indeed not a place for store a single sparse matrix like this. > However I have hundreds of them, and I need to break them and recombine them > frequently; furthermore, I need to drop a few rows or columns successively, > and need to

Re: [sqlite] sparse matrix in scientific computing with sqlite

2009-10-16 Thread Michael Chen
rdbms is indeed not a place for store a single sparse matrix like this. However I have hundreds of them, and I need to break them and recombine them frequently; furthermore, I need to drop a few rows or columns successively, and need to be able to trace back what's a row's original index. I think s

Re: [sqlite] sparse matrix in scientific computing with sqlite

2009-10-16 Thread Michael Chen
thanks Pavel ! On Fri, Oct 16, 2009 at 1:24 PM, Pavel Ivanov wrote: > > -- IA = [ 1 3 5 7 ] // IA(i) = Index of the first nonzero element > of > > row i in A > > Why 4th element if A has only 3 rows? > > > create temp view rowwiseC as > > select a1.rowid, sum(a2.ct) +1 as JA > > from rowwi

Re: [sqlite] sparse matrix in scientific computing with sqlite

2009-10-16 Thread Pavel Ivanov
> -- IA = [ 1 3 5 7 ] // IA(i) = Index of the first nonzero element of > row i in A Why 4th element if A has only 3 rows? > create temp view rowwiseC as > select a1.rowid, sum(a2.ct) +1 as JA > from rowwiseB a1, rowwiseB a2 > where a2.rowid < a1.rowid > group by a1.rowid > ; > --this is not

Re: [sqlite] sparse matrix in scientific computing with sqlite

2009-10-16 Thread P Kishor
This is not the answer you are looking for, and there are SQL geniuses on this list who will help you better, but really, is an rdbms really a good place to store a matrix the way you are trying to do? So convoluted. My approach, if I really was determined to store it in sqlite, would be to flatte

[sqlite] sparse matrix in scientific computing with sqlite

2009-10-16 Thread Michael Chen
--this is my first version for the purpose of storing sparse numerical matrix in sql --please let me know how to fix the bug at the end of the file, and how to tune the performance --or any better reference, thanks! .explain-- return result in more readable format .