aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2002-04-16 16:01:29 +0000
committerjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2002-04-16 16:01:29 +0000
commitc89c4c5d5e8ea694646441250ac2d5b528b01be9 (patch)
tree578acd961e5785875a9853c54ee0af80f864670a
parent539991c88866b19d31a9840d03c1c9d23f1867c7 (diff)
- fix a bunch of undeclared-variable warnings found by mint
- remove some unreachable code in fix_rationals() git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@521 f88db872-0e4f-0410-b76b-b9085cfa78c5
-rw-r--r--src/maple/Diff.maple4
-rw-r--r--src/maple/codegen2.maple33
-rw-r--r--src/maple/coeffs.maple4
-rw-r--r--src/maple/coords.maple4
-rw-r--r--src/maple/coords.minc17
-rw-r--r--src/maple/util.maple4
6 files changed, 29 insertions, 37 deletions
diff --git a/src/maple/Diff.maple b/src/maple/Diff.maple
index 3740bb4..7eaf030 100644
--- a/src/maple/Diff.maple
+++ b/src/maple/Diff.maple
@@ -247,8 +247,8 @@ end proc;
proc(operand) # varargs
option remember; # performance optimization
global
- @include "../maple/coords.minc",
- @include "../maple/gfa.minc";
+ @include "../maple/coords.minc",
+ @include "../maple/gfa.minc";
local var_list, posn;
var_list := [args[2..nargs]];
diff --git a/src/maple/codegen2.maple b/src/maple/codegen2.maple
index 32a3303..3f459c4 100644
--- a/src/maple/codegen2.maple
+++ b/src/maple/codegen2.maple
@@ -60,9 +60,12 @@ codegen2 :=
proc(expr_in::{algebraic, list(algebraic)},
lhs_name::{name, list(name)},
output_file_name::string)
+global
+ @include "../maple/coords.minc",
+ @include "../maple/gfa.minc";
local expr, expr_temps, input_set, output_set, expr_cost;
-printf("codegen2(%a)\n", lhs_name);
+printf("codegen2(%a) --> \"%s\"\n", lhs_name, output_file_name);
expr := expr_in;
saveit(10, procname, "input", expr);
@@ -86,7 +89,7 @@ saveit(10, procname, "fix_Diff", expr);
input_set := deindex_names( indets(map(rhs,expr),name)
minus {op(expr_temps)}
- minus x_all_set );
+ minus xy_all_set );
output_set := deindex_names( {op(map(lhs,expr))} minus {op(expr_temps)} );
printf(" convert R_dd[2,3] --> R_dd_23 etc\n");
expr := unindex_names(expr);
@@ -301,7 +304,7 @@ end;
# tests whether or not a name matches *any* of the result names.
#
# Arguments:
-# rname = (in) The name to test.
+# try_name = (in) The name to test.
# result_name = (in) The name or list/set of names of the result to test
# against.
#
@@ -310,20 +313,20 @@ end;
# array/table component of it, false otherwise.
#
is_result :=
-proc(rname::name,
+proc(try_name::name,
result_name_in::{name, list(name), set(name)})
local result_name, rn;
-if type(in_result_name, name)
+if type(result_name_in, name)
then result_name := { result_name_in };
else result_name := result_name_in;
fi;
for rn in result_name
do
- if (rname = rn)
+ if (try_name = rn)
then return true;
- elif (type(rname, indexed) and (op(0,rname) = rn))
+ elif (type(try_name, indexed) and (op(0,try_name) = rn))
then return true;
fi;
end do;
@@ -345,7 +348,7 @@ end;
#
deindex_names :=
proc(expr::{name, function, list({name,function}), set({name,function})})
-local fn_name, fn_args_list;
+local fn, fn_args_list;
# recurse over lists and sets
if (type(expr, {list, set}))
@@ -489,6 +492,7 @@ end;
fix_rationals :=
proc(expr::{algebraic, name = algebraic, list({algebraic, name = algebraic})})
local nn, k,
+ expr_sign, expr_abs,
base, power, fbase, fpower,
fn, fn_args_list,
int_factors, nonint_factors,
@@ -535,17 +539,6 @@ if (type(expr, `*`))
'k'=1..nops(nonint_factors));
else return product('fix_rationals(op(k,expr))', 'k'=1..nn);
fi;
-
- if (select(type, [op(expr)], integer) <> [])
- then
- expr_sign := -1;
- temp := -expr;
- else
- expr_sign := 1;
- temp := expr;
- fi;
- return expr_sign * product('fix_rationals(op(k,temp))',
- 'k'=1..nops(temp));
fi;
# recurse over powers
@@ -582,8 +575,6 @@ if (type(expr, float))
return fix_rationals(mult * 10^power);
fi;
-
-
# identity op on names
if (type(expr, name))
then return expr;
diff --git a/src/maple/coeffs.maple b/src/maple/coeffs.maple
index f6956fa..e2b90e3 100644
--- a/src/maple/coeffs.maple
+++ b/src/maple/coeffs.maple
@@ -14,8 +14,8 @@
setup_coeff_gfas :=
proc()
global
-@include "../maple/coords.minc",
-@include "../maple/gfa.minc";
+ @include "../maple/coords.minc",
+ @include "../maple/gfa.minc";
# 1st ($X^u_i$) and 2nd ($X^u_{ij}$) partial derivs
# of (r,rho,sigma) wrt (xx,yy,zz)
diff --git a/src/maple/coords.maple b/src/maple/coords.maple
index d2ef3c1..502e8da 100644
--- a/src/maple/coords.maple
+++ b/src/maple/coords.maple
@@ -13,7 +13,7 @@
setup_coords :=
proc()
global
-@include "../maple/coords.minc";
+ @include "../maple/coords.minc";
N := 3; # number of spatial coordinates,
# i.e. spatial coordinate indices
@@ -43,7 +43,7 @@ y_rs_set := {op(y_rs_list)};
# list of all coordinates (for sorting things into "nice" order)
xy_all_list := [op(x_xyz_list), op(y_rs_list)];
-xy_all_set := {op(x_all_list)};
+xy_all_set := {op(xy_all_list)};
NULL;
end proc;
diff --git a/src/maple/coords.minc b/src/maple/coords.minc
index 194b847..0924b94 100644
--- a/src/maple/coords.minc
+++ b/src/maple/coords.minc
@@ -4,15 +4,16 @@
# Kronecker delta
delta,
-# coordinates
+# number of coordinates
N, # number of spatial coordinates
N_ang, # number of angular spatial coordinates
+
+# coordinates
+xx, yy, zz, # Cartesian coordinates
+x_xyz, x_xyz_list, x_xyz_set, # ... array/list/set of these
r, r__fnd, # radial coordinate,
# ... inert and as fn(xx,yy,zz) coords
-x_xyz, x_xyz_list, x_xyz_set, # array/list/set of (xx,yy,zz) coordinates
-y_rs, y_rs_list, y_rs_set, # array and list of (rho,sigma) coordinates
-rho, sigma, # individual patch coordinates
-mu, nu, phi, # angular coordinates
-xx, yy, zz, # Cartesian coordinates
-x_all_list, x_all_set # list of all coordinates
- # no comma
+rho, sigma, # generic patch coordinates
+y_rs, y_rs_list, y_rs_set, # array and list of generic patch coordinates
+xy_all_list, xy_all_set # union of Cartesian and generic patch coords
+ # no comma
diff --git a/src/maple/util.maple b/src/maple/util.maple
index 09932e2..a099d7a 100644
--- a/src/maple/util.maple
+++ b/src/maple/util.maple
@@ -183,9 +183,9 @@ proc(x::name, y::name)
option remember; # performance optimization
local xposn, yposn;
global
- @include "../maple/coords.minc";
+ @include "../maple/coords.minc";
-if (member(x, x_all_list, 'xposn') and member(y, x_all_list, 'yposn'))
+if (member(x, xy_all_list, 'xposn') and member(y, xy_all_list, 'yposn'))
then return evalb(xposn < yposn);
else return lexorder(x, y);
fi;