Skip to content
Snippets Groups Projects
Select Git revision
  • a8b1780ee839c371b9120b21cdbc3311f89efb5f
  • main default protected
  • feat/statistics protected
  • feat/schemaStats protected
  • feat/password protected
  • refactor/remove-graphcounts protected
  • feat/cypher2query-negations2 protected
  • feat/airecommender protected
  • feat/cypher-visual protected
  • feat/mcp protected
  • feature-flag protected
  • feat/optionalDefault protected
  • feat/refactorarray protected
  • feat/attributes-db protected
  • fix/mlservice protected
  • feat/median protected
  • feat/grammar2sql protected
  • feat/fetchSchemaNew protected
  • feat/monolith protected
  • feat/aggComparison protected
  • feat/maxOutput protected
  • v1.62.0
  • v1.61.1
  • v1.61.0
  • v1.60.1
  • v1.60.0
  • v1.59.0
  • v1.58.1
  • v1.58.0
  • v1.57.1
  • v1.57.0
  • v1.56.0
  • v1.55.2
  • v1.55.1
  • v1.55.0
  • v1.54.0
  • v1.53.1
  • v1.53.0
  • v1.52.1
  • v1.52.0
  • v1.51.0
41 results

.gitlab-ci.yml

Blame
  • emd.h 1.52 KiB
    #ifdef __cplusplus
    extern "C" {
    #endif // DEBUG
    
    #ifndef _EMD_H
    #define _EMD_H
    /*
        emd.h
    
        Last update: 3/24/98
    
        An implementation of the Earth Movers Distance.
        Based of the solution for the Transportation problem as described in
        "Introduction to Mathematical Programming" by F. S. Hillier and 
        G. J. Lieberman, McGraw-Hill, 1990.
    
        Copyright (C) 1998 Yossi Rubner
        Computer Science Department, Stanford University
        E-Mail: rubner@cs.stanford.edu   URL: http://vision.stanford.edu/~rubner
    */
    
    
    /* DEFINITIONS */
    #define MAX_SIG_SIZE   100
    #define MAX_ITERATIONS 500
    #define INFINITY       1e20
    #define EPSILON        1e-6
    
    /*****************************************************************************/
    /* feature_t SHOULD BE MODIFIED BY THE USER TO REFLECT THE FEATURE TYPE      */
    typedef float feature_t;
    /*****************************************************************************/
    
    
    typedef struct
    {
      int n;                /* Number of features in the signature */
      feature_t *Features;  /* Pointer to the features vector */
      float *Weights;       /* Pointer to the weights of the features */
    } signature_t;
    
    
    typedef struct
    {
      int from;             /* Feature number in signature 1 */
      int to;               /* Feature number in signature 2 */
      float amount;         /* Amount of flow from "from" to "to" */
    } flow_t;
    
    
    
    float emd(signature_t *Signature1, signature_t *Signature2,
    	  float (*func)(feature_t *, feature_t *),
    	  flow_t *Flow, int *FlowSize);
    
    #endif
    
    #ifdef __cplusplus
    }
    #endif // __cplusplus