ECAS Code Documentation

0.1a

Introduction

ECAS stands for Easy Computer Algebra System which is an attempt to implement a computer algebra system based on C++. The source tarball contains a library and a text based front end including a parser. It can be downloaded from http://www.guengel.ch/ame/maturarbeit/rafi/index.shtml. ECAS is by no means complete nor suitable for any real-world computations.

At the present stage it only supports following functionalities:

See also the ToDo and Bug section for more information what is missing or does not work.

Minimalistic Installation Instructions

  1. Download the source tarball.
  2. Unpack it using gzip -cd | tar -xvf - on a console. This will unpack the sources into the current working directory.
  3. Type cd ecas-0.1 to change into the newly create source directory.
  4. On most systems, a ./configure --prefix=/usr/local will suffice to prepare the sources for compilation and installation.
  5. Type make all install to build and install the package.

How to use ECAS

Assuming you have downloaded, built, and installed the sources successfully, the following code snippet should demonstrate how to use ECAS.

 #include <ecas.h>

 int main(int, char**) {
	// Creates a variable named 'x'
	Variable x("x");
	// Creates a variable named 'y'
	Variable y("y");
	// A LongInt of the value 2
	LongInt li(2);

	// Add the two variables
	CASObject *tmp = x.Add(&y);
	// Multiply the previous result with the LongInt
	CASObject *result = tmp->Multiply(&li);

	// Release the memory occupied by the first result
	CASObject::Garbage->Put(tmp);

	// Evaluate the result
	tmp = result->Evaluate();

	// Release the memory occupied by the unevaluated result
	CASObject::Garbage->Put(result);

	// Print the result to the screen
	tmp->Print();

	// Release the memory occupied by the evaluated result
	CASObject::Garbage->Put(tmp);

	exit(0);
 }

When compiling, you have to include the pthread as well as the ecas library.

Using gcc, the command looks something like that, assuming you have pasted the above snippte in a file named main.cc

g++ -O0 -g3 -lecas -lpthread -o ecastest main.cc


Generated on Sun Dec 31 01:57:26 2006 for ECAS by  doxygen 1.4.7