## hkl-parameter-private

hkl-parameter-private

## Functions

GQuark | hkl_parameter_error_quark ()
HklParameter * | hkl_parameter_copy_real ()
void | hkl_parameter_free_real ()
int | hkl_parameter_init_copy_real ()
double | hkl_parameter_value_get_closest_real ()
int | hkl_parameter_value_set_real ()
void | hkl_parameter_value_set_smallest_in_range_real ()
void | hkl_parameter_randomize_real ()
int | hkl_parameter_is_permutable_real ()
int | hkl_parameter_is_valid_real ()
void | hkl_parameter_fprintf_real ()
const HklVector * | hkl_parameter_axis_v_get_real ()
const HklQuaternion * | hkl_parameter_quaternion_get_real ()
int | hkl_parameter_transformation_cmp_real ()
HklVector | hkl_parameter_transformation_apply_real ()
double | hkl_parameter_orthodromic_distance_get_real ()
HklParameterType | hkl_parameter_type_get_real ()
HklParameter * | hkl_parameter_new ()
int | hkl_parameter_init_copy ()
int | hkl_parameter_is_permutable ()
double | hkl_parameter_value_get_closest ()
void | hkl_parameter_value_set_smallest_in_range ()
int | hkl_parameter_is_valid ()
int | hkl_parameter_is_valid_range ()
void | hkl_parameter_fprintf ()
int | hkl_parameter_transformation_cmp ()
HklVector | hkl_parameter_transformation_apply ()
double | hkl_parameter_orthodromic_distance_get ()
HklParameterType | hkl_parameter_type_get ()

## Types and Values

| HklParameter
#define | HKL_PARAMETER_DEFAULTS
#define | HKL_PARAMETER_DEFAULTS_LENGTH
#define | HKL_PARAMETER_DEFAULTS_ANGLE
#define | HKL_PARAMETER_ERROR
enum | HklParameterError
struct | HklParameterOperations
#define | HKL_PARAMETER_OPERATIONS_DEFAULTS
typedef | darray_parameter
typedef | darray_const_parameter

## Description

## Functions

### hkl_parameter_error_quark ()

    GQuark
    hkl_parameter_error_quark (void);

### hkl_parameter_copy_real ()

    HklParameter *
    hkl_parameter_copy_real (const HklParameter *self);

### hkl_parameter_free_real ()

    void
    hkl_parameter_free_real (HklParameter *self);

### hkl_parameter_init_copy_real ()

    int
    hkl_parameter_init_copy_real (HklParameter *self,
                                  const HklParameter *src,
                                  GError **error);

### hkl_parameter_value_get_closest_real ()

    double
    hkl_parameter_value_get_closest_real (const HklParameter *self);

### hkl_parameter_value_set_real ()

    int
    hkl_parameter_value_set_real (HklParameter *self,
                                  double value,
                                  HklUnitEnum unit_type,
                                  GError **error);

### hkl_parameter_value_set_smallest_in_range_real ()

    void
    hkl_parameter_value_set_smallest_in_range_real
                                   ();

### hkl_parameter_randomize_real ()

    void
    hkl_parameter_randomize_real (HklParameter *self);

### hkl_parameter_is_permutable_real ()

    int
    hkl_parameter_is_permutable_real ();

### hkl_parameter_is_valid_real ()

    int
    hkl_parameter_is_valid_real (const HklParameter *self);

### hkl_parameter_fprintf_real ()

    void
    hkl_parameter_fprintf_real (FILE *f,
                                const HklParameter *self);

### hkl_parameter_axis_v_get_real ()

    const HklVector *
    hkl_parameter_axis_v_get_real ();

### hkl_parameter_quaternion_get_real ()

    const HklQuaternion *
    hkl_parameter_quaternion_get_real ();

### hkl_parameter_transformation_cmp_real ()

    int
    hkl_parameter_transformation_cmp_real (const HklParameter *self,
                                           const HklParameter *p2);

### hkl_parameter_transformation_apply_real ()

    HklVector
    hkl_parameter_transformation_apply_real
                                   ();

### hkl_parameter_orthodromic_distance_get_real ()

    double
    hkl_parameter_orthodromic_distance_get_real
                                   (const HklParameter *self);

### hkl_parameter_type_get_real ()

    HklParameterType
    hkl_parameter_type_get_real (const HklParameter *self);

### hkl_parameter_new ()

    HklParameter *
    hkl_parameter_new (const char *name,
                       const char *description,
                       double min,
                       double value,
                       double max,
                       int fit,
                       int changed,
                       const HklUnit *unit,
                       const HklUnit *punit,
                       GError **error);

create a new HklParameter

[skip]

### hkl_parameter_init_copy ()

    int
    hkl_parameter_init_copy (HklParameter *self,
                             const HklParameter *src,
                             GError **error);

[skip]

#### Parameters

self | the this ptr |
src | the parameter to copy from |
error | return location for a GError, or NULL |

#### Returns

TRUE on success, FALSE if an error occurred

### hkl_parameter_is_permutable ()

    int
    hkl_parameter_is_permutable (const HklParameter *self);

check if the HklParameter can be use to perform permutation exemple axis rotation can avec equivalent position at different values

[skip]

### hkl_parameter_value_get_closest ()

    double
    hkl_parameter_value_get_closest (const HklParameter *self,
                                     const HklParameter *ref);

