SCM

SCM Repository

[matrix] Diff of /pkg/Matrix/R/Csparse.R
ViewVC logotype

Diff of /pkg/Matrix/R/Csparse.R

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2676, Sat Jun 25 19:14:05 2011 UTC revision 2677, Sat Jun 25 19:18:12 2011 UTC
# Line 268  Line 268 
268          }          }
269      }      }
270    
271        if(extends(clDx, "dMatrix")) {
272            has.x <- TRUE
273            x <- .Call(Csparse_subassign,
274                       if(clx == "dgCMatrix")x else as(x, "dgCMatrix"),
275                       i1, i2,
276                       as(value, "dsparseVector"))
277        }
278        else {
279      xj <- .Call(Matrix_expand_pointers, x@p)      xj <- .Call(Matrix_expand_pointers, x@p)
280      sel <- (!is.na(match(x@i, i1)) &      sel <- (!is.na(match(x@i, i1)) &
281              !is.na(match( xj, i2)))              !is.na(match( xj, i2)))
# Line 309  Line 317 
317          x[i, ] <- value          x[i, ] <- value
318      else      else
319          x[i,j] <- value          x[i,j] <- value
   
320      if(extends(clDx, "compMatrix") && length(x@factors)) # drop cashed ones      if(extends(clDx, "compMatrix") && length(x@factors)) # drop cashed ones
321          x@factors <- list()          x@factors <- list()
322    }# else{ not using new memory-sparse  code
323      if(has.x && any(is0(x@x))) ## drop all values that "happen to be 0"      if(has.x && any(is0(x@x))) ## drop all values that "happen to be 0"
324          drop0(x)          as_CspClass(drop0(x), clx)
325      else as_CspClass(x, clx)      else as_CspClass(x, clx)
326  } ## replCmat  } ## replCmat
327    

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:
Vienna University of Economics and Business University of Wisconsin - Madison Powered By FusionForge