SCM Repository

[matrix] Diff of /pkg/src/Csparse.c
 [matrix] / pkg / src / Csparse.c

Diff of /pkg/src/Csparse.c

revision 2235, Wed Jul 23 10:24:17 2008 UTC revision 2236, Wed Jul 23 16:48:14 2008 UTC
# Line 23  Line 23
23      if (length(islot) < xp[ncol]) /* allow larger slots from over-allocation!*/      if (length(islot) < xp[ncol]) /* allow larger slots from over-allocation!*/
24          return          return
25              mkString(_("last element of slot p must match length of slots i and x"));              mkString(_("last element of slot p must match length of slots i and x"));
26      for (j = 0; j < length(islot); j++) {      for (j = 0; j < xp[ncol]; j++) {
27          if (xi[j] < 0 || xi[j] >= nrow)          if (xi[j] < 0 || xi[j] >= nrow)
28              return mkString(_("all row indices must be between 0 and nrow-1"));              return mkString(_("all row indices must be between 0 and nrow-1"));
29      }      }
# Line 31  Line 31
31      for (j = 0; j < ncol; j++) {      for (j = 0; j < ncol; j++) {
32          if (xp[j] > xp[j+1])          if (xp[j] > xp[j+1])
33              return mkString(_("slot p must be non-decreasing"));              return mkString(_("slot p must be non-decreasing"));
34          if(sorted)          if(sorted) /* only act if >= 2 entries in column j : */
35              for (k = xp[j] + 1; k < xp[j + 1]; k++) {              for (k = xp[j] + 1; k < xp[j + 1]; k++) {
36                  if (xi[k] < xi[k - 1])                  if (xi[k] < xi[k - 1])
37                      sorted = FALSE;                      sorted = FALSE;

Legend:
 Removed from v.2235 changed lines Added in v.2236

 root@r-forge.r-project.org ViewVC Help Powered by ViewVC 1.0.0
Thanks to: