Displaying 20 results from an estimated 51 matches for "1e8".
Did you mean:
18
2019 Jan 31
2
Object.size() should not visit every element for alt-rep strings, or there should be an altstring_objectsize_method
Below is a toy alt-rep string example, that generates N random strings:
https://gist.github.com/traversc/a48a504eb062554f2d6ff8043ca16f9c
example:
`x <- altrandomStrings(1e8)`
`head(x)`
[1] "2PN0bdwPY7CA8M06zVKEkhHgZVgtV1" "5PN2qmWqBlQ9wQj99nsQzldVI5ZuGX" ...
`object.size(1e8)`
Object.size will call the `set_altstring_Elt_method` for every single
element, materializing (slowly) every element of the vector. This is
a problem mostly in R-studio sinc...
2015 Jun 01
2
sum(..., na.rm=FALSE): Summing over NA_real_ values much more expensive than non-NAs for na.rm=FALSE? Hmm...
...he
same. Note, this is for "doubles", so I'm not expecting
early-stopping as for "integers" (where testing for NA is cheap).
On R 3.2.0, on Windows (using the official CRAN builds), on Linux
(local built), and on OS X (official AT&T builds), I get:
> x <- rep(0, 1e8)
> stopifnot(typeof(x) == "double")
> system.time(sum(x, na.rm=FALSE))
user system elapsed
0.19 0.01 0.20
> y <- rep(NA_real_, 1e8)
> stopifnot(typeof(y) == "double")
> system.time(sum(y, na.rm=FALSE))
user system elapsed
9.54 0.00 9....
2020 Mar 27
4
object.size vs lobstr::obj_size
...objects where the entire substance of the object is ignored
which makes object.size() completely meaningless in that case:
setRefClass("A", fields=c(stuff="ANY"))
object.size(new("A", stuff=raw(0))) # 680 bytes
object.size(new("A", stuff=runif(1e8))) # 680 bytes
Why wouldn't object.size() look at the content of environments?
Thanks,
H.
--
Herv? Pag?s
Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024
E-mail:...
2015 Jun 01
0
sum(..., na.rm=FALSE): Summing over NA_real_ values much more expensive than non-NAs for na.rm=FALSE? Hmm...
...ot;logical"), body='
#define LDOUBLE long double
double *x_ = REAL(x);
int narm_ = asLogical(narm);
int n = length(x);
LDOUBLE sum = 0.0;
for (R_xlen_t i = 0; i < n; i++) {
if (!narm_ || !ISNAN(x_[i])) sum += x_[i];
}
return ScalarReal((double)sum);
')
> x <- rep(0, 1e8)
> stopifnot(typeof(x) == "double")
> system.time(sum3(x, narm=FALSE))
user system elapsed
0.40 0.00 0.44
> y <- rep(NA_real_, 1e8)
> stopifnot(typeof(y) == "double")
> system.time(sum3(y, narm=FALSE))
user system elapsed
9.80 0.00 9.8...
2020 Mar 27
2
object.size vs lobstr::obj_size
...> ignored
> which makes object.size() completely meaningless in that case:
>
> ? ?setRefClass("A", fields=c(stuff="ANY"))
> ? ?object.size(new("A", stuff=raw(0)))? ? ? # 680 bytes
> ? ?object.size(new("A", stuff=runif(1e8)))? # 680 bytes
>
> Why wouldn't object.size() look at the content of environments?
>
>
> As the author, I'm obviously biased, but I do like lobstr::obj_sizes()
> which allows you to see the additional size occupied by one object given
> any number of other obj...
2019 Jan 31
0
Object.size() should not visit every element for alt-rep strings, or there should be an altstring_objectsize_method
...ze on
every top level assignment as they appear to do is a bad idea, even
without ALTREP. object.size is only a cheap operation for simple
atomic vectors. For anything with recursive sturcture it needs to walk
the object, so the effort is proprtional to object size:
> x <- rep("A", 1e8)
> system.time(object.size(x))
user system elapsed
1.222 0.624 1.850
> x <- rep(list(1), 1e8)
> system.time(object.size(x))
user system elapsed
1.247 0.022 1.273
The current help for object.size says
Provides an estimate of the memory that is being used...
2010 Mar 04
2
Hi
How Can I write this this matlab code in R:
options=optimset('TolFun',1e-9,'TolX',1e-9,'MaxIter',1e8,'MaxFunEvals',1e8);
c=c/2;
[alpha, delta, epsilon, nofcup] = ustrs(set_date,mat_date);
y = fminsearch('pbond',.15,options,p,c,nofcup,delta/epsilon);
y = 200*y;
Note
pbond is a function in Matlab I already wrote in R
ustrs is a function in Matlab I already convert into r
Tha...
2019 Jan 15
4
Objectsize function visiting every element for alt-rep strings
I have a toy alt-rep string package that generates randomly seeded strings.
example:
library(altstringisode)
x <- altrandomStrings(1e8)
head(x)
[1] "2PN0bdwPY7CA8M06zVKEkhHgZVgtV1" "5PN2qmWqBlQ9wQj99nsQzldVI5ZuGX" ... etc
object.size(1e8)
Object.size will call the set_altstring_Elt_method for every single
element, materializing (slowly) every element of the vector. This is
a problem mostly in R-studio since o...
2017 Oct 03
0
Revert to R 3.2.x code of logicalSubscript in subscript.c?
...ular, src/main/subscript.c might be of interest.
Note that you should read mods-dir/README if you want to build this,
and in particular, you need to run create-configure in the top-level
source directory first.
I modified your tests a bit, including producing versions using both
vectors of length 1e8 like you did (which will not fit in cache) and
vectors of length 1e5 (which will fit in at least the L3 cache). I
ran tests on an Intel Skylake processor (E3-1270v5 @ 3.6GHz), using
gcc 7.2 with -O3 -march=native -mtune=native.
I got the following results with R-3.4.2 (with R_ENABLE_JIT=0, which...
2012 Jan 06
0
interesting connection / finalizer bug?
...methods=list(
finalize = function() {
if (isOpen(con)) close(con)
}))
f <- tempdir()
a <- .A$new(con=file(f, "rb"))
close(a$con)
a <- .A$new(con=file(f, "rb"))
bin <- readBin(a$con, raw(), as.integer(1e8))
crashes (hangs, usually) at the last line, with valgrind saying
==14875== Invalid read of size 8
==14875== at 0x4EB23DA: do_readbin (connections.c:3678)
==14875== by 0x4F795E4: do_internal (names.c:1236)
==14875== by 0x4F15F63: Rf_eval (eval.c:471)
==14875== by 0x4F18BA7: do_begin (...
2009 Oct 19
2
Possible bug in plot.POSIXct regarding x axis
I believe I have found a bug (or at least a misfeature) in plot.POSIXct.
See the following example code.
set.seed(1)
x=seq(1,1e8,length=100)+round(runif(100)*1e8)
y=as.POSIXct(x,origin="2001-01-01")
plot(y)
This plots some random (date)times against their indices. The y axis
correctly shows appropriate values (years), but the x axis contains the
single number '59:58' in the lower left corner, which makes...
2020 Mar 27
1
object.size vs lobstr::obj_size
...bject.size() completely meaningless in that case:
> >
> >? ? ? ? ?setRefClass("A", fields=c(stuff="ANY"))
> >? ? ? ? ?object.size(new("A", stuff=raw(0)))? ? ? # 680 bytes
> >? ? ? ? ?object.size(new("A", stuff=runif(1e8)))? # 680 bytes
> >
> >? ? ?Why wouldn't object.size() look at the content of environments?
> >
> >
> > As the author, I'm obviously biased, but I do like
> lobstr::obj_sizes()
> > which allows you to see the additiona...
2017 Oct 01
0
Revert to R 3.2.x code of logicalSubscript in subscript.c?
...-type-slower-than-subsetting-on-numeric-type . I presents two extreme cases, each with no-recycling and recycling versions that convert to the same positive indices. Difference between the two versions can be attributed to function 'logicalSubscript'.
Example 1: select none
x <- numeric(1e8)
i <- rep(FALSE, length(x))# no reycling
system.time(x[i])
system.time(x[i])
i <- FALSE# recycling
system.time(x[i])
system.time(x[i])
Output:
?? user? system elapsed
? 0.083?? 0.000?? 0.083
?? user? system elapsed
? 0.085?? 0.000?? 0.085
?? user? system elapsed
? 0.144?? 0.000?? 0.144...
2019 Jan 22
2
Objectsize function visiting every element for alt-rep strings
...r wrote:
>>>>>> Travers Ching
>>>>>> on Tue, 15 Jan 2019 12:50:45 -0800 writes:
>
> > I have a toy alt-rep string package that generates
> > randomly seeded strings. example: library(altstringisode)
> > x <- altrandomStrings(1e8) head(x) [1]
> > "2PN0bdwPY7CA8M06zVKEkhHgZVgtV1"
> > "5PN2qmWqBlQ9wQj99nsQzldVI5ZuGX" ... etc object.size(1e8)
>
> > Object.size will call the set_altstring_Elt_method for
> > every single element, materializing (slowly) every element
>...
2020 Mar 27
0
object.size vs lobstr::obj_size
...e substance of the object is ignored
> which makes object.size() completely meaningless in that case:
>
> setRefClass("A", fields=c(stuff="ANY"))
> object.size(new("A", stuff=raw(0))) # 680 bytes
> object.size(new("A", stuff=runif(1e8))) # 680 bytes
>
> Why wouldn't object.size() look at the content of environments?
>
As the author, I'm obviously biased, but I do like lobstr::obj_sizes()
which allows you to see the additional size occupied by one object given
any number of other objects. This is particularly i...
2020 Mar 27
0
object.size vs lobstr::obj_size
...t; which makes object.size() completely meaningless in that case:
> >
> > setRefClass("A", fields=c(stuff="ANY"))
> > object.size(new("A", stuff=raw(0))) # 680 bytes
> > object.size(new("A", stuff=runif(1e8))) # 680 bytes
> >
> > Why wouldn't object.size() look at the content of environments?
> >
> >
> > As the author, I'm obviously biased, but I do like lobstr::obj_sizes()
> > which allows you to see the additional size occupied by one object given
>...
2004 Jan 04
1
Density Plots
...erating 10,000 samples per 'run'. When I plot histograms I get the expected 'bins' on the x-axis and the frequency distribution on the y-axis. However when I ask R to plot the SAME data set with a density curve the x-axis remains the same but the y-axis can generate values of up to 1e8 etc. Can anyone (a) explain why this might be so and/or (b) suggest a fix?
Many thanks
David Tyler
[[alternative HTML version deleted]]
2007 Nov 09
1
fisher.test, chisq.test
...So in made a matrix and used
>fisher.test(classtable4).
But then this error occurs:
Fehler in fisher.test(classtable4) : FEXACT error 7.
LDSTP is too small for this problem.
Try increasing the size of the workspace.
Well I then increased the workspace:
>fisher.test(classtable4, workspace=1e8)
But then the same error occurs.
Do someone knows an alternative to the fisher.test or the chisq.test?
Thank you very much!
All the best,
Denis
PS: I use R 2.6.0-patched on a PC with Windows XP.
2019 Jan 21
0
Objectsize function visiting every element for alt-rep strings
>>>>> Travers Ching
>>>>> on Tue, 15 Jan 2019 12:50:45 -0800 writes:
> I have a toy alt-rep string package that generates
> randomly seeded strings. example: library(altstringisode)
> x <- altrandomStrings(1e8) head(x) [1]
> "2PN0bdwPY7CA8M06zVKEkhHgZVgtV1"
> "5PN2qmWqBlQ9wQj99nsQzldVI5ZuGX" ... etc object.size(1e8)
> Object.size will call the set_altstring_Elt_method for
> every single element, materializing (slowly) every element
> of the vector....
2007 Apr 10
1
Memory management
...arameters... so then I start to wonder if it's better if I attach the
variables first vs passing them in (coz that involves a lot of copying.. )
Thus, I do this
fn3 <- function(x, y, z, a, b, c){ sum(x, y, z, a, b, c) }
fn4 <- function(){ sum(x, y, z, a, b, c) }
rdn <- rep(1.1, times=1e8)
r <- proc.time()
for (i in 1:5)
fn3(rdn, rdn, rdn, rdn, rdn, rdn)
time1 <- proc.time() - r
print(time1)
lt <- list(x = rdn, y = rdn, z = rdn, a = rdn, b = rdn, c = rdn)
attach(lt)
r <- proc.time()
for (i in 1:5)
fn4()
time2 <- proc.time() - r
print(time2)
detach("lt")...