From dfc44d4a4267f0ba7761ed6b01fe0790da96d894 Mon Sep 17 00:00:00 2001 From: bjyb <1091839467@qq.com> Date: Tue, 19 Sep 2023 16:15:59 +0800 Subject: [PATCH] Update distance_functions.cpp --- .../dbmind/db4ai/executor/distance_functions.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/gausskernel/dbmind/db4ai/executor/distance_functions.cpp b/src/gausskernel/dbmind/db4ai/executor/distance_functions.cpp index af759c590..bac87b97b 100644 --- a/src/gausskernel/dbmind/db4ai/executor/distance_functions.cpp +++ b/src/gausskernel/dbmind/db4ai/executor/distance_functions.cpp @@ -37,6 +37,13 @@ IDENTIFICATION #endif +/*Euclidean distance: the distance between two points, +that is, the distance we usually calculate. +Manhattan distance: the sum of absolute +wheelbase of two points in the standard coordinate system. +Chebyshev distance: the maximum value of the +numerical difference of each coordinate.*/ + /* * L1 distance (Manhattan) * We sum using cascaded summation @@ -44,6 +51,10 @@ IDENTIFICATION * are not available or for the the case that the dimension is not a multiple * of the width of the registers */ + +/*Vectorization refers to using an array instead of a scalar +to manipulate each element in the array.*/ + static force_inline double l1_non_vectorized(double const * p, double const * q, uint32_t const dimension) { double term = 0.;