hkl-parameter-private: hkl Reference Manual

## hkl-parameter-private hkl-parameter-private |

## Functions

return | g_quark_from_static_string ()
else | fprintf ()
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 ()

## 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
HklParameter * | dup
double | alea
double | factor
typedef | darray_parameter
typedef | darray_const_parameter

## Description

## Functions

### g_quark_from_static_string ()

    return
    g_quark_from_static_string ();

### fprintf ()

    else
    fprintf (f Param1);

### 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);

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

## 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;
    } 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 |  |

### 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);
    };

### HKL_PARAMETER_OPERATIONS_DEFAULTS

    #define             HKL_PARAMETER_OPERATIONS_DEFAULTS

### dup

    	HklParameter *dup = HKL_MALLOC(HklParameter);

### alea

    		double alea = (double)rand() / (RAND_MAX + 1.);

### factor

    	double factor = hkl_unit_factor(self->unit, self->punit);

### darray_parameter

    typedef darray(HklParameter *) darray_parameter;

### darray_const_parameter

    typedef darray(const HklParameter) darray_const_parameter;