## hkl-matrix-private

hkl-matrix-private

## Functions

HklMatrix * | hkl_matrix_dup ()
void | hkl_matrix_init_from_euler ()
void | hkl_matrix_matrix_set ()
void | hkl_matrix_init_from_two_vector ()
void | hkl_matrix_fprintf ()
void | hkl_matrix_to_euler ()
void | hkl_matrix_times_vector ()
void | hkl_matrix_transpose ()
double | hkl_matrix_det ()
int | hkl_matrix_solve ()
int | hkl_matrix_is_null ()
void | hkl_matrix_div_double ()
int | hkl_matrix_inv ()

## Types and Values

| HklMatrix

## Description

## Functions

### hkl_matrix_dup ()

    HklMatrix *
    hkl_matrix_dup (const HklMatrix *self);

[skip]

### hkl_matrix_init_from_euler ()

    void
    hkl_matrix_init_from_euler (HklMatrix *self,
                                double euler_x,
                                double euler_y);

Create a rotation HklMatrix from three eulerians angles.

#### Parameters

self | the HklMatrix to initialize |
euler_x | the eulerian value along X |
euler_y | the eulerian value along Y |
euler_z | the eulerian value along Z |

### hkl_matrix_matrix_set ()

    void
    hkl_matrix_matrix_set (HklMatrix *self);

`todo` test

[skip]

#### Parameters

self | the this ptr |
m | the matrix to set |

### hkl_matrix_init_from_two_vector ()

    void
    hkl_matrix_init_from_two_vector (HklMatrix *self,
                                     const HklVector *v1,
                                     const HklVector *v2);

Create an HklMatrix which represent a direct oriented base of the space the first row correspond to the |v1|, the second row |v2| and the last one is |v1 ^ v2|

#### Parameters

self | The HklMatrix to initialize |
v1 | the first HklVector |
v2 | the second HklVector |

### hkl_matrix_fprintf ()

    void
    hkl_matrix_fprintf (FILE *file,
                        const HklMatrix *self);

printf an HklMatrix into a FILE stream.

#### Parameters

file | the FILE stream |
self | the HklMatrix to print into the file stream |

### hkl_matrix_to_euler ()

    void
    hkl_matrix_to_euler (const HklMatrix *self,
                         double *euler_x,
                         double *euler_y,
                         double *euler_z);

compute the three eulerians values for a given rotation HklMatrix

#### Parameters

self | the rotation HklMatrix use to compute the eulerians angles |
euler_x | the eulerian value along X |
euler_y | the eulerian value along Y |
euler_z | the eulerian value along Z |

### hkl_matrix_times_vector ()

    void
    hkl_matrix_times_vector (const HklMatrix *self,
                             HklVector *v);

multiply an HklVector by an HklMatrix

#### Parameters

self | the HklMatrix use to multiply the HklVector |
v | the HklVector multiply by the HklMatrix |

### hkl_matrix_transpose ()

    void
    hkl_matrix_transpose (HklMatrix *self);

transpose an HklMatrix

#### Parameters

self | the HklMatrix to transpose |

### hkl_matrix_det ()

    double
    hkl_matrix_det (const HklMatrix *self);

compute the determinant of an HklMatrix

#### Parameters

self | the HklMatrix use to compute the determinant |

#### Returns

the determinant of the self HklMatrix Todo: test

### hkl_matrix_solve ()

    int
    hkl_matrix_solve (const HklMatrix *self,
                      HklVector *x,
                      const HklVector *b);

solve the system self . X = b

#### Parameters

self | The HklMatrix of the system |
x | the HklVector to compute. |
b | the hklVector of the system to solve. |

#### Returns

-1 if the système has no solution, 0 otherwise. Todo: test

### hkl_matrix_is_null ()

    int
    hkl_matrix_is_null (const HklMatrix *self);

is all hklMatrix elementes bellow HKL_EPSILON

#### Parameters

self | the HklMatrix to test |

#### Returns

TRUE if the self HklMatrix is null Todo: test

### hkl_matrix_div_double ()

    void
    hkl_matrix_div_double (HklMatrix *self,
                           double d);

divide an HklMatrix by a constant.

[skip]

#### Parameters

self | the HklMatrix to divide. |
d | constant use to divide the HklMatrix |

### hkl_matrix_inv ()

    int
    hkl_matrix_inv (const HklMatrix *self,
                    HklMatrix *inv);

#### Parameters

self | The HklMatrix of the system |

#### Returns

-1 if the HklMatrix can not be inverted, 0 otherwise. Todo: test

## Types and Values

### HklMatrix

    typedef struct {
    	double data[3][3];
    } HklMatrix;