#### Parameters

self | the this ptr |
ref | the reference HklParameter |

#### Returns

the closest value of the ref HklParameter from the current self HklParameter

### hkl_parameter_value_set_smallest_in_range ()

    void
    hkl_parameter_value_set_smallest_in_range
                                   (HklParameter *self);

[skip]

#### Parameters

self | the this ptr |

### hkl_parameter_is_valid ()

    int
    hkl_parameter_is_valid (const HklParameter *self);

check if the value of the HklParameter is in the min,max range

[skip]

### hkl_parameter_is_valid_range ()

    int
    hkl_parameter_is_valid_range (const HklParameter *self);

check if the value of the HklParameter is in the min,max range strictly (min < value < max).

[skip]

### hkl_parameter_fprintf ()

    void
    hkl_parameter_fprintf (FILE *f,
                           const HklParameter *self);

print into the FILE f an HklParameter

[skip]

### hkl_parameter_transformation_cmp ()

    int
    hkl_parameter_transformation_cmp (const HklParameter *self,
                                      const HklParameter *p2);

[skip]

#### Parameters

self | the this ptr |
p2 | the second parameter to test with |

#### Returns

if two parameter transformations are compatibles. (0) compatible, (!= 0) not-compatible

### hkl_parameter_transformation_apply ()

    HklVector
    hkl_parameter_transformation_apply (const HklParameter *self,
                                        const HklVector *v);

[skip]

#### Parameters

self | the this ptr |
v | the HklVector to transform |

#### Returns

the transformed HklVector

### hkl_parameter_orthodromic_distance_get ()

    double
    hkl_parameter_orthodromic_distance_get
                                   (const HklParameter *self,
                                    double value);

[skip]

#### Parameters

self | the this ptr |
value | the second double value of the axis. |

#### Returns

the orthodromic distance of an axis between its _value and the value

### hkl_parameter_type_get ()

    HklParameterType
    hkl_parameter_type_get (const HklParameter *self);

[skip]

#### Parameters

self | the this ptr |

#### Returns

the HklParameterType of the parameter.

## Types and Values

### HklParameter

    typedef struct {
    	const char *name;
    	const char *description;
    	HklInterval range;
    	double _value;
    	const HklUnit *unit;
    	const HklUnit *punit;
    	int fit;
    	int changed;
    	const HklParameterOperations *ops;
            HklParameterType type;
    } HklParameter;

### HKL_PARAMETER_DEFAULTS

    #define HKL_PARAMETER_DEFAULTS .name="dummy", .description="no description", .range={.min=-DBL_MAX, .max=DBL_MAX}, ._value=0, .unit=NULL, .punit=NULL, .fit=TRUE, .changed=TRUE, .ops = &hkl_parameter_operations_defaults

### HKL_PARAMETER_DEFAULTS_LENGTH

    #define HKL_PARAMETER_DEFAULTS_LENGTH HKL_PARAMETER_DEFAULTS, .unit = &hkl_unit_length_meter, .punit = &hkl_unit_length_meter

### HKL_PARAMETER_DEFAULTS_ANGLE

    #define HKL_PARAMETER_DEFAULTS_ANGLE HKL_PARAMETER_DEFAULTS, .range={.min=-M_PI, .max=M_PI}, .unit = &hkl_unit_angle_rad, .punit = &hkl_unit_angle_deg

### HKL_PARAMETER_ERROR

    #define HKL_PARAMETER_ERROR hkl_parameter_error_quark ()

### enum HklParameterError

#### Members

HKL_PARAMETER_ERROR_MIN_MAX_SET |  |
HKL_PARAMETER_ERROR_VALUE_SET |  |
HKL_PARAMETER_ERROR_INIT |  |

### struct HklParameterOperations

    struct HklParameterOperations {
    	HklParameter *        (*copy)(const HklParameter *self);
    	void                  (*free)(HklParameter *self);
    	int                   (*init_copy)(HklParameter *self, const HklParameter *src,
    					   GError **error);
    	double                (*get_value_closest)(const HklParameter *self,
    						   const HklParameter *other);
    	int                   (*set_value)(HklParameter *self, double value,
    					   HklUnitEnum unit_type, GError **error);
    	void                  (*set_value_smallest_in_range)(HklParameter *self);
    	void                  (*randomize)(HklParameter *self);
            int                   (*is_permutable)(const HklParameter *self);
    	int                   (*is_valid)(const HklParameter *self);
    	int                   (*is_valid_range)(const HklParameter *self);
    	void                  (*fprintf)(FILE *f, const HklParameter *self);
    	const HklVector *     (*axis_v_get)(const HklParameter *self);
    	const HklQuaternion * (*quaternion_get)(const HklParameter *self);
    	int                   (*transformation_cmp)(const HklParameter *self, const HklParameter *p2);
    	HklVector             (*transformation_apply)(const HklParameter *self, const HklVector *v);
            double                (*orthodromic_distance_get)(const HklParameter *self, double v);
            HklParameterType      (*type_get) (const HklParameter *self);
    };

### HKL_PARAMETER_OPERATIONS_DEFAULTS

    #define             HKL_PARAMETER_OPERATIONS_DEFAULTS

### darray_parameter

    typedef darray(HklParameter *) darray_parameter;

### darray_const_parameter

    typedef darray(const HklParameter) darray_const_parameter;