| 53 | { |
| 54 | template <typename sample_type> |
| 55 | double operator() ( |
| 56 | const sample_type& a, |
| 57 | const sample_type& b |
| 58 | ) const |
| 59 | { |
| 60 | const double temp = length(a)*length(b); |
| 61 | if (temp == 0) |
| 62 | return 0; |
| 63 | else |
| 64 | return 1-dot(a,b)/temp; |
| 65 | } |
| 66 | }; |
| 67 | |
| 68 | // ---------------------------------------------------------------------------------------- |