diff options
author | jthorn <jthorn@df1f8a13-aa1d-4dd4-9681-27ded5b42416> | 2002-05-14 15:52:50 +0000 |
---|---|---|
committer | jthorn <jthorn@df1f8a13-aa1d-4dd4-9681-27ded5b42416> | 2002-05-14 15:52:50 +0000 |
commit | fc338426770f9069e68714142122c91d45fbb267 (patch) | |
tree | 484cc6dc873d827bcf9bde0f68e2bb3f8bc5bbee /src | |
parent | af5246c6868457083b2b0848cf05d92af39ee960 (diff) |
modify code to store interpolation coefficients in COEFF(...) expressions,
to optionally multiply by "factor" to handle the case when we're doing
derivs
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/LocalInterp/trunk@42 df1f8a13-aa1d-4dd4-9681-27ded5b42416
Diffstat (limited to 'src')
-rw-r--r-- | src/GeneralizedPolynomial-Uniform/interpolate.maple | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/src/GeneralizedPolynomial-Uniform/interpolate.maple b/src/GeneralizedPolynomial-Uniform/interpolate.maple index 7f401af..6cd24c5 100644 --- a/src/GeneralizedPolynomial-Uniform/interpolate.maple +++ b/src/GeneralizedPolynomial-Uniform/interpolate.maple @@ -232,13 +232,19 @@ end proc; ################################################################################ # -# This function prints a sequence of C expression to assign the interpolation -# coefficients to COEFF(...) expressions, eg -# COEFF(1,-1) = coeff_dx_p1_m1 +# This function prints a sequence of C expression to store the interpolation +# coefficients in COEFF(...) expressions, eg +# COEFF(1,-1) = factor * coeff_dx_p1_m1; # # Arguments: # posn_list = The same list of positions as was used to compute the # interpolating polynomial. +# RHS_factor_name = If this string is non-empty, then the coefficient is +# multiplied by this factor before being stored, eg +# setting this to "factor" would give the example above. +# If this string is empty (""), the multiplication is +# omitted, eg +# COEFF(1,-1) = coeff_dx_p1_m1; # coeff_name_prefix = A prefix string for the coefficient names. # file_name = The file name to write the coefficients to. This is # truncated before writing. @@ -246,6 +252,7 @@ end proc; print_interp_coeff_var_store := proc( posn_list::list(list(numeric)), + RHS_factor_name::string, coeff_name_prefix::string, file_name::string ) @@ -253,10 +260,17 @@ proc( ftruncate(file_name); map( proc(posn::list(numeric)) - fprintf(file_name, - "%a = %s;\n", - 'COEFF'(op(posn)), - coeff_name(posn,coeff_name_prefix)); + if (length(RHS_factor_name) > 0) + then fprintf(file_name, + "%a = %s * %s;\n", + 'COEFF'(op(posn)), + RHS_factor_name, + coeff_name(posn,coeff_name_prefix)); + else fprintf(file_name, + "%a = %s;\n", + 'COEFF'(op(posn)), + coeff_name(posn,coeff_name_prefix)); + end if; end proc , posn_list |