On Wed, 15 Apr 2009 09:38:39 +0100
John Cremona <john.crem...@gmail.com> wrote:

> 
> I may be wrong but as far as I know you can use your C++ library from
> within Sage (via a wrapper) but not vice versa.  For example, my eclib
> package uses its own sparse matrix code, but I don't think there is
> any way I can use Sage matrix code in eclib.

It is possible to call python code from C/C++, pynac has many examples
of this. The functions in sage/symbolic/pynac.pyx are all exported so
they are callable from C++.

You just need to define the function as extern in your code, and the
linker takes care of the rest at runtime. Of course, this makes the
library very much dependent on Sage.

I have no experience with the sparse matrix code, so I don't know how
hard it would be to fill in Sage's sparse matrices from C++.

Cheers,

Burcin

> 2009/4/15 Jörg F. Unger <joerg.un...@bauing.uni-weimar.de>:
> >
> > I would like to add a C++ based library including a finite element
> > software. For that purpose, the interaction with the sparse matrix
> > types of sage are required. Especially, due to the possibly large
> > size of the resulting matrices, no copying between the objects is
> > required, i.e. directly creating the sage sparse matrix in my c++
> > library, passing it to sage for the solution procedure (system of
> > linear equations) and getting the result back to the Finite Element
> > library.
> >
> > I've checked the documentation of sage for an c++ interface and the
> > internal data structure of sparse matrices, but didn't find a point
> > to start. Has anyone some ideas, how this can be implemented?
> >
> > Thanks a lot for the effort.
> > Joerg F.
> >
> > >
> >
> 
> > 

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to