projects
/
smlar.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix compiler warnings
[smlar.git]
/
smlar.h
diff --git
a/smlar.h
b/smlar.h
index
82a1bcb
..
6410326
100644
(file)
--- a/
smlar.h
+++ b/
smlar.h
@@
-6,6
+6,8
@@
#include "access/tupdesc.h"
#include "catalog/pg_collation.h"
#include "access/tupdesc.h"
#include "catalog/pg_collation.h"
+#include <math.h>
+
typedef struct ProcTypeInfoData *ProcTypeInfo;
typedef struct ProcTypeInfoData {
typedef struct ProcTypeInfoData *ProcTypeInfo;
typedef struct ProcTypeInfoData {
@@
-58,7
+60,7
@@
typedef struct SimpleArray {
Datum *elems;
double *df; /* frequency in current doc */
uint32 *hash;
Datum *elems;
double *df; /* frequency in current doc */
uint32 *hash;
- int nelems;
+ int nelems;
ProcTypeInfo info;
} SimpleArray;
ProcTypeInfo info;
} SimpleArray;
@@
-80,19
+82,19
@@
int getSmlType(void);
* GiST
*/
* GiST
*/
-#define SmlarOverlapStrategy 1
-#define SmlarSimilarityStrategy 2
+#define SmlarOverlapStrategy
1
+#define SmlarSimilarityStrategy
2
struct SmlSign;
struct SmlSign* Array2HashedArray(ProcTypeInfo info, ArrayType *a);
/*
* Cache subsystem
*/
struct SmlSign;
struct SmlSign* Array2HashedArray(ProcTypeInfo info, ArrayType *a);
/*
* Cache subsystem
*/
-void* SearchArrayCache( void *cache, MemoryContext ctx, Datum a, ArrayType **da, SimpleArray **sa, struct SmlSign **ss );
+void* SearchArrayCache( void *cache, MemoryContext ctx, Datum a, ArrayType **da, SimpleArray **sa, struct SmlSign **ss );
typedef struct StatElem {
typedef struct StatElem {
-
Datum
datum;
- double idf; /* log(d/df) */
+
Datum
datum;
+ double idf; /* log(d/df) */
} StatElem;
typedef struct HashedElem {
} StatElem;
typedef struct HashedElem {
@@
-107,13
+109,13
@@
typedef struct SignedElem {
} SignedElem;
typedef struct StatCache {
} SignedElem;
typedef struct StatCache {
- StatElem *elems;
- int nelems;
- int64_t ndoc;
+ StatElem
*elems;
+ int
nelems;
+ int64_t
ndoc;
HashedElem *helems;
HashedElem *helems;
- int nhelems;
+ int
nhelems;
SignedElem *selems;
SignedElem *selems;
- ProcTypeInfo info;
+ ProcTypeInfo info;
} StatCache;
StatCache *initStatCache(MemoryContext ctx);
} StatCache;
StatCache *initStatCache(MemoryContext ctx);