Thanks for your help - and info. It is good to hear that in the future the
sparse command will accept integer values rather than only double precision.
I have managed to improve the code I am working on but still have one major
bottleneck. Even though I have to perform operations such as a
Cholesky factorization and many matrix multiplications, my bottleneck is
with the following two lines
mat11=sparse(double(Ix), double(Jx), X(valuex),n^2,n*(n-1)/2);
mat11=mat11+sparse(double(Is), double(Js), Sy(values),n^2,n*(n-1)/2);
Here Ix,Jx,Is,Js,valuex,values are long vectors of indices and
X,Sy are sparse symmetric matrices n by n matrices.
Have I reached the limit in improving things within matlab? Should I be
looking at a mex file?
thanks for the advice
>If you can't store double precision i, j and values in the MATLAB
>workspace with storage requirements:
>3 * 8 * nnz(A)
>then you also can't store 32 bit integer/single precision i and j and
>double precision values AND the resulting sparse(A) with combined
>(2 * 4 + 8) * nnz(A) + (4+8)*nnz(A) + 4*(size(A,2)+1)
>However, we are considering accepting integer or single precision i
>and j sparse matrix indices in the sparse function S =
>sparse(i,j,vals) in a future release of MATLAB. (Internally the row
>indices and column pointers of the sparse matrix data structure are
>stored as 32 bit integers already).
>The MathWorks, Inc.
>> I am using the command
>> where the index sets I and J are very 'long' vectors.
>> Therefore, I would like to use
>> single arrays for I and J
>> to save memory. However, I then get the error message
>> ??? Error using ==> sparse
>> Function 'sparse' not defined for variables of class 'single'.
>> I have tried
>> but this seems to still run into memory problems.
>> Is there a way to avoid this?
>> thanks for any hints/advice
>> Univ. of Waterloo |URL
>> Dept of Comb and Opt |Tel (519) 888-4567, x5589, office MC6065
>> Waterloo, Ont. CANADA N2L 3G1 |Fax (519) 725-5441
Univ. of Waterloo |URL http://orion.math.uwaterloo.ca/~hwolkowi
Dept of Comb and Opt |Tel (519) 888-4567, x5589, office MC6065
Waterloo, Ont. CANADA N2L 3G1 |Fax (519) 725-5441