Skip to content

minor changes to base R script#32

Open
MichaelChirico wants to merge 1 commit into
jesusfv:masterfrom
MichaelChirico:patch-1
Open

minor changes to base R script#32
MichaelChirico wants to merge 1 commit into
jesusfv:masterfrom
MichaelChirico:patch-1

Conversation

@MichaelChirico
Copy link
Copy Markdown

  • Hard-encode integers where appropriate (1 -> 1L)
  • Pre-declare & store inner nested loop indices (rather than declare 1:n each pass)
  • as.matrix extraneous -- see e.g. print(outer) which uses as.vector (and LHS and RHS are already vectors)
  • Repeated assignment in R (x <- y <- z <- w <- v <- u <- t <- 2) creates copies; no worry about pointers/referenced overwrites
  • Pre-transpose mTransition

 - Hard-encode integers where appropriate (`1` -> `1L`)
 - Pre-declare & store inner nested loop indices (rather than declare `1:n` each pass)
 - `as.matrix` extraneous -- see e.g. `print(outer)` which uses `as.vector` (and LHS and RHS are already vectors)
 - Repeated assignment in R (`x <- y <- z <- w <- v <- u <- t <- 2`) creates copies; no worry about pointers/referenced overwrites
 - Pre-transpose `mTransition`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant