[Rcpp-commits] r3539 - pkg/RcppSMC/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Mar 21 14:46:55 CET 2012
Author: adamj
Date: 2012-03-21 14:46:55 +0100 (Wed, 21 Mar 2012)
New Revision: 3539
Modified:
pkg/RcppSMC/R/pfLineartBS.R
Log:
Code indentation standardisation.
Modified: pkg/RcppSMC/R/pfLineartBS.R
===================================================================
--- pkg/RcppSMC/R/pfLineartBS.R 2012-03-21 12:13:19 UTC (rev 3538)
+++ pkg/RcppSMC/R/pfLineartBS.R 2012-03-21 13:46:55 UTC (rev 3539)
@@ -45,27 +45,21 @@
pfLineartRange <- function(min,max)
{
- if(min > 0)
- {
- rmin = exp(floor(log(min)))
+ if(min > 0) {
+ rmin = exp(floor(log(min)))
+ } else if (min < 0) {
+ rmin = -exp(ceiling(log(-min)))
+ } else {
+ rmin = 0
}
- else if (min < 0) {
- rmin = -exp(ceiling(log(-min)))
- }
- else {
- rmin = 0
- }
- if(max > 0)
- {
- rmax = exp(ceiling(log(max)))
+ if(max > 0) {
+ rmax = exp(ceiling(log(max)))
+ } else if (max < 0){
+ rmax = exp(floor(log(-max)))
+ } else {
+ rmax = 0;
}
- else if (max < 0){
- rmax = exp(floor(log(-max)))
- }
- else {
- rmax = 0;
- }
invisible(c(rmin,rmax))
}
More information about the Rcpp-commits
mailing list