"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Basic/Core/pdlbroadcast.c" between
PDL-2.077.tar.gz and PDL-2.078.tar.gz

About: PDL (Perl Data Language) aims to turn perl into an efficient numerical language for scientific computing (similar to IDL and MatLab).

pdlbroadcast.c  (PDL-2.077):pdlbroadcast.c  (PDL-2.078)
skipping to change at line 286 skipping to change at line 286
} }
} }
if (!load_only) if (!load_only)
for (i=0; i<vtable->npdls; i++) { for (i=0; i<vtable->npdls; i++) {
PDL_Indx ninds = vtable->par_realdims[i]; PDL_Indx ninds = vtable->par_realdims[i];
short flags = vtable->par_flags[i]; short flags = vtable->par_flags[i];
if (!ninds || !(flags & PDL_PARAM_ISPHYS)) continue; if (!ninds || !(flags & PDL_PARAM_ISPHYS)) continue;
pdl *pdl = pdls[i]; pdl *pdl = pdls[i];
PDL_Indx *dims = pdl->dims; PDL_Indx *dims = pdl->dims;
for (j=0; j<ninds; j++) { for (j=0; j<ninds; j++) {
ind_id = PDL_IND_ID(vtable, i, j); PDL_Indx ind_id = PDL_IND_ID(vtable, i, j), ind_sz = ind_sizes[ind_id];
if (ind_sizes[ind_id] > 1 && ind_sizes[ind_id] != dims[j]) if (ind_sz > 1 && ind_sz != dims[j])
return pdl_make_error(PDL_EUSERERROR, return pdl_make_error(PDL_EUSERERROR,
"Error in %s: [phys] parameter '%s' index '%s' size %"IND_FLAG", but ndarray dim has size %"IND_FLAG"\n", "Error in %s: [phys] parameter '%s' index '%s' size %"IND_FLAG", but ndarray dim has size %"IND_FLAG"\n",
vtable->name, vtable->par_names[i], vtable->ind_names[ind_id], vtable->name, vtable->par_names[i], vtable->ind_names[ind_id],
ind_sizes[ind_id], dims[j] ind_sz, dims[j]
); );
} }
} }
PDLDEBUG_f(printf("pdl_dim_checks after:\n"); PDLDEBUG_f(printf("pdl_dim_checks after:\n");
printf(" ind_sizes: "); pdl_print_iarr(ind_sizes, vtable->ninds); printf(" ind_sizes: "); pdl_print_iarr(ind_sizes, vtable->ninds);
printf("\n")); printf("\n"));
return PDL_err; return PDL_err;
} }
/* The assumptions this function makes: /* The assumptions this function makes:
skipping to change at line 423 skipping to change at line 423
flags = broadcast->flags; /* shortcut for the remainder */ flags = broadcast->flags; /* shortcut for the remainder */
/* Make implicit inds */ /* Make implicit inds */
for(nth=0; nth<nimpl; nth++) { // Loop over number of impl icit broadcast dims for(nth=0; nth<nimpl; nth++) { // Loop over number of impl icit broadcast dims
for(j=0; j<npdls; j++) { // Now loop over the PDLs t o be merged for(j=0; j<npdls; j++) { // Now loop over the PDLs t o be merged
if(creating[j]) continue; // If jth PDL is null, don' t bother trying to match if(creating[j]) continue; // If jth PDL is null, don' t bother trying to match
if(pdls[j]->broadcastids[0]- // If we're off the end of the c urrent PDLs dimlist, if(pdls[j]->broadcastids[0]- // If we're off the end of the c urrent PDLs dimlist,
realdims[j] <= nth) // then just skip it. realdims[j] <= nth) // then just skip it.
continue; continue;
if(pdls[j]->dims[nth+realdims[j]] != 1) { // If the current dim in th PDL_Indx cur_pdl_dim = pdls[j]->dims[nth+realdims[j]];
e current PDL is not 1, if (vtable && j >= vtable->nparents && cur_pdl_dim == 1 && cur_pdl_di
m != broadcast->dims[nth])
return pdl_make_error(PDL_EUSERERROR,
"Error in %s: output parameter '%s' implicit dim %"IND_FLAG" size
%"IND_FLAG", but dim has size %"IND_FLAG"\n",
vtable->name, vtable->par_names[j], nth, broadcast->dims[nth],
cur_pdl_dim
);
if(cur_pdl_dim != 1) { // If the current dim in the current PDL is no
t 1,
if(broadcast->dims[nth] != 1) { // ... and the current planned size isn't 1, if(broadcast->dims[nth] != 1) { // ... and the current planned size isn't 1,
if(broadcast->dims[nth] != if(broadcast->dims[nth] != cur_pdl_dim) { // ... then check to
pdls[j]->dims[nth+realdims[j]]) { // ... then check to make make sure they're the same.
sure they're the same.
char buf0[BUFSIZ]; char buf0[BUFSIZ];
buf0[0] = '\0'; buf0[0] = '\0';
pdl_broadcast_mismatch_msg( pdl_broadcast_mismatch_msg(
buf0, pdls, broadcast, nth, j, nimpl, realdims, creating buf0, pdls, broadcast, nth, j, nimpl, realdims, creating
); );
return pdl_croak_param(vtable,j,"%s\n..",buf0); return pdl_croak_param(vtable,j,"%s\n..",buf0);
} }
/* If we're still here, they're the same -- OK! */ /* If we're still here, they're the same -- OK! */
} else { // current planned size is 1 -- mod it to match this PDL } else { // current planned size is 1 -- mod it to match this PDL
broadcast->dims[nth] = broadcast->dims[nth] = cur_pdl_dim;
pdls[j]->dims[nth+realdims[j]];
} }
PDL_BRC_INC(broadcast->incs, npdls, j, nth) = // Update the c orresponding data stride PDL_BRC_INC(broadcast->incs, npdls, j, nth) = // Update the c orresponding data stride
PDL_BREPRINC(pdls[j],flags[j],nth+realdims[j]);// from the PDL or from its vafftrans if relevant. PDL_BREPRINC(pdls[j],flags[j],nth+realdims[j]);// from the PDL or from its vafftrans if relevant.
} }
} }
} }
/* Go through everything again and make the real things */ /* Go through everything again and make the real things */
 End of changes. 5 change blocks. 
10 lines changed or deleted 17 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)