No subject
Sat Jul 22 22:51:47 CEST 2006
physical problem requiring an advanced mathematical formulation, when one is
interested in getting numerical simulations, the 90% of the operations
involved are purely a basically multi-index linear algebra.
So efficient numerical and simbolic linear algebra is for me extremely
necessary.
Blitz++ and Ftensor, are libraries that can be used for matrices and
tensor indicial operations.
Their use allows to compute in a very efficient manner operations like:
A=B+C+D (blitz style)
A(i)=B(i)+C(i)+D(i) (Ftensor Style)
for vector, tensor or matrices A,B,C,D by removing the need of temporaries:
temp1=C+D
temp2=B+temp1; etc...
These libraries do a type of loop unrollment using expression templates,
which seems to me not very portable, requires long compilation times,
the tasks are handled to the preprocessor, etc. I don't like
these things.
The ideal thing for me would be to have a program where I
could perform:
First a set of of symbolic math steps, where one can define operations such
as:
A=B+C+D
for indexed expressions, where the range and step of the
indices could be controlled: for example idx i=[2, 3, 4,... indexdim].
Then use the symbolic math part to obtain unrolled indexed expressions like:
for (idx i =1 ; i<indexdim; i++)
A(i)=B(i) +C(i)+D(i)
end
linked with numerical arrays numeric A[], numeric B[], numeric C[],
so to be able to get numerical values very efficiently
The point being that since numerical simulations are done
recursively/iteratively
the symbolic step could be done only once at the beginning, and
the numerical unrolled efficient part could be done afterwards for
the remaining iterations.
I think Ginac is closer to be able to do this than blitz++ o ftensor, but
the point is how far is Ginac to perfomr the tasks I mentioned above.
Cheers,
Alejandro
More information about the GiNaC-list
mailing list