search for: llist

Displaying 20 results from an estimated 133 matches for "llist".

Did you mean: list
2006 Dec 28
2
Aggregation using list with Hmisc summarize function
Hi All, I'm using the Hmisc summarize function and used list instead of llist to provide the by variables. It generated an error message. Is this a bug, or do I misunderstand how Hmisc works with lists? The program below demonstrates the error message. Thanks, Bob x<-1:8 group <- c(1,1,1,1,2,2,2,2) gender<- c(1,2,1,2,1,2,1,2) mydata<-data.frame(x,g...
2005 Dec 21
2
Newbie - Summarize function
...> g<-function(y) { + top_no <-max(y$top) + weight <- with(y,as.numeric(x>=x[order(x,decreasing=TRUE)[top_no]])) + wtd.mean(y$x,weight) + } > g(test) [1] 172.6667 #call to summarize function - use function g and summarise by stratum plot > test.2 <- with(test,summarize(test$x,llist(test$Stratum,test$plot),g)) Error in eval(expr, envir, enclos) : numeric 'envir' arg not of length one In addition: Warning message: no finite arguments to max; returning -Inf >traceback() 9: eval(substitute(expr), data, enclos = parent.frame()) 8: with.default(y, as.numeric(x >= x...
2012 Apr 30
1
question on jitter in plot.Predict in rms
...continuous variable with an ordinal score, a two-level group, and a continuous covariate. Of primary interest is a plot of the group by score interaction, where the score is the ordinal variable, and the group Ns are quite disparate. When I produce the plot for the predicted values with the data=llist argument, as expected I get datadensity hatch marks. However, in the group with the smaller N, I get jittered datadensity points, while in the group with the larger N, the jitter apparently defaults to single vertical lines, which I assume is because the jitter would look like a black blob. Some...
2018 Feb 26
0
Parallel assignments and goto
...622 ? 100 The simple solution, of course, is to not do that, but then I can?t handle expressions inside calls to ?with?. And I would really like to, because then I can combine tail recursion with pattern matching. I can define linked lists and a length function on them like this: library(pmatch) llist := NIL | CONS(car, cdr : llist) llength <- function(llist, acc = 0) { ? ? cases(llist, ? ? ? ? ? NIL -> acc, ? ? ? ? ? CONS(car, cdr) -> llength(cdr, acc + 1)) } The tail-recursion I get out of transforming this function looks like this: llength_tr <- function (llist, acc = 0) { ? ?...
2018 Feb 27
2
Parallel assignments and goto
...olution, of course, is to not do that, but then I can?t handle expressions inside calls to ?with?. And I would really like to, because then I can combine tail recursion with pattern matching. > > I can define linked lists and a length function on them like this: > > library(pmatch) > llist := NIL | CONS(car, cdr : llist) > > llength <- function(llist, acc = 0) { > ? ? cases(llist, > ? ? ? ? ? NIL -> acc, > ? ? ? ? ? CONS(car, cdr) -> llength(cdr, acc + 1)) > } > > The tail-recursion I get out of transforming this function looks like this: > > ll...
2016 Apr 26
2
[PATCH 2/2] vhost: lockless enqueuing
Hi Jason, Overall patches look good. Just one doubt I have is below: > > We use spinlock to synchronize the work list now which may cause > unnecessary contentions. So this patch switch to use llist to remove > this contention. Pktgen tests shows about 5% improvement: > > Before: > ~1300000 pps > After: > ~1370000 pps > > Signed-off-by: Jason Wang <jasowang at redhat.com> > --- > drivers/vhost/vhost.c | 52 > +++++++++++++++++++++++++------------------...
2016 Apr 26
2
[PATCH 2/2] vhost: lockless enqueuing
Hi Jason, Overall patches look good. Just one doubt I have is below: > > We use spinlock to synchronize the work list now which may cause > unnecessary contentions. So this patch switch to use llist to remove > this contention. Pktgen tests shows about 5% improvement: > > Before: > ~1300000 pps > After: > ~1370000 pps > > Signed-off-by: Jason Wang <jasowang at redhat.com> > --- > drivers/vhost/vhost.c | 52 > +++++++++++++++++++++++++------------------...
2018 Feb 27
0
Parallel assignments and goto
...at, but then I can?t > handle expressions inside calls to ?with?. And I would really like to, > because then I can combine tail recursion with pattern matching. > > > > I can define linked lists and a length function on them like this: > > > > library(pmatch) > > llist := NIL | CONS(car, cdr : llist) > > > > llength <- function(llist, acc = 0) { > > cases(llist, > > NIL -> acc, > > CONS(car, cdr) -> llength(cdr, acc + 1)) > > } > > > > The tail-recursion I get out of transforming thi...
2018 Feb 11
4
Parallel assignments and goto
...much in running time? My other problem is the use of `next`. I would like to combine tail-recursion optimisation with pattern matching as in https://github.com/mailund/pmatch where I can, for example, define a linked list like this: devtools::install_github("mailund/pmatch?) library(pmatch) llist := NIL | CONS(car, cdr : llist) and define a function for computing the length of a list like this: list_length <- function(lst, acc = 0) { force(acc) cases(lst, NIL -> acc, CONS(car, cdr) -> list_length(cdr, acc + 1)) } The `cases` function creates an environment th...
2007 Oct 17
1
passing arguments to functions within functions
...resp1=rnorm(length(df$fac1)) df # define a funciton to compute mean, std error and n. meanstderr <- function(x) c(Mean=mean(x,na.rm=TRUE),se=sqrt(var (x,na.rm=TRUE)/length(na.omit(x))), n=length(na.omit(x))) # what I want to wrap into a single funtction: sumdf=with(df, summarize(X=resp1, by=llist(fac1, fac2, fac3), stat.name="resp1", FUN=meanstderr)) xYplot(Cbind(resp1, resp1-se, resp1+se) ~ as.numeric(fac1)|fac2, groups=fac3, data=sumdf, type='b', scales=list(x=list(labels=levels(df$fac1), at=1:length(levels(df $fac1)))), xlim=c(0,length(levels(df$fac1))+1)) # here...
2017 Nov 09
2
[PATCH] vhost/scsi: Use safe iteration in vhost_scsi_complete_cmd_work()
...21 +0900 Subject: [PATCH] vhost/scsi: Use safe iteration in vhost_scsi_complete_cmd_work() The following patch changed the behavior which originally did safe iteration. Make it safe as it was. 12bdcbd539c6327c09da0503c674733cb2d82cb5 vhost/scsi: Don't reinvent the wheel but use existing llist API Signed-off-by: Byungchul Park <byungchul.park at lge.com> --- drivers/vhost/scsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index 046f6d2..46539ca 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c @@ -...
2017 Nov 09
2
[PATCH] vhost/scsi: Use safe iteration in vhost_scsi_complete_cmd_work()
...21 +0900 Subject: [PATCH] vhost/scsi: Use safe iteration in vhost_scsi_complete_cmd_work() The following patch changed the behavior which originally did safe iteration. Make it safe as it was. 12bdcbd539c6327c09da0503c674733cb2d82cb5 vhost/scsi: Don't reinvent the wheel but use existing llist API Signed-off-by: Byungchul Park <byungchul.park at lge.com> --- drivers/vhost/scsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index 046f6d2..46539ca 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c @@ -...
2010 Jan 27
1
control of scat1d tick color in plot.Predict?
Hi All, I have a quick question about using plot.Predict now that the rms package uses lattice. I'd like to add tick marks along the regression line, which is given by data=llist(variablename) in the plot call. The ticks show up fine, but I'd like to alter the color. I know the ticks are produced by scat1d, but after spending a fair bit of time going through documentation, it still isn't clear to me how to do this in the context of lattice. Guidance would be great...
2013 Jan 06
3
[PATCH] tcm_vhost: Use llist for cmd completion list
...ost/tcm_vhost.c index b20df5c..3720604 100644 --- a/drivers/vhost/tcm_vhost.c +++ b/drivers/vhost/tcm_vhost.c @@ -47,6 +47,7 @@ #include <linux/vhost.h> #include <linux/virtio_net.h> /* TODO vhost.h currently depends on this */ #include <linux/virtio_scsi.h> +#include <linux/llist.h> #include "vhost.c" #include "vhost.h" @@ -64,8 +65,7 @@ struct vhost_scsi { struct vhost_virtqueue vqs[3]; struct vhost_work vs_completion_work; /* cmd completion work item */ - struct list_head vs_completion_list; /* cmd completion queue */ - spinlock_t vs_comp...
2013 Jan 06
3
[PATCH] tcm_vhost: Use llist for cmd completion list
...ost/tcm_vhost.c index b20df5c..3720604 100644 --- a/drivers/vhost/tcm_vhost.c +++ b/drivers/vhost/tcm_vhost.c @@ -47,6 +47,7 @@ #include <linux/vhost.h> #include <linux/virtio_net.h> /* TODO vhost.h currently depends on this */ #include <linux/virtio_scsi.h> +#include <linux/llist.h> #include "vhost.c" #include "vhost.h" @@ -64,8 +65,7 @@ struct vhost_scsi { struct vhost_virtqueue vqs[3]; struct vhost_work vs_completion_work; /* cmd completion work item */ - struct list_head vs_completion_list; /* cmd completion queue */ - spinlock_t vs_comp...
2008 Nov 19
2
[LLVMdev] poolallocation error
...it in PointerCompress::getAnalysisUsage tries to register the the BU pass as required. I.e. when AU.addRequired<CompleteBUDataStructures>(); is called. $ opt -f -load ~/Projects/llvmstuff/opt/poolalloc/lib/ libpoolalloc.dylib -raiseallocs -poolalloc-passing-all-pools - pointercompress llist-noopt.bc -o llist-dp.bc Assertion failed: ((P->getPotentialPassManagerType() < RequiredPass- >getPotentialPassManagerType()) && "Unable to handle Pass that requires lower level Analysis pass"), function addLowerLevelRequiredPass, file ~/Projects/llvmstuff/llvm/lib/...
2004 Dec 03
1
Difficulty implementing "scales" in a lattice plot
...is a factor with 20 levels and the mean values for these levels are being plotted with CIs. I am trying to reduce the text size for the labels for this variable. The first function below does not attempt to set the text size for the y axes, and all works well. xx2 <- with(xx,summarize(q27a, llist(Scanf,bumo), smean.cl.boot, conf.int=.90)) Dotplot(Scanf ~ Cbind(q27a,Lower, Upper)| bumo, xlim=c(5,10),cex=.6, par.strip.text=list(cex=.8), xlab="",main="", data=xx2) Now, when I add to the above function, scales=(cex=.5), as I show in the function below, the graph reduces...
2009 Jan 16
1
[LLVMdev] poolallocation error
...nalysisUsage tries to register > the the BU pass as required. I.e. when > AU.addRequired<CompleteBUDataStructures>(); is called. > > > $ opt -f -load ~/Projects/llvmstuff/opt/poolalloc/lib/ > libpoolalloc.dylib -raiseallocs -poolalloc-passing-all-pools - > pointercompress llist-noopt.bc -o llist-dp.bc > > Assertion failed: ((P->getPotentialPassManagerType() < RequiredPass- > >getPotentialPassManagerType()) && "Unable to handle Pass that > requires lower level Analysis pass"), function > addLowerLevelRequiredPass, file ~/Projects/...
2020 Sep 22
2
Creating a global variable for a struct array
Hello, I would like to create a global variable for the following struct array, h1 dhash* h1 = new dhash[10]; typedef struct dhash{ char* filenm; dlist* llist; }dhash; typedef struct dlist{ int soffst; int eoffst; uint8_t* dptr; }dlist; I also need to allocate space for: 1) the field llist in struct dhash which is a pointer to another struct dlist and 2) the field dptr in struct dlist Is there an example that I can refer to for doing this...
1999 Nov 04
2
New codes() methods
...codes) else codes(factor(x)) } "codes.data.frame" <- function(x) { row.names <- attr(x, "row.names") data.frame(codes(as.list(x)), row.names = row.names) } #### Hence: lvl <- ordered(c("L", "H"), c("L", "H")) llist <- rep(list(lvl), 4) codes(llist) # list of codes expand.grid(llist) # data frame of factors codes(expand.grid(llist)) # data frame of codes The non-list default behaviour is for data frames that mix factors with other stuff: the usual codes(factor(1:10)) caveat (from the help file) still a...