| 45 | sample_type positive_center, negative_center; |
| 46 | |
| 47 | double operator() ( |
| 48 | const sample_type& x |
| 49 | ) const |
| 50 | { |
| 51 | // if x is closer to the positive class then return +1 |
| 52 | if (length(positive_center - x) < length(negative_center - x)) |
| 53 | return +1; |
| 54 | else |
| 55 | return -1; |
| 56 | } |
| 57 | }; |
| 58 | |
| 59 | // Later on in this example we will save our decision functions to disk. This |