functions operating on benchmark and model parameters More...
#include <stdlib.h>#include <string.h>#include <limits.h>#include "pmm_log.h"#include "pmm_model.h"Go to the source code of this file.
Functions | |
| struct pmm_paramdef_set * | new_paramdef_set () |
| int * | init_param_array_start (struct pmm_paramdef_set *pd_set) |
| int * | init_param_array_end (struct pmm_paramdef_set *pd_set) |
| void | set_param_array_start (int *p, struct pmm_paramdef_set *pd_set) |
| void | set_param_array_end (int *p, struct pmm_paramdef_set *pd_set) |
| int * | init_param_array_copy (int *src, int n) |
| void | set_param_array_copy (int *dst, int *src, int n) |
| int | copy_paramdef (struct pmm_paramdef *dst, struct pmm_paramdef *src) |
| int | param_on_axis (int *p, int n, struct pmm_paramdef *pd_array) |
| int | params_within_paramdefs (int *p, int n, struct pmm_paramdef *pd_array) |
| int | param_within_paramdef (int p, struct pmm_paramdef *pd) |
| int | align_param (int param, struct pmm_paramdef *pd) |
| void | align_params (int *params, struct pmm_paramdef_set *pd_set) |
| int * | init_aligned_params (int *p, struct pmm_paramdef_set *pd_set) |
| int | isequal_paramdef_set (struct pmm_paramdef_set *pds_a, struct pmm_paramdef_set *pds_b) |
| int | isequal_paramdef_array (struct pmm_paramdef *pd_array_a, struct pmm_paramdef *pd_array_b, int n_p) |
| int | isequal_paramdef (struct pmm_paramdef *a, struct pmm_paramdef *b) |
| int | params_cmp (int *p1, int *p2, int n) |
| int | set_params_step_between_params (int *params, int *start, int *end, int step, struct pmm_paramdef_set *pd_set) |
| void | print_params (const char *output, int *p, int n) |
| void | print_paramdef_array (const char *output, struct pmm_paramdef *pd_array, int n) |
| void | print_paramdef (const char *output, struct pmm_paramdef *pd) |
| void | print_paramdef_set (const char *output, struct pmm_paramdef_set *pd_set) |
| void | free_paramdef_set (struct pmm_paramdef_set **pd_set) |
| void | free_paramdef_array (struct pmm_paramdef **pd_array, int n_p) |
functions operating on benchmark and model parameters
this file contains the code for working with parameters, parameter definitions, parameter arrays and so forth.
Definition in file pmm_param.c.
| int align_param | ( | int | param, |
| struct pmm_paramdef * | pd | ||
| ) |
Align a parameter according to stride and offset defined in corresponding paramdef.
| param | the value of the parameter we are aligning |
| pd | the corresponding parameter definition |
Definition at line 351 of file pmm_param.c.
| void align_params | ( | int * | params, |
| struct pmm_paramdef_set * | pd_set | ||
| ) |
align an array of parameters
| [in,out] | params | pointer to the array of parameters to align |
| [in] | pd_set | pointer to the corresponding parameter definition array |
Definition at line 441 of file pmm_param.c.
| int copy_paramdef | ( | struct pmm_paramdef * | dst, |
| struct pmm_paramdef * | src | ||
| ) |
Copy a parameter definition structure from src to dst
| src | pointer to the paramdef to copy |
| dst | pointer to the paramdef to copy into |
Definition at line 215 of file pmm_param.c.
| void free_paramdef_array | ( | struct pmm_paramdef ** | pd_array, |
| int | n_p | ||
| ) |
frees a parameter definition array
| pd_array | pointer to address of parameter definition array |
| n_p | number of parameter definitions in array |
Definition at line 893 of file pmm_param.c.
| void free_paramdef_set | ( | struct pmm_paramdef_set ** | pd_set | ) |
frees a parameter definition set structure and members it contains
| pd_set | pointer to address of parameter definition structure |
Definition at line 873 of file pmm_param.c.
| int* init_aligned_params | ( | int * | p, |
| struct pmm_paramdef_set * | pd_set | ||
| ) |
initialized a set of align a set of parameters based on a set of unaligned parameters and parameter definitions
| p | pointer to unaligned parameter array |
| pd_set | pointer to corresponding parameter definitions |
Definition at line 465 of file pmm_param.c.
| int* init_param_array_copy | ( | int * | src, |
| int | n | ||
| ) |
Copy a parameter array into a newly allocated parameter array
| src | pointer to the first element of the source parameter array |
| n | number of parameters in the source parameter array |
Definition at line 164 of file pmm_param.c.
| int* init_param_array_end | ( | struct pmm_paramdef_set * | pd_set | ) |
Initialise a parameter array to all end values, as descripted by the parameter definitions
| pd_set | pointer to parameter definition set structure |
Definition at line 94 of file pmm_param.c.
| int* init_param_array_start | ( | struct pmm_paramdef_set * | pd_set | ) |
Initialise a parameter array to all start values, as descripted by the parameter definitions
| pd_set | pointer to parameter definition set |
Definition at line 70 of file pmm_param.c.
| int isequal_paramdef | ( | struct pmm_paramdef * | a, |
| struct pmm_paramdef * | b | ||
| ) |
Check if two parameter definitions are identical
| a | pointer to first parameter definition |
| b | pointer to second parameter definition |
Definition at line 552 of file pmm_param.c.
| int isequal_paramdef_array | ( | struct pmm_paramdef * | pd_array_a, |
| struct pmm_paramdef * | pd_array_b, | ||
| int | n_p | ||
| ) |
Check if two parameter definition arrays are equal.
| pd_array_a | pointer to first parameter array |
| pd_array_b | pointer to second parameter array |
| n_p | number of parameters in the array |
Definition at line 529 of file pmm_param.c.
| int isequal_paramdef_set | ( | struct pmm_paramdef_set * | pds_a, |
| struct pmm_paramdef_set * | pds_b | ||
| ) |
Check if two parameter definition sets are identical
| pds_a | pointer to first parameter definition set |
| pds_b | pointer to second parameter definition set |
Definition at line 489 of file pmm_param.c.
|
read |
Create an empty parameter definition set structure. Note pd_array will not yet be allocated
Definition at line 46 of file pmm_param.c.
| int param_on_axis | ( | int * | p, |
| int | n, | ||
| struct pmm_paramdef * | pd_array | ||
| ) |
Test if a set of parameters lies on one of the parameter axes of the model, i.e. all but one parameter is at a start or all parameters are start (i.e. at the origin).
| p | pointer to the parameter array |
| n | number of elements in the parameter array |
| pd_array | pointer to the parameter defintions array |
Definition at line 246 of file pmm_param.c.
| int param_within_paramdef | ( | int | p, |
| struct pmm_paramdef * | pd | ||
| ) |
Test if a single parameter is within the limits defined by a parameter definition
| p | the parameter |
| pd | pointer to the parameter definition |
Definition at line 316 of file pmm_param.c.
| int params_cmp | ( | int * | p1, |
| int * | p2, | ||
| int | n | ||
| ) |
Compare two parameter arrays in terms of their elements. Arrays are equal if all elements are equal, otherwise the most significant non-equal element determines which is greater.
| p1 | pointer to first element of array 1 |
| p2 | pointer to first element of array 2 |
| n | number of elements in arrays |
Definition at line 586 of file pmm_param.c.
| int params_within_paramdefs | ( | int * | p, |
| int | n, | ||
| struct pmm_paramdef * | pd_array | ||
| ) |
Test if a set of parameters is within the limits defined by the parameter definitions or outside them
| p | pointer to parameter array |
| n | number of parameters |
| pd_array | pointer to parameter definition array |
Definition at line 291 of file pmm_param.c.
| void print_paramdef | ( | const char * | output, |
| struct pmm_paramdef * | pd | ||
| ) |
print a parameter definition
| output | output stream to print to |
| pd | pointer to parameter definition |
Definition at line 830 of file pmm_param.c.
| void print_paramdef_array | ( | const char * | output, |
| struct pmm_paramdef * | pd_array, | ||
| int | n | ||
| ) |
print a parameter definition array
| output | output stream to print to |
| pd_array | pointer to parameter definition array |
| n | number of elements in array |
Definition at line 813 of file pmm_param.c.
| void print_paramdef_set | ( | const char * | output, |
| struct pmm_paramdef_set * | pd_set | ||
| ) |
print a parameter definition set
| output | output stream to print to |
| pd_set | pointer to parameter definition set |
Definition at line 852 of file pmm_param.c.
| void print_params | ( | const char * | output, |
| int * | p, | ||
| int | n | ||
| ) |
Print a parameter array
| output | output stream to print to |
| p | pointer to the parameter array |
| n | size of the parameter array |
Definition at line 796 of file pmm_param.c.
| void set_param_array_copy | ( | int * | dst, |
| int * | src, | ||
| int | n | ||
| ) |
Copy from one parameter array to another
| dst | pointer to the destination array |
| src | pointer tot the source array |
| n | number of elements in each array |
Definition at line 193 of file pmm_param.c.
| void set_param_array_end | ( | int * | p, |
| struct pmm_paramdef_set * | pd_set | ||
| ) |
Set a parameter array to all end values, as described by the parameter definitions
| p | pointer to an array of parameters |
| pd_set | pointer to parameter definitions set structure |
Definition at line 142 of file pmm_param.c.
| void set_param_array_start | ( | int * | p, |
| struct pmm_paramdef_set * | pd_set | ||
| ) |
Set a parameter array to all start values, as described by the parameter definitions
| p | pointer to an array of parameters |
| pd_set | pointer to parameter definitions set structure |
Definition at line 120 of file pmm_param.c.
| int set_params_step_between_params | ( | int * | params, |
| int * | start, | ||
| int * | end, | ||
| int | step, | ||
| struct pmm_paramdef_set * | pd_set | ||
| ) |
Step between two points, according to a minimum step size defined in the parameter definitions.
| params | pointer to an array to store the parameters at the n-th step between the start and end points |
| start | pointer to array describing the start point |
| end | pointer to array describing the start point |
| step | number of steps to take along the interval (- to step backwards, + to step forwards) |
| pd_set | pointer to the parameter definition set |
Definition at line 623 of file pmm_param.c.
1.8.1.2