Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
extra_compile_args += ['-march=native',]

if os.name != 'nt':
extra_compile_args += ['-O3', '-ffast-math', '-fno-associative-math']
extra_compile_args += ['-O3']

# Add multithreaded build flag for all platforms using Python 3 and
# for non-Windows Python 2 platforms
Expand Down
9 changes: 4 additions & 5 deletions src/annoylib.h
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ struct Angular : Base {
T norm;
};
T v[ANNOYLIB_V_ARRAY_SIZE];
};
} __attribute__((__packed__));
template<typename S, typename T>
static inline T distance(const Node<S, T>* x, const Node<S, T>* y, int f) {
// want to calculate (a/|a| - b/|b|)^2
Expand Down Expand Up @@ -549,7 +549,7 @@ struct DotProduct : Angular {
T norm;
bool built;
T v[ANNOYLIB_V_ARRAY_SIZE];
};
} __attribute__((__packed__));

static const char* name() {
return "dot";
Expand Down Expand Up @@ -709,8 +709,7 @@ struct Hamming : Base {
S n_descendants;
S children[2];
T v[ANNOYLIB_V_ARRAY_SIZE];
};

} __attribute__((__packed__));
static const size_t max_iterations = 20;

template<typename T>
Expand Down Expand Up @@ -810,7 +809,7 @@ struct Minkowski : Base {
T a; // need an extra constant term to determine the offset of the plane
S children[2];
T v[ANNOYLIB_V_ARRAY_SIZE];
};
} __attribute__((__packed__));
template<typename S, typename T>
static inline T margin(const Node<S, T>* n, const T* y, int f) {
return n->a + dot(n->v, y, f);
Expand Down