aboutsummaryrefslogtreecommitdiff
path: root/src/utils.h
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-06-28 12:12:49 +0200
committerThomas White <taw@physics.org>2012-02-22 15:26:51 +0100
commite3f93b71683c4e65d5e351c54174df0fabc11905 (patch)
tree6d08e8f63f8965be59d4ff9e643e11620e11cf85 /src/utils.h
parentce87fce11cbbbdc1c8ff1611eaf3255809ab6c87 (diff)
process_hkl: Use a different (array) indexing method to speed it up lots
Diffstat (limited to 'src/utils.h')
-rw-r--r--src/utils.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/utils.h b/src/utils.h
index b01725dd..14ef45a7 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -176,6 +176,28 @@ static inline double angle_between(double x1, double y1, double z1,
#include "list_tmp.h"
+/* ----------- Reflection lists indexed by sequence (not indices) ----------- */
+
+typedef struct _reflitemlist ReflItemList; /* Opaque */
+
+struct refl_item {
+ signed int h;
+ signed int k;
+ signed int l;
+};
+
+extern void clear_items(ReflItemList *items);
+extern ReflItemList *new_items(void);
+extern void delete_items(ReflItemList *items);
+extern void add_item(ReflItemList *items,
+ signed int h, signed int k, signed int l);
+extern int find_item(ReflItemList *items,
+ signed int h, signed int k, signed int l);
+extern struct refl_item *get_item(ReflItemList *items, int i);
+extern int num_items(ReflItemList *items);
+extern unsigned int *items_to_counts(ReflItemList *items);
+
+
/* ------------------------------ Message macros ---------------------------- */
#define ERROR(...) fprintf(stderr, __VA_ARGS__)