# SCM Repository

[matrix] Diff of /pkg/Matrix/src/t_sparseVector.c
 [matrix] / pkg / Matrix / src / t_sparseVector.c

# Diff of /pkg/Matrix/src/t_sparseVector.c

revision 2676, Sat Jun 25 19:14:05 2011 UTC revision 2677, Sat Jun 25 19:18:12 2011 UTC
# Line 126  Line 126
126   *   *
127   * @return   * @return
128   */   */
129  Type_ans sparseVector_sub(int i, int nnz_v, int* v_i, Type_ans* v_x, int len_v)  static R_INLINE
130    Type_ans sparseVector_sub(int64_t i, int nnz_v, double* v_i, Type_ans* v_x, int64_t len_v)
131  {  {
132  // int    *v_i = INTEGER(GET_SLOT(vec, Matrix_iSym));  // double *v_i = INTEGER(GET_SLOT(vec, Matrix_iSym));
133  // double *v_x =   REAL (GET_SLOT(vec, Matrix_xSym)); -- try to be agnostic about type  // double *v_x =   REAL (GET_SLOT(vec, Matrix_xSym)); -- try to be agnostic about type
134  // int len_v = asInteger(GET_SLOT(vec, Matrix_lengthSym));  // int64_t  len_v = (int64_t) asReal(GET_SLOT(vec, Matrix_lengthSym));
135      int j, i1 = (i % len_v) +1;      int64_t i1 = (i % len_v) +1;
136      // NB: Rely on the "validity": the i-slot  v_i[] is strictly sorted increasingly      // NB: Rely on the "validity": the i-slot  v_i[] is strictly sorted increasingly
137      for(j=0; j < nnz_v; j++) {      for(int j=0; j < nnz_v; j++) {
138          if(i1 > v_i[j])          if(i1 > v_i[j])
139              continue;              continue;
140          // else: i1 <= v_i[j]          // else: i1 <= v_i[j]

Legend:
 Removed from v.2676 changed lines Added in v.2677

 R-Forge@R-project.org ViewVC Help Powered by ViewVC 1.0.0
Thanks to: