define multi_poly
%$entry = multi_poly
type Poly_Coeffs = array [ real ]; % Coefficients of one polynomial
type Many_Polys = array [ Poly_Coeffs ]; % Coefficients of many polynomials
type Unknowns = array [ real ]; % Values for X, the polynomial unknown
type Values = array [ real ]; % Values of all polys for one unknown
type Many_Values = array [ Values ]; % Values of all polys for all unknowns
function eval_poly( coeffs : Poly_Coeffs; x_val := real returns Values )
for c in coeffs at i
term := c * exp(x_val, real(i))
returns value of sum term
end for
end function % eval_poly
function multi_poly( C : Many_Polys; X : Unknowns returns Many_Values )
for x_val in X
row_of_poly_vals :=
for coeffs in C
poly_value := eval_poly(coeffs, x_val)
returns array of poly_value
end for % one row of result array - all polys for one x
returns array of row_of_poly_vals
end for
end function % multi_poly
The Sisal Language Project has been approved as a Designated Unclassified Subject Area (DUSA) K19222, as of 07 August, 1991.
LLNL Disclaimer
UCRL-MI-122601