Hi Ben,

  A couple of quick comments:

 the semicolons at the end of each line are unnecessary (they're
harmless, but considered bad style -- most common in code of C and
MATLAB coders

yes, I know, just forgot to clean it up after translating :)

  You don't need to source("getband.R") inside the body of spdiags,
probably better to do it outside (so it doesn't get run every time the
function is called)

if (length(which(bd) == T) != 0)

  can be shortened to

  if (any(bd!=0))

  I haven't looked too carefully but can't all the i/j/d/p stuff be
replaced by

  n <- nrow(A)
  p <- 2*n-1
  d <- seq(-(n-1),(n-1))

yes, all good points, I have acted the changes you suggested,
and it works smooth.

thanks,

Moreno


--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to