Euclidean distance between two sets of tuples

Поиск
Список
Период
Сортировка
От Surfing
Тема Euclidean distance between two sets of tuples
Дата
Msg-id 512BAEA2.9040803@gmail.com
обсуждение исходный текст
Список pgsql-sql
Hi all,    I would like to ask if there exists a function to calculate the 
Euclidean distance between two rows of the same table.
Obviously, the distance between two non-numeric fields should be 0 if 
they are the same value, 1 otherwise.

In general, I need to compute an average distance between the subsets of 
rows, computed pairwise.
Example:
- Set 1: 10 rows
- Set 2: 15 rows
- Distances computed 150
I just need the value 1/150*(Sum of all the computed Euclidean distances).

I could write a procedure, but it would be nice if there already exists 
a function which at least computes a single Euclidean function between 
two rows.

Any suggestion?

Thank you.



В списке pgsql-sql по дате отправления:

Предыдущее
От: Don Parris
Дата:
Сообщение: Using Ltree For Hierarchical Structures
Следующее
От: mkumbale
Дата:
Сообщение: Creating a new database with a TEMPLATE did not work