User:Karthik0112358/coefficient find: Difference between revisions
Jump to navigation
Jump to search
Created page with '<source lang="c"> //This is just a function. I am not sure where to place it (either in a separate place or with in the previous skeletal code). int coefficient_find(struct rel_r…' |
No edit summary |
||
| Line 16: | Line 16: | ||
if (var_apply_filter(vlist[c],filter)) { | if (var_apply_filter(vlist[c],filter)) { | ||
variables[*count] = var_sindex(vlist[c]); | variables[*count] = var_sindex(vlist[c]); | ||
coefficients[*count] = coefficient[c]; | |||
(*count)++; | (*count)++; | ||
} | } | ||
Latest revision as of 08:16, 30 June 2011
//This is just a function. I am not sure where to place it (either in a separate place or with in the previous skeletal code). int coefficient_find(struct rel_relation *rel, const var_filter_t *filter,real64 *coefficients,int32 *variables,int32 *count){ const struct var_variable **vlist=NULL; int32 len,c; real64 *coefficient; int status; assert(rel!=NULL && filter!=NULL); len = rel_n_incidences(rel); vlist = rel_incidence_list(rel); *count = 0; coefficient = (real64 *)rel_tmpalloc(len*sizeof(real64)); assert(coefficient !=NULL); status =(int32)Coefficient_Calculator(rel_instance(rel),coefficient); for (c=0; c < len; c++) { if (var_apply_filter(vlist[c],filter)) { variables[*count] = var_sindex(vlist[c]); coefficients[*count] = coefficient[c]; (*count)++; } } }