i just wanted to add that "archive_ex" and "unarchive_ex" works only and only for single expressions. If someone wants to save lists of matrixes like i needed, you can use "archive_node" which is great too. it can save you lots of time best regards, Cristobal On Sun, Jun 6, 2010 at 2:19 PM, Cristobal Navarro <axischire@gmail.com>wrote:
hello Alexei,
thanks very much for you indications, i cleared up my mind now. i have tested the method of archiving, it works very good! its crazy it even worked for storing a whole matrix of expressions, great and perfect.
additionally, thanks to ginac's great modularism, i was able to add some extra binary header information at the beginning of the same file (like the number of elements stored), because some information was dynamic and unknown for the program.
i guess ginac's archive tool internally serializes its objects, something i wasnt doing on my program.
i only have this little question (for the future), has someone worked with ginac and distributed systems (clusters), ? sending and receiving ginac type objects between nodes ? would it be possible to send the "archive" which is serialized already (maybe im completely wrong) through an MPI send/receive instruction?? i will eventually look into this the following weeks to come, but meanwhile any answer will be very helpful to clear up the scenario.
best regards and thank you very much
Cristobal <http://www.youtube.com/neoideo>
On Sun, Jun 6, 2010 at 9:31 AM, Alexei Sheplyakov < alexei.sheplyakov@gmail.com> wrote:
Hello,
On Fri, Jun 04, 2010 at 06:05:26PM -0400, Cristobal Navarro wrote:
is it possible to write ginac symbols and expressions into a file as binary format??
Yes. It's documented in the manual (section 5.15.4, titled as `Archiving').
i've tried this but i get segmentation fault when printing the read variables. you can try this one file example to see the problem.
That code is not going to work (with any non-POD data type). Perhaps you should read something about serialization. A good starting point is http://www.parashift.com/c++-faq-lite/serialization.html
Best regards, Alexei
_______________________________________________ GiNaC-list mailing list GiNaC-list@ginac.de https://www.cebix.net/mailman/listinfo/ginac-list