libcrystfel 0.11.0
|
Typedefs | |
typedef struct _integermatrix | IntegerMatrix |
Functions | |
IntegerMatrix * | intmat_new (unsigned int rows, unsigned int cols) |
IntegerMatrix * | intmat_copy (const IntegerMatrix *m) |
IntegerMatrix * | intmat_identity (int size) |
void | intmat_free (IntegerMatrix *m) |
void | intmat_size (const IntegerMatrix *m, unsigned int *rows, unsigned int *cols) |
void | intmat_set (IntegerMatrix *m, unsigned int i, unsigned int j, signed int v) |
signed int | intmat_get (const IntegerMatrix *m, unsigned int i, unsigned int j) |
void | intmat_zero (IntegerMatrix *m) |
IntegerMatrix * | intmat_create_3x3 (signed int m11, signed int m12, signed int m13, signed int m21, signed int m22, signed int m23, signed int m31, signed int m32, signed int m33) |
signed int * | transform_indices (const IntegerMatrix *P, const signed int *hkl) |
IntegerMatrix * | intmat_times_intmat (const IntegerMatrix *a, const IntegerMatrix *b) |
IntegerMatrix * | intmat_inverse (const IntegerMatrix *m) |
signed int | intmat_det (const IntegerMatrix *m) |
int | intmat_is_identity (const IntegerMatrix *m) |
int | intmat_is_inversion (const IntegerMatrix *m) |
int | intmat_equals (const IntegerMatrix *a, const IntegerMatrix *b) |
void | intmat_print (const IntegerMatrix *m) |
Matrix type containing only integers
typedef struct _integermatrix IntegerMatrix |
The IntegerMatrix
is an opaque data structure representing an integer matrix.
IntegerMatrix * intmat_copy | ( | const IntegerMatrix * | m | ) |
m | An IntegerMatrix |
m
, or NULL on error IntegerMatrix * intmat_create_3x3 | ( | signed int | m11, |
signed int | m12, | ||
signed int | m13, | ||
signed int | m21, | ||
signed int | m22, | ||
signed int | m23, | ||
signed int | m31, | ||
signed int | m32, | ||
signed int | m33 | ||
) |
m11 | Matrix element |
m12 | Matrix element |
m13 | Matrix element |
m21 | Matrix element |
m22 | Matrix element |
m23 | Matrix element |
m31 | Matrix element |
m32 | Matrix element |
m33 | Matrix element |
signed int intmat_det | ( | const IntegerMatrix * | m | ) |
m | An IntegerMatrix |
Calculates the determinant of m
. Inefficiently.
m
. int intmat_equals | ( | const IntegerMatrix * | a, |
const IntegerMatrix * | b | ||
) |
a | An IntegerMatrix |
b | An IntegerMatrix |
a
= b
. void intmat_free | ( | IntegerMatrix * | m | ) |
m | An IntegerMatrix |
Frees m
, unless m
is NULL in which case nothing is done.
signed int intmat_get | ( | const IntegerMatrix * | m, |
unsigned int | i, | ||
unsigned int | j | ||
) |
m | An IntegerMatrix |
i | column number to set |
j | row number to set |
Gets the i
,j
element of m
.
i
,j
element of m
. IntegerMatrix * intmat_identity | ( | int | size | ) |
size | The size of the (square) matrix |
size
, or NULL on error. IntegerMatrix * intmat_inverse | ( | const IntegerMatrix * | m | ) |
m | An IntegerMatrix |
Calculates the inverse of m
. Inefficiently.
Works only if the inverse of the matrix is also an integer matrix, i.e. if the determinant of m
is +/- 1.
m
, or NULL on error. int intmat_is_identity | ( | const IntegerMatrix * | m | ) |
m | An IntegerMatrix |
m
is an identity matrix. int intmat_is_inversion | ( | const IntegerMatrix * | m | ) |
m | An IntegerMatrix |
m
= -I, where I is an identity matrix. IntegerMatrix * intmat_new | ( | unsigned int | rows, |
unsigned int | cols | ||
) |
rows | Number of rows that the new matrix is to have |
cols | Number of columns that the new matrix is to have |
Allocates a new IntegerMatrix with all elements set to zero.
void intmat_print | ( | const IntegerMatrix * | m | ) |
void intmat_set | ( | IntegerMatrix * | m, |
unsigned int | i, | ||
unsigned int | j, | ||
signed int | v | ||
) |
m | An IntegerMatrix |
i | row number to set |
j | column number to set |
v | value to set to |
Sets the i
,j
element of m
to v
.
void intmat_size | ( | const IntegerMatrix * | m, |
unsigned int * | rows, | ||
unsigned int * | cols | ||
) |
m | An IntegerMatrix |
rows | Location to store number of rows |
cols | Location to store number of columns |
Sets rows
and cols
to the size of m
.
IntegerMatrix * intmat_times_intmat | ( | const IntegerMatrix * | a, |
const IntegerMatrix * | b | ||
) |
a | An IntegerMatrix |
b | An IntegerMatrix |
Multiplies the matrix a
by the matrix b
.
signed int * transform_indices | ( | const IntegerMatrix * | P, |
const signed int * | hkl | ||
) |
P | An IntegerMatrix |
hkl | An array of signed integers |
Apply transformation matrix P to a set of reciprocal space Miller indices.
In other words: Multiplies the matrix P
by the row vector hkl
. The size of vec
must equal the number of columns in P
, and the size of the result equals the number of rows in P
.
The multiplication looks like this: (a1, a2, a3) = (hkl1, hkl2, hkl3) P Therefore matching the notation in ITA chapter 5.1.