1 2 3 4 5 6 7 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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253
|
//
// time: Fri Oct 23 14:47:30 1998
//
// version: 3.1.2 (format), 4.1.1 (DX Beta)
//
//
// Begin MDF
// MODULE Classify
// CATEGORY Macros
// DESCRIPTION new macro
// INPUT Field; field; (no default); Field to be clustered based on positions
// INPUT NewField; field; (no default); Field after iterating classification
// INPUT NClusters; value list or field or string or string list; (no default); Number of clusters to create
// OUTPUT output_1; field;
// End MDF
// workspace: width = 593, height = 635
// layout: snap = 0, width = 50, height = 50, align = NN
//
macro Classify(
Field
,NewField
,NClusters
) -> (
output_1
) {
//
// node Input[1]: x = 2, y = 0, inputs = 0, label = Input
// parameter: position = 1, name = 'Field', value = '(no default)', descriptive = 1, description = ' Field to be clustered based on positions', required = 0, visible = 1
//
Classify_Input_1_out_1 = Field;
//
// node Extract[2]: x = 61, y = 81, inputs = 2, label = Extract
// input[2]: defaulting = 0, visible = 1, type = 32, value = "positions"
//
Classify_Extract_2_out_1[cache: 2] =
Extract(
Classify_Input_1_out_1,
"positions"
) [instance: 2, cache: 1];
//
// node Input[2]: x = 224, y = 4, inputs = 0, label = Input
// parameter: position = 2, name = 'NewField', value = '(no default)', descriptive = 1, description = ' Field after iterating classification', required = 0, visible = 1
//
Classify_Input_2_out_1 = NewField;
//
// node Extract[1]: x = 269, y = 80, inputs = 2, label = Extract
// input[2]: defaulting = 0, visible = 1, type = 32, value = "positions"
//
Classify_Extract_1_out_1[cache: 2] =
Extract(
Classify_Input_2_out_1,
"positions"
) [instance: 1, cache: 1];
//
// node Input[10]: x = 334, y = 11, inputs = 0, label = Input
// parameter: position = 3, name = 'NClusters', value = '(no default)', descriptive = 1, description = 'Number of clusters to create', required = 0, visible = 1
//
Classify_Input_10_out_1 = NClusters;
//
// node Compute[20]: x = 535, y = 44, inputs = 3, label = Compute
// input[1]: defaulting = 0, visible = 0, type = 32, value = "$0-1"
// expression: value = a-1
// name[2]: value = a
// name[3]: value = b
//
Classify_Compute_20_out_1[cache: 2] =
Compute(
"$0-1",
Classify_Input_10_out_1,
NULL
) [instance: 20, cache: 1];
//
// node ForEachN[1]: x = 425, y = 65, inputs = 3, label = ForEachN
// input[1]: defaulting = 0, visible = 1, type = 1, value = 0
// input[2]: defaulting = 1, visible = 1, type = 1, value = 3
//
Classify_ForEachN_1_out_1[cache: 2],
Classify_ForEachN_1_out_2[cache: 2] =
ForEachN(
0,
Classify_Compute_20_out_1,
NULL
) [instance: 1, cache: 1];
//
// node Select[1]: x = 316, y = 175, inputs = 3, label = Select
//
Classify_Select_1_out_1[cache: 2] =
Select(
Classify_Extract_1_out_1,
Classify_ForEachN_1_out_1,
NULL
) [instance: 1, cache: 1];
//
// node Compute[5]: x = 233, y = 239, inputs = 3, label = Compute
// input[1]: defaulting = 0, visible = 0, type = 32, value = "mag($0-$1)"
// expression: value = mag(a-b)
// name[2]: value = a
// name[3]: value = b
//
Classify_Compute_5_out_1[cache: 2] =
Compute(
"mag($0-$1)",
Classify_Extract_2_out_1,
Classify_Select_1_out_1
) [instance: 5, cache: 1];
//
// node Inquire[2]: x = 176, y = 92, inputs = 3, label = Inquire
// input[2]: defaulting = 0, visible = 1, type = 32, value = "position counts"
//
Classify_Inquire_2_out_1[cache: 0] =
Inquire(
Classify_Input_1_out_1,
"position counts",
NULL
) [instance: 2, cache: 1];
//
// node Enumerate[3]: x = 14, y = 224, inputs = 5, label = Enumerate
// input[1]: defaulting = 0, visible = 1, type = 29, value = 1000000
// input[4]: defaulting = 0, visible = 1, type = 29, value = 1.0
//
Classify_Enumerate_3_out_1[cache: 2] =
Enumerate(
1000000,
NULL,
Classify_Inquire_2_out_1,
1.0,
NULL
) [instance: 3, cache: 1];
//
// node First[1]: x = 158, y = 237, inputs = 0, label = First
//
Classify_First_1_out_1[cache: 2] =
First(
) [instance: 1, cache: 1];
//
// node GetLocal[1]: x = 24, y = 338, inputs = 3, label = GetLocal
//
Classify_GetLocal_1_out_1[cache: 2],
Classify_GetLocal_1_out_2[cache: 2] =
GetLocal(
Classify_Enumerate_3_out_1,
Classify_First_1_out_1,
NULL
) [instance: 1, cache: 1];
//
// node Compute[6]: x = 147, y = 338, inputs = 4, label = Compute
// input[1]: defaulting = 0, visible = 0, type = 32, value = "$0>$1?$1 : $0"
// expression: value = a>b?b : a
// name[2]: value = a
// name[3]: value = b
// name[4]: value = c
//
Classify_Compute_6_out_1[cache: 2] =
Compute(
"$0>$1?$1 : $0",
Classify_GetLocal_1_out_1,
Classify_Compute_5_out_1,
NULL
) [instance: 6, cache: 1];
//
// node Enumerate[4]: x = 385, y = 177, inputs = 5, label = Enumerate
// input[1]: defaulting = 0, visible = 1, type = 29, value = -1000000
// input[4]: defaulting = 0, visible = 1, type = 29, value = 1
//
Classify_Enumerate_4_out_1[cache: 2] =
Enumerate(
-1000000,
NULL,
Classify_Inquire_2_out_1,
1,
NULL
) [instance: 4, cache: 1];
//
// node GetLocal[2]: x = 370, y = 338, inputs = 3, label = GetLocal
//
Classify_GetLocal_2_out_1[cache: 2],
Classify_GetLocal_2_out_2[cache: 2] =
GetLocal(
Classify_Enumerate_4_out_1,
Classify_First_1_out_1,
NULL
) [instance: 2, cache: 1];
//
// node Compute[7]: x = 246, y = 341, inputs = 5, label = Compute
// input[1]: defaulting = 0, visible = 0, type = 32, value = "$0>$1?$3:$2"
// expression: value = a>b?d:c
// name[2]: value = a
// name[3]: value = b
// name[4]: value = c
// name[5]: value = d
//
Classify_Compute_7_out_1[cache: 2] =
Compute(
"$0>$1?$3:$2",
Classify_GetLocal_1_out_1,
Classify_Compute_5_out_1,
Classify_GetLocal_2_out_1,
Classify_ForEachN_1_out_1
) [instance: 7, cache: 1];
//
// node Replace[2]: x = 171, y = 467, inputs = 4, label = Replace
//
Classify_Replace_2_out_1[cache: 2] =
Replace(
Classify_Compute_7_out_1,
Classify_Input_1_out_1,
NULL,
NULL
) [instance: 2, cache: 1];
//
// node Output[1]: x = 197, y = 575, inputs = 1, label = Output
// parameter: position = 1, name = 'output_1', value = ' ', descriptive = 0, description = ' ', required = 0, visible = 1
//
output_1 = Classify_Replace_2_out_1;
//
// node SetLocal[1]: x = 42, y = 443, inputs = 3, label = SetLocal
//
SetLocal(
Classify_Compute_6_out_1,
Classify_GetLocal_1_out_2,
NULL
) [instance: 1, cache: 1];
//
// node SetLocal[2]: x = 371, y = 443, inputs = 3, label = SetLocal
//
SetLocal(
Classify_Compute_7_out_1,
Classify_GetLocal_2_out_2,
NULL
) [instance: 2, cache: 1];
// network: end of macro body
}
Classify_Input_1_out_1 = NULL;
Classify_Extract_2_out_1 = NULL;
Classify_Input_2_out_1 = NULL;
Classify_Extract_1_out_1 = NULL;
Classify_Input_10_out_1 = NULL;
Classify_Compute_20_out_1 = NULL;
Classify_ForEachN_1_out_1 = NULL;
Classify_Select_1_out_1 = NULL;
Classify_Compute_5_out_1 = NULL;
Classify_Inquire_2_out_1 = NULL;
Classify_Enumerate_3_out_1 = NULL;
Classify_First_1_out_1 = NULL;
Classify_GetLocal_1_out_1 = NULL;
Classify_GetLocal_1_out_2 = NULL;
Classify_Compute_6_out_1 = NULL;
Classify_Enumerate_4_out_1 = NULL;
Classify_GetLocal_2_out_1 = NULL;
Classify_GetLocal_2_out_2 = NULL;
Classify_Compute_7_out_1 = NULL;
Classify_Replace_2_out_1 = NULL;
|