35
35
Compute an euclidean norm with domain size `dom_size` of a scalar.
36
36
"""
37
37
function co_euclidean (x; dom_size, params... )
38
- return co_euclidean_val (x; val = 0.0 , dom_size)
38
+ return co_euclidean_val (x; val= 0.0 , dom_size)
39
39
end
40
40
41
41
"""
@@ -48,16 +48,21 @@ co_abs_diff_var_vars(x; nvars, params...) = abs(x - nvars)
48
48
co_var_minus_vars(x; nvars)
49
49
Return the difference `x - nvars` if positive, `0.0` otherwise, where `nvars` denotes the numbers of variables.
50
50
"""
51
- co_var_minus_vars (x; nvars, params... ) = co_var_minus_val (x; val = nvars)
51
+ co_var_minus_vars (x; nvars, params... ) = co_var_minus_val (x; val= nvars)
52
52
53
53
"""
54
54
co_vars_minus_var(x; nvars)
55
55
Return the difference `nvars - x` if positive, `0.0` otherwise, where `nvars` denotes the numbers of variables.
56
56
"""
57
- co_vars_minus_var (x; nvars, params... ) = co_val_minus_var (x; val = nvars)
57
+ co_vars_minus_var (x; nvars, params... ) = co_val_minus_var (x; val= nvars)
58
58
59
59
60
60
# Parametric layers
61
+ """
62
+ make_comparisons(param::Symbol)
63
+
64
+ Generate the comparison functions for the given parameter.
65
+ """
61
66
make_comparisons (param:: Symbol ) = make_comparisons (Val (param))
62
67
63
68
function make_comparisons (:: Val{:none} )
84
89
comparison_layer(param = false)
85
90
Generate the layer of transformations functions of the ICN. Iff `param` value is set, also includes all the parametric comparison with that value. The operations are mutually exclusive, that is only one will be selected.
86
91
"""
87
- function comparison_layer (parameters = Vector {Symbol} ())
92
+ function comparison_layer (parameters= Vector {Symbol} ())
88
93
comparisons = make_comparisons (:none )
89
94
90
95
for p in parameters
118
123
119
124
for (f, results) in funcs_param
120
125
for (key, vals) in enumerate (data)
121
- @test f (vals. first; val = vals. second[1 ]) == results[key]
126
+ @test f (vals. first; val= vals. second[1 ]) == results[key]
122
127
end
123
128
end
124
129
@@ -130,15 +135,15 @@ end
130
135
131
136
for (f, results) in funcs_vars
132
137
for (key, vals) in enumerate (data)
133
- @test f (vals. first, nvars = vals. second[2 ]) == results[key]
138
+ @test f (vals. first, nvars= vals. second[2 ]) == results[key]
134
139
end
135
140
end
136
141
137
142
funcs_val_dom = [CN. co_euclidean_val => [1.4 , 2.0 ]]
138
143
139
144
for (f, results) in funcs_val_dom
140
145
for (key, vals) in enumerate (data)
141
- @test f (vals. first, val = vals. second[1 ], dom_size = vals. second[2 ]) ≈
146
+ @test f (vals. first, val= vals. second[1 ], dom_size= vals. second[2 ]) ≈
142
147
results[key]
143
148
end
144
149
end
147
152
148
153
for (f, results) in funcs_dom
149
154
for (key, vals) in enumerate (data)
150
- @test f (vals. first, dom_size = vals. second[2 ]) ≈ results[key]
155
+ @test f (vals. first, dom_size= vals. second[2 ]) ≈ results[key]
151
156
end
152
157
end
153
158
0 commit comments