8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
+
+
+
-
+
-
-
+
+
|
# Copyright (c) P.J.Gawthrop, 1996.
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.1 1996/08/24 13:34:48 peter
## Initial revision
##
###############################################################
function exact_match(name1, name2) {
return ((match(name1,name2)>0)&&(length(name1)==length(name2)))
}
function matches(name, names) {
n = split(names,match_name);
n_matches = split(names,match_name);
matched = 0;
for (i = 1; i <= n; i++) {
if ( exact_match(name,match_name[i]) ) {
for (i_matches = 1; i_matches <= n_matches; i_matches++) {
if ( exact_match(name,match_name[i_matches]) ) {
matched = 1;
break;
}
}
return matched;
}
|
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
-
-
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
|
symbols = sprintf("%s %s", symbols, arg[i]);
}
}
}
}
END {
# print the _sympar file
printf("%% Symbolic parameter file - generated by MTT\n\n");
printf("MTTNVar := %1.0f;\n", symbol_count);
printf("%% Symbolic parameter file - generated by MTT\n\n");
printf("MTTNVar := %1.0f;\n", symbol_count);
if (symbol_count>0) {
printf("MATRIX MTTVar(MTTNVar,1);\n");
split(symbols,symbol);
for (i = 1; i <= symbol_count; i++) {
printf("MTTVar(%1.0f,1) := %s;\n", i, symbol[i]);
}
}
if (symbol_count>0) {
printf("MATRIX MTTVar(MTTNVar,1);\n");
split(symbols,symbol);
for (i = 1; i <= symbol_count; i++) {
printf("MTTVar(%1.0f,1) := %s;\n", i, symbol[i]);
}
}
printf("END;\n\n");
}
|