I'm currently working on FEM with matlab.
my code is like this
function [A,rhs] = Assemble()
pre_process();
[IA,JA,A,rhs] = assemble(pre_processed_parameters); // mex-func
// IA : row index
// JA : col index
// A : value
A = sparse(IA,JA,A);
When A
is size of ten million x ten million
,
pre_process
takes less than 1 second
assemble
takes about 5 seconds
sparse
takes about 820 sec
The major time consuming line is a single line sparse
.
Is there any faster way to collect it?
Properties of IA
, JA
and A
are
Pair of
(IA[k],JA[k])
have all distinct values for allk
.resulting matrix,
A
, is lower triangular and have block structure