search for: nval

Displaying 20 results from an estimated 32 matches for "nval".

Did you mean: _val
2006 Dec 08
1
missing factor levels in a lattice barchart panel cause unexpected failure
...missing values, and came across the following: This does not run. I would expect it to: library(lattice) D = data.frame(X=1, Y=factor(letters[2], letters[1:2])) barchart(~ X, D, groups=Y) Error in grid.Call.graphics("L_rect", x$x, x$y, x$width, x$height, resolveHJust(x$just, : invalid line type which is simply solved by changing the factor levels: D$Y = factor(D$Y) barchart(~ X, D, groups=Y) or by filling factor levels from the bottom: D = data.frame(X=1, Y=factor(letters[1], letters[1:2])) barchart(~ X, D, groups=Y) However, the failure is important, because it causes th...
2004 Aug 02
3
Title with substitute and paste
Hello All, I am generating some plots where the title is generated with substitute and paste. An example: nval <- 20 plot(0,0) title(substitute(paste("n = ", n), list(n = nval))) But when compared to: plot(0,0) title("n = 20") the title in the first plot looks slightly different (it is not in bold). How can I get the two titles to look exactly the same? Also, how can I generate th...
2005 Jan 01
2
libFLAC bitbuffer optimizations
...<= 0xffff \ + ? byte_to_unary_table[(blurb) >> 8] + 16 \ + : ((blurb) <=0xffffff \ + ? byte_to_unary_table[(blurb) >> 16] + 8 \ + : byte_to_unary_table[(blurb) >> 24]))) #else /* ERROR, only sizes of 8 and 32 are supported */ #endif @@ -2109,114 +2135,18 @@ if(nvals == 0) return true; + cbits = bb->consumed_bits; i = bb->consumed_blurbs; - /* - * We unroll the main loop to take care of partially consumed blurbs here. - */ - if(bb->consumed_bits > 0) { - save_blurb = blurb = buffer[i]; - cbits = bb->consumed_bits; - blurb <<= c...
2004 Sep 10
4
bitbuffer optimizations
...e[blurb] + 24 : ((blurb) <= 0xffff ? byte_to_unary_table[(blurb) >> 8] + 16 : ((blurb) <= 0xffffff ? byte_to_unary_table[(blurb) >> 16] + 8 : byte_to_unary_table[(blurb) >> 24]))) #else /* ERROR, only sizes of 8 and 32 are supported */ #endif @@ -2090,114 +2111,16 @@ if(nvals == 0) return true; + cbits = bb->consumed_bits; i = bb->consumed_blurbs; - /* - * We unroll the main loop to take care of partially consumed blurbs here. - */ - if(bb->consumed_bits > 0) { - save_blurb = blurb = buffer[i]; - cbits = bb->consumed_bits; - blurb <<= c...
2004 Dec 28
2
libFLAC bitbuffer optimizations
Pulled from my Arch archive, this following patch seems to have made quite a difference in getting my ARM7TDMI chip to play FLAC (compression levels 0-2) on my ipod. I don't have benchmarks with hard numbers, but playing with skips vs playing without skips is a fairly noticeable difference. memcpy and memset on uClibc are optimized in asm for the ARM7TDMI in uClibc. Other hardware/libc
2002 Dec 16
1
Lattice: panel.superpose function does not pass subscripts and groups arguments (PR#2377)
...l <- col } superpose.symbol <- trellis.par.get("superpose.symbol") superpose.line <- trellis.par.get("superpose.line") x <- as.numeric(x) if (!is.null(y)) y <- as.numeric(y) vals <- sort(unique(groups)) nvals <- length(vals) col.line <- rep(col.line, length=nvals) col.symbol <- rep(col.symbol, length=nvals) pch <- rep(pch, length=nvals) lty <- rep(lty, length=nvals) lwd <- rep(lwd, length=nvals) cex <- rep(cex, length=nvals)...
2008 Mar 14
2
bitreader optimizations
...e most heavily used reader call. it ain't pretty but it's fast */ -/* a lot of the logic is copied, then adapted, from FLAC__bitreader_read_unary_unsigned() and FLAC__bitreader_read_raw_uint32() */ FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[], unsigned nvals, unsigned parameter) -/* OPT: possibly faster version for use with MSVC */ -#ifdef _MSC_VER { - unsigned i; - unsigned uval = 0; - unsigned bits; /* the # of binary LSBs left to read to finish a rice codeword */ - /* try and get br->consumed_words and br->consumed_bits into register; *...
2012 May 04
0
[PATCH] Optimize FLAC__bitreader_read_rice_signed
...e most heavily used reader call. it ain't pretty but it's fast */ -/* a lot of the logic is copied, then adapted, from FLAC__bitreader_read_unary_unsigned() and FLAC__bitreader_read_raw_uint32() */ FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[], unsigned nvals, unsigned parameter) -/* OPT: possibly faster version for use with MSVC */ -#ifdef _MSC_VER { - unsigned i; - unsigned uval = 0; - unsigned bits; /* the # of binary LSBs left to read to finish a rice codeword */ - /* try and get br->consumed_words and br->consumed_bits into register; *...
2006 May 24
0
the computation of exact p-value for the nonparametric cor-test with ties
...rg(method) DNAME <- paste(deparse(substitute(x)), "and", deparse(substitute(y))) if(length(x) != length(y)) stop("x and y must have the same length") OK <- complete.cases(x, y) x <- x[OK] y <- y[OK] n <- length(x) PVAL <- NULL NVAL <- 0 conf.int <- FALSE if(method == "pearson") { if(n < 3) stop("not enough finite observations") method <- "Pearson's product-moment correlation" names(NVAL) <- "correlation" r <- cor(x, y) df <- n - 2 ESTIMATE...
2008 Mar 17
0
bitreader optimizations
...e most heavily used reader call. it ain't pretty but it's fast */ -/* a lot of the logic is copied, then adapted, from FLAC__bitreader_read_unary_unsigned() and FLAC__bitreader_read_raw_uint32() */ FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[], unsigned nvals, unsigned parameter) -/* OPT: possibly faster version for use with MSVC */ -#ifdef _MSC_VER { - unsigned i; - unsigned uval = 0; - unsigned bits; /* the # of binary LSBs left to read to finish a rice codeword */ - /* try and get br->consumed_words and br->consumed_bits into register; *...
2012 Aug 28
3
[PATCH 1/3] Make FLAC__clz_soft_uint32 static.
--- src/libFLAC/include/private/bitmath.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/libFLAC/include/private/bitmath.h b/src/libFLAC/include/private/bitmath.h index 61b0e03..d32b1a7 100644 --- a/src/libFLAC/include/private/bitmath.h +++ b/src/libFLAC/include/private/bitmath.h @@ -42,7 +42,7 @@ #endif /* Will never be emitted for MSVC, GCC, Intel compilers */
2003 Jan 25
7
Plotting coloured histograms...
Hi, I am having some trouble trying to plot a histogram in more than one colour. What I want to do is, plot two vectors in the same histogram, but with different colours, for instance: > x <- rnorm(1000,20,4); > y <- rnorm(1000,10,2); Then I'd like to have x and y ploted on the same hist (I can do that already doing w <- c(x,y) then hist(w)) but the bars
2015 Oct 07
2
Are pointers to FLAC__int32 and int interchangeable?
...functions in bitreader.c: FLAC__bool FLAC__bitreader_read_unary_unsigned(FLAC__BitReader *br, unsigned *val); FLAC__bool FLAC__bitreader_read_rice_signed(FLAC__BitReader *br, int *val, unsigned parameter); FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[], unsigned nvals, unsigned parameter); * function FLAC__bitreader_read_rice_signed(): unused * function FLAC__bitreader_read_rice_signed_block(): called from read_residual_partitioned_rice_() with a pointer to FLAC__int32, not to int (as its 2nd parameter). * function FLAC__bitreader_read_unary_unsigned(): som...
2007 Feb 24
2
barchart (lattice) with text labels
I would like to place the value for each bar in barchart (lattice) at the top of each bar. Something like the following code produces. library(lattice) mypanelfunc <- function(x, y, ...) { panel.barchart(x, y, ...) panel.text(x, y, labels=as.character(round(x,2)), ...) } myprepanelfunc <- function(x, y, ...) list(xlim=c(0, max(x)+.1)) mydata <- expand.grid(a=factor(1:5),
2005 Aug 18
2
kendall tau correlation test for ties: Potential error (PR#8076)
...<- paste(deparse(substitute(x)), "and", deparse(substitute(y))) if(length(x) != length(y)) stop("'x' and 'y' must have the same length") OK <- complete.cases(x, y) x <- x[OK] y <- y[OK] n <- length(x) PVAL <- NULL NVAL <- 0 conf.int <- FALSE if(method == "pearson") { // Omitted } else { if(n < 2) stop("not enough finite observations") PARAMETER <- NULL TIES <- (min(length(unique(x)), length(unique(y))) < n) if(method == "kendall") { m...
2007 Apr 10
1
When to use quasipoisson instead of poisson family
It seems that MASS suggest to judge on the basis of sum(residuals(mode,type="pearson"))/df.residual(mode). My question: Is there any rule of thumb of the cutpoiont value? The paper "On the Use of Corrections for Overdispersion" suggests overdispersion exists if the deviance is at least twice the number of degrees of freedom. Are there any further hints? Thanks. -- Ronggui
2018 Mar 14
0
[PATCH v2 06/27] x86/entry/64: Adapt assembly for PIE support
...toph. > From linux/arch/x86/include/asm/percpu.h > /* > * xchg is implemented using cmpxchg without a lock prefix. xchg is > * expensive due to the implied lock prefix. The processor cannot prefetch > * cachelines if xchg is used. > */ > #define percpu_xchg_op(var, nval) \ > ({ \ > typeof(var) pxo_ret__; \ > typeof(var) pxo_new__ = (nval); \ > switc...
2015 Oct 08
1
Are pointers to FLAC__int32 and int interchangeable?
...LAC__bool FLAC__bitreader_read_unary_unsigned(FLAC__BitReader *br, FLAC__uint32 *val); FLAC__bool FLAC__bitreader_read_rice_signed(FLAC__BitReader *br, FLAC__int32 *val, unsigned parameter); FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, FLAC__int32* vals, unsigned nvals, unsigned parameter); And I hope that there's no need to bump API version because these functions are declared in src/libFLAC/include/private/bitreader.h After all the corresponding functions from bitwriter.h use FLAC__int32: FLAC__bool FLAC__bitwriter_write_rice_signed(FLAC__BitWriter...
2004 Sep 30
1
[don@donarmstrong.com: Bug#274301: libflac4 segfaults on corrupt flac files]
...: libflac4 segfaults on corrupt flac files Severity: normal Package: libflac4 Version: 1.1.0-11 Running ogg123 on http://rzlab.ucr.edu/debian/libflac/crash.flac results in a segfault in libFLAC: (gdb) bt full #0 0x40205422 in FLAC__bitbuffer_read_rice_signed_block (bb=0x80601b8, vals=0x807dd80, nvals=4294967293, parameter=9, read_callback=0x40220080 <read_callback_>, client_data=0x805ba58) at bitbuffer.c:2254 available_bits = 134733184 buffer = ( const FLAC__blurb *) 0x8060228 "o?z\023\017\a???\216???c??????vc?\201q\030NE+\030\213?5*?k??R2?\035?\207iP!?\237??oQ??\207?\202...
2009 Apr 08
1
Genstat into R - Randomisation test
...nd constitutive defence (CD). Since Induced and constitutive defence are not independant (so called spurious correlation) I should do a randomisation test. I have a syntax of my supervisor in Genstat, but I would really like to try this in R. "data from trade-off.IDCD" list variate [nval=1000] slope calc ID1=ID graph ID; CD calc b=corr(ID; CD) calc slope$[1]=b "slope$[1] is the correlation before permutating the data" for i=2...1000 randomize ID1 calc b=corr(CD1; ID1) calc slope$[i]=b endfor hist slope describe slope quantile [proportion=!(0.0005,0.005,...