Daylight v4.9
Release Date: 1 February 2008


dt_fp_similarity - compute the similarity coefficient of two fingerprints

Generic Prototype

dt_fp_similarity(dt_Handle, dt_Handle, dt_String) => dt_Real

C Prototype

#include "dt_finger.h"

dt_Real dt_fp_similarity(dt_Handle fp1, dt_Handle fp2, dt_Integer expr_len, dt_String expression)

FORTRAN Prototype

include ''

real*4 dt_f_fp_similarity(fp1, fp2, expression)

integer*4 fp1
integer*4 fp2
character*() expression


Calculates the similarity coefficient between the fingerprints. The calculation is not performed if the fingerprints are not compatible (different sizes) or if the objects are not fingerprints.

The expression can either be one of a list of built-in expressions or may be an arithmatic expression in terms of:

a - count of bits on in fp1, not on in fp2
b - count of bits on in fp2, not on in fp1
c - count of bits on in both fp1 and fp2
d - count of bits off in both fp1 and fp2
See the Daylight Theory Manual, the chapter on Fingerprints, for an explanation of the Similarity coefficient and expressions and see the expression(5) manpage for documentation of the expression syntax.

Return Value

Returns the similarity coefficient between two fingerprints. The similarity coefficient between all other incompatible objects is defined as -1.0.

Related Topics

expression(5) dt_fp_allocfp(3) dt_fp_bitcount(3) dt_fp_bitvalue(3) dt_fp_commonbitcount(3) dt_fp_euclid(3) dt_fp_fingertest(3) dt_fp_foldfp(3) dt_fp_generatefp(3) dt_fp_nbits(3) dt_fp_obitcount(3) dt_fp_obits(3) dt_fp_range(3) dt_fp_setbitvalue(3) dt_fp_setobitcount(3) dt_fp_setobits(3) dt_fp_setrange(3) dt_fp_tanimoto(3) dt_fp_tversky(3)