sta = ia[i+1];
ia[i+1] = nz;
}
- } else if (what_to_sum == SUM_IMGINARY_KEEP_LAST_REAL){
- /* merge {i,j,R1,I1} and {i,j,R2,I2} into {i,j,R1+R2,I2}*/
- nz = 0;
- sta = ia[0];
- for (i = 0; i < A->m; i++){
- for (j = sta; j < ia[i+1]; j++){
- if (mask[ja[j]] < ia[i]){
- ja[nz] = ja[j];
- a[2*nz] = a[2*j];
- a[2*nz+1] = a[2*j+1];
- mask[ja[j]] = nz++;
- } else {
- assert(ja[mask[ja[j]]] == ja[j]);
- a[2*mask[ja[j]]] += a[2*j];
- a[2*mask[ja[j]]+1] = a[2*j+1];
- }
- }
- sta = ia[i+1];
- ia[i+1] = nz;
- }
} else if (what_to_sum == SUM_REPEATED_REAL_PART){
int ymin, ymax, id;
ymax = ymin = a[1];
if what_to_sum = SUM_REPEATED_IMAGINARY_PART, we find entries {i,j,x + i y} and sum the y's if {i,j,Round(x)} are the same
For other matrix, what_to_sum = SUM_REPEATED_REAL_PART is the same as what_to_sum = SUM_REPEATED_IMAGINARY_PART
or what_to_sum = SUM_REPEATED_ALL
- if what_to_sum = SUM_IMGINARY_KEEP_LAST_REAL, we merge {i,j,R1,I1} and {i,j,R2,I2} into {i,j,R1+R2,I2}. Useful if I1 and I2 are time stamps,
- . and we use this to indicate that a user watched R1+R2 seconds, last watch is I2.
*/
-enum {SUM_REPEATED_NONE = 0, SUM_REPEATED_ALL, SUM_REPEATED_REAL_PART, SUM_REPEATED_IMAGINARY_PART, SUM_IMGINARY_KEEP_LAST_REAL};
+enum {SUM_REPEATED_NONE = 0, SUM_REPEATED_ALL, SUM_REPEATED_REAL_PART, SUM_REPEATED_IMAGINARY_PART, };
SparseMatrix SparseMatrix_sum_repeat_entries(SparseMatrix A, int what_to_sum);
SparseMatrix SparseMatrix_coordinate_form_add_entries(SparseMatrix A, int nentries, int *irn, int *jcn, void *val);
int SparseMatrix_is_symmetric(SparseMatrix A, int test_pattern_symmetry_only);