[GiNaC-list] Symbolic functions with multiple outputs

John Pye john.pye at student.unsw.edu.au
Thu Sep 8 07:57:25 CEST 2005

Hi again

Just reading the GiNaC 1.3.1 manual, in the section about adding new
symbolic functions, section 6.2

Is it possible to create symbolic functions that have multiple, matrix,
or list outputs? Is there a way to assign the outputs of a
multiple-valued symbolic function to elements of a list?

lst(a,b,c) = three_valued_function(d,e);

For example, a case where one might want to do this sort of thing would
be evaluation of fluid properties, like so

lst(p,h) = pressure_and_enthalpy_of_water(T, rho);

When finally evaluating this numerically, eg once T and rho are known,
having this as one symbolic function allows some intrinsic optimisation
of calls to the thermodynamic property calculation routines.

Thanks for your help, and sorry for the stream of silly questions...

John Pye
School of Mechanical and Manufacturing Engineering
The University of New South Wales
Sydney  NSW 2052  Australia
t +61 2 9385 5127
f +61 2 9663 1222

More information about the GiNaC-list mailing list