> < ^ Date: Tue, 08 Feb 2000 16:35:17 +0100 (MET)
> < ^ From: Dmitrii Pasechnik <d.pasechnik@twi.tudelft.nl >
^ Subject: using GAP as a library (GAP-C interface docs ?) ?

Dear Forum,

I wonder if it is possible to use GAP as a library, i.e. to create a
library that would perform a particular computation, and that
is callable for the outside world in the usual C way, just as one would
use the standard numeric library (libm on mosty Unix systems) to
do a particular numeric computation.

In my case I have a large C++ program that needs to be extended by a
computation that takes a square matrix of integers, constructs a graph
from it in some way, does something with this graph (including
automorphism group computation), and returns a couple of numbers back to
the main program.

This extension part would be perhaps 50 or 100 lines of GAP code at most,
but it would be 10-20 times bigger in C or C++ (provided that I use nauty
for doing the automorphism group part).
The computation needs to be done perhaps 10000 or 100000 times, so there is
no question of calling GAP to do the job via a script, or something like

I could in principle also start GAP as a main routine, and call the large
C++ program in question from it. Hence the second question.
Is there a description somewhere of such a procedure (again, I don't want
to communicate with the C++ program via a file, I have to do it the normal
way? In other words, is there a C-interface for GAP?
(yes, it is there, I suppose, but I cannot seem to find any docs about it).

Dmitrii Pasechnik

Miles-Receive-Header: reply

> < [top]