Distances

Euclidean distance

In the code can be define as:
typedef distance::Euclidean_distance_function < V_d > E_d_t;
E_d_t e_d;

Weighted Euclidean distance

In the code can be define like below, when data is a data container. Very important is to construct proper weights vector for this functional. There is no checking procedure for the measuring if weights have the same size that single data.
typedef distance::Weighted_euclidean_distance_function < V_d, V_d > We_d_t;
V_d coefs;

neural_net::Ranges < V_v_d > data_ranges ( *data.begin() );
data_ranges ( data );

V_d::iterator pos_max;
V_d::iterator pos_min;

for ( pos_max = data_ranges.get_max().begin(),
  pos_min = data_ranges.get_min().begin();
  pos_max != data_ranges.get_max().end();
  ++pos_max, ++pos_min
)
{
  coefs.push_back ( operators::inverse ( ( *pos_max - *pos_min ) * ( *pos_max - *pos_min ) ) );
}
We_d_t we_d ( &coefs );
Valid HTML 4.01 Transitional Valid CSS!