aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/integer_matrix.h
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2012-10-10 14:06:05 +0200
committerThomas White <taw@physics.org>2012-10-10 14:07:06 +0200
commit8c8fb4cd5a2af475855bff42187d408f8df5de98 (patch)
treee31ae465d14b9746a6d7823c321e5736dfea86f8 /libcrystfel/src/integer_matrix.h
parent8f50f49ed22b9adfc03a015f142c0e887e686e7b (diff)
Handle weird unique axis variants of all point groups
Diffstat (limited to 'libcrystfel/src/integer_matrix.h')
-rw-r--r--libcrystfel/src/integer_matrix.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/libcrystfel/src/integer_matrix.h b/libcrystfel/src/integer_matrix.h
new file mode 100644
index 00000000..41780629
--- /dev/null
+++ b/libcrystfel/src/integer_matrix.h
@@ -0,0 +1,68 @@
+/*
+ * integer_matrix.h
+ *
+ * A small integer matrix library
+ *
+ * Copyright © 2012 Deutsches Elektronen-Synchrotron DESY,
+ * a research centre of the Helmholtz Association.
+ *
+ * Authors:
+ * 2012 Thomas White <taw@physics.org>
+ *
+ * This file is part of CrystFEL.
+ *
+ * CrystFEL is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * CrystFEL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with CrystFEL. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef INTEGER_MATRIX_H
+#define INTEGER_MATRIX_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+/**
+ * IntegerMatrix
+ *
+ * The IntegerMatrix is an opaque data structure representing an integer matrix.
+ **/
+typedef struct _integermatrix IntegerMatrix;
+
+
+/* Alloc/dealloc */
+extern IntegerMatrix *intmat_new(unsigned int rows, unsigned int cols);
+extern void intmat_free(IntegerMatrix *m);
+
+/* Get/set */
+extern void intmat_set(IntegerMatrix *m, unsigned int i, unsigned int j,
+ signed int v);
+extern signed int intmat_get(IntegerMatrix *m, unsigned int i, unsigned int j);
+
+/* Matrix-(int)vector multiplication */
+extern signed int *intmat_intvec_mult(IntegerMatrix *m, signed int *vec);
+
+/* Matrix-matrix multiplication */
+extern IntegerMatrix *intmat_intmat_mult(IntegerMatrix *a, IntegerMatrix *b);
+
+/* Inverse */
+extern IntegerMatrix *intmat_inverse(IntegerMatrix *m);
+
+/* Determinant */
+extern signed int intmat_det(IntegerMatrix *m);
+
+/* Diagnostics */
+extern void intmat_print(IntegerMatrix *m);
+
+#endif /* INTEGER_MATRIX_H */