50 pd_set = malloc(
sizeof *pd_set);
74 p = malloc(pd_set->
n_p *
sizeof *p);
98 p = malloc(pd_set->
n_p *
sizeof *p);
124 for(i=0; i<pd_set->
n_p; i++) {
146 for(i=0; i<pd_set->
n_p; i++) {
170 dst = malloc(n *
sizeof *dst);
225 ERRPRINTF(
"set_str failed setting name\n");
255 if(p[i] != pd_array[i].start) {
321 if(abs(p - pd->
end) > dist ||
322 abs(p - pd->
start) > dist)
405 if(aligned >= pd->
end) {
422 if(aligned < pd->start) {
447 for(i=0; i<pd_set->
n_p; i++) {
470 if(aligned_p == NULL) {
471 ERRPRINTF(
"Error copying param array.\n");
492 if(pds_a->
n_p != pds_b->
n_p ||
534 for(i=0; i<
n_p; i++) {
590 if(p1 == NULL || p2 == NULL) {
591 ERRPRINTF(
"Parameter arrays should not be null.\n");
599 else if(p1[i] > p2[i]) {
629 int min_stride_i_dist;
638 direction = malloc(pd_set->
n_p *
sizeof *direction);
639 if(direction == NULL) {
643 for(j=0; j<pd_set->
n_p; j++) {
644 if(start[j] > end[j]) {
645 DBGPRINTF(
"parameter:%d will be decremented.\n", j);
649 DBGPRINTF(
"parameter:%d will be incremented.\n", j);
667 min_stride = INT_MAX;
669 for(j=0; j<pd_set->
n_p; j++) {
670 if(start[j] != end[j]) {
680 DBGPRINTF(
"min_stride:%d, min_stride_i:%d\n", min_stride, min_stride_i);
681 if(min_stride_i == -1) {
682 DBGPRINTF(
"start and end points identical, cannot stride.\n");
726 min_stride = min_stride*step;
727 min_stride_i_dist = end[min_stride_i] - start[min_stride_i];
729 DBGPRINTF(
"step:%d min_stride:%d min_stride_i_dist:%d\n",
730 step, min_stride, min_stride_i_dist);
735 for(j=0; j<pd_set->
n_p; j++) {
736 params[j] = start[j] + direction[j] *
738 ((end[j] - start[j]) /
746 DBGPRINTF(
"start[%d]:%d end{%d]:%d direction[%d]:%d\n", j, start[j], j,
747 end[j], j, direction[j]);
748 DBGPRINTF(
"start[min_stride_i]:%d end[min_stride_i]:%d\n",
749 start[min_stride_i], end[min_stride_i]);
751 DBGPRINTF(
"params[%d]:%d\n", j, params[j]);
759 for(j=0; j<pd_set->
n_p; j++) {
760 start_to_end = abs(end[j] - start[j]);
761 if(abs(end[j]-params[j]) > start_to_end ||
762 abs(start[j]-params[j]) > start_to_end)
765 DBGPRINTF(
"stepped params are outside interval limits\n");
777 DBGPRINTF(
"aligned params:\n");
876 if((*pd_set)->pd_array != NULL)
879 free((*pd_set)->pc_formula);
880 (*pd_set)->pc_formula = NULL;
896 for(i=0; i<
n_p; i++) {
897 free((*pd_array)[i].name);
898 (*pd_array)[i].name = NULL;