a. Currently, mapped files do not support the sparse datatypes.

b. You can do this in one of two ways:
   s=: 1 $. 1e8 1e8 ; 0 1;-~0.5
   s=: value (<"1 i,.j)}s
Or
   s=: 1 $. 1e8 1e8 ; 0 1; (-~0.5) ; (i,.j) ; value
(The latter is not yet documented but should work in
J602 beta.)

A sparse matrix can be converted to the equivalent dense
matrix by   d=: $.^:_1 s .

Note that with your full problem, a 1e8 1e8 matrix with 10e9 
non-zero atoms, there is no advantage to making it a sparse
matrix, because as stated before the primitive %. and 
+/ .* are not up to dealing with an array of that size.
Better to just map i and j and values separately 
(perhaps i,.j and value as two map files), and apply your
iterative methods to these.

Perhaps I should add the problem you described is a
non-trivial application.



----- Original Message -----
From: Nick Kostirya <[EMAIL PROTECTED]>
Date: Wednesday, January 9, 2008 23:04
Subject: [Jgeneral] table (i,j,value)  to matrix
To: [email protected]

> Hello,
> 
> I proceed with my studies of J, well I have a couple of 
> questions for
> you. 
> 
> As far as I understand, а sparse matrix can't mapped as file, am 
> I right?
> 
> Second, what's the most optimal way of converting a table (i,j,value)
> into matrix, preferably a sparse one? Can't really get the clue...
> I am also interested in the process of reverse conversion...
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to