search for: idx

Displaying 20 results from an estimated 3782 matches for "idx".

Did you mean: id
2006 Sep 05
4
Ferret 0.10.2 - Index#search_each() and :num_docs
...rading to 0.10.2 (ie, this was working in 0.9.4). Maybe a bug, as the #search_each doesn''t seem to use the options parameter any more ? Thanks, Neville =========================================== require ''rubygems'' require ''ferret'' p Ferret::VERSION idx = Ferret::Index::Index.new idx << {:id => 1, :name => ''Fred'', :occupation => ''Toon''} idx << {:id => 2, :name => ''Barney'', :occupation => ''Toon''} idx << {:id => 3, :name => ''Wi...
2020 May 20
2
Precision of function mean,bug?
...e implementing a "mean" function you are testing against R's mean, you might want to consider that R uses a two-pass calculation[1] to reduce floating point precision error. Best, Brodie. [1] https://github.com/wch/r-source/blob/tags/R-4-0-0/src/main/summary.c#L482 > > a2=(z[idx]+x[idx]+y[idx])/3 > > a2==a > [1] FALSE > > a2==b > [1] TRUE > > -pd > > > On 20 May 2020, at 12:40 , Morgan Morgan <morgan.emailbox at gmail.com> wrote: > > > > Hello R-dev, > > > > Yesterday, while I was testing the newly implemented...
2013 Jun 04
3
[LLVMdev] Missing InstCombine optimization.
Hi Jakob, I've a problem related to the commit #155362. Consider the following snippet: void bar(float* f) { ... } void foo(float* f, int idx) { int hi = idx>>3; int lo = idx&7; bar(&f[hi*8+lo]); // hi*8 + lo == idx bar(&f[hi*10+lo]); } Before 155362 revision InstCombine was able to optimize hi*8+lo to idx by applying following patterns: 1. hi*8 -> hi << 3 2. ((idx >> 3) << 3) -> i...
2019 Oct 23
2
Unexpected behavior when using macro to loop over vector
...ned in "R_ext/Itermacros.h" to loop over an atomic vector. Here is a minimum example: C++ code ``` #include "R_ext/Itermacros.h" #define GET_REGION_BUFSIZE 2 //Redefine the macro since C++ is not happy with the implicit type conversion #define ITERATE_BY_REGION_PARTIAL(sx, px, idx, nb, etype, vtype, \ strt, nfull, expr) do { \ const etype *px = (etype*)DATAPTR_OR_NULL(sx); \ if (px != NULL) { \ R_xlen_t __ibr_n__ = strt + nfull; \ R_xlen_t nb = __ibr_n__; \ for (R_xlen_t idx = strt; idx < __ibr_n__; idx += nb) { \ expr \ } \ } \ else ITERATE_BY_REGION_PARTIA...
2019 Oct 25
2
Unexpected behavior when using macro to loop over vector
...minimum >> example: >> >> C++ code >> ``` >> #include "R_ext/Itermacros.h" >> #define GET_REGION_BUFSIZE 2 >> //Redefine the macro since C++ is not happy with the implicit type >> conversion >> #define ITERATE_BY_REGION_PARTIAL(sx, px, idx, nb, etype, vtype, \ >> ? strt, nfull, expr) do { \ >> const etype *px = (etype*)DATAPTR_OR_NULL(sx); \ >> if (px != NULL) { \ >> ??? R_xlen_t __ibr_n__ = strt + nfull; \ >> ??? R_xlen_t nb = __ibr_n__; \ >> ??? for (R_xlen_t idx = strt; idx < __ibr_n__; idx +...
2016 Feb 19
0
[PATCH v2 1/4] subdev/iccsense: add new subdev for power sensors
...te mode 100644 drm/nouveau/nvkm/subdev/iccsense/priv.h diff --git a/drm/nouveau/include/nvkm/core/device.h b/drm/nouveau/include/nvkm/core/device.h index 913192c..0940442 100644 --- a/drm/nouveau/include/nvkm/core/device.h +++ b/drm/nouveau/include/nvkm/core/device.h @@ -22,6 +22,7 @@ enum nvkm_devidx { NVKM_SUBDEV_BAR, NVKM_SUBDEV_PMU, NVKM_SUBDEV_VOLT, + NVKM_SUBDEV_ICCSENSE, NVKM_SUBDEV_THERM, NVKM_SUBDEV_CLK, @@ -109,6 +110,7 @@ struct nvkm_device { struct nvkm_gpio *gpio; struct nvkm_i2c *i2c; struct nvkm_subdev *ibus; + struct nvkm_iccsense *iccsense; struct nvkm_instme...
2016 Feb 20
0
[PATCH v4 1/6] subdev/iccsense: add new subdev for power sensors
...te mode 100644 drm/nouveau/nvkm/subdev/iccsense/priv.h diff --git a/drm/nouveau/include/nvkm/core/device.h b/drm/nouveau/include/nvkm/core/device.h index 913192c..0940442 100644 --- a/drm/nouveau/include/nvkm/core/device.h +++ b/drm/nouveau/include/nvkm/core/device.h @@ -22,6 +22,7 @@ enum nvkm_devidx { NVKM_SUBDEV_BAR, NVKM_SUBDEV_PMU, NVKM_SUBDEV_VOLT, + NVKM_SUBDEV_ICCSENSE, NVKM_SUBDEV_THERM, NVKM_SUBDEV_CLK, @@ -109,6 +110,7 @@ struct nvkm_device { struct nvkm_gpio *gpio; struct nvkm_i2c *i2c; struct nvkm_subdev *ibus; + struct nvkm_iccsense *iccsense; struct nvkm_instme...
2018 Jun 12
2
One more No-alias case on Alias analysis
...li via llvm-dev wrote: > On 6/11/2018 10:06 AM, jingu at codeplay.com via llvm-dev wrote: >> Hello All, >> >> I have met one may-alias case from llvm's alias analysis. The code >> snippet is as following: >> >> char buf[4]; >> >> void test (int idx) { >> char *a = &buf[3 - idx]; >> char *b = &buf[idx]; >> *a = 1; >> *b = 2; >> } >> >> I can see below output from alias set tracker for above code snippet. >> >> Alias sets for function 'test': >> Alias Set Tracker: 1 ali...
2020 May 20
2
Precision of function mean,bug?
Hello R-dev, Yesterday, while I was testing the newly implemented function pmean in package kit, I noticed a mismatch in the output of the below R expressions. set.seed(123) n=1e3L idx=5 x=rnorm(n) y=rnorm(n) z=rnorm(n) a=(x[idx]+y[idx]+z[idx])/3 b=mean(c(x[idx],y[idx],z[idx])) a==b # [1] FALSE For idx= 1, 2, 3, 4 the last line is equal to TRUE. For 5, 6 and many others the difference is small but still. Is that expected or is it a bug? Thank you Best Regards Morgan Jacob [[a...
2014 Dec 19
2
[PATCH RFC 2/5] s390: add pci_iomap_range
...uct pci_dev *pdev, > + int bar, > + unsigned long offset, > + unsigned long max) > { > struct zpci_dev *zdev = get_zdev(pdev); > u64 addr; > @@ -270,14 +273,27 @@ void __iomem *pci_iomap(struct pci_dev *pdev, int bar, unsigned long max) > > idx = zdev->bars[bar].map_idx; > spin_lock(&zpci_iomap_lock); > - zpci_iomap_start[idx].fh = zdev->fh; > - zpci_iomap_start[idx].bar = bar; > + if (zpci_iomap_start[idx].count++) { > + BUG_ON(zpci_iomap_start[idx].fh != zdev->fh || > + zpci_iomap_start[idx].bar...
2014 Dec 19
2
[PATCH RFC 2/5] s390: add pci_iomap_range
...uct pci_dev *pdev, > + int bar, > + unsigned long offset, > + unsigned long max) > { > struct zpci_dev *zdev = get_zdev(pdev); > u64 addr; > @@ -270,14 +273,27 @@ void __iomem *pci_iomap(struct pci_dev *pdev, int bar, unsigned long max) > > idx = zdev->bars[bar].map_idx; > spin_lock(&zpci_iomap_lock); > - zpci_iomap_start[idx].fh = zdev->fh; > - zpci_iomap_start[idx].bar = bar; > + if (zpci_iomap_start[idx].count++) { > + BUG_ON(zpci_iomap_start[idx].fh != zdev->fh || > + zpci_iomap_start[idx].bar...
2019 Mar 06
1
[RFC PATCH V2 2/5] vhost: fine grain userspace memory accessors
...+++ b/drivers/vhost/vhost.c > @@ -869,6 +869,34 @@ static inline void __user *__vhost_get_user(struct vhost_virtqueue *vq, > ret; \ > }) > > +static inline int vhost_put_avail_event(struct vhost_virtqueue *vq) > +{ > + return vhost_put_user(vq, cpu_to_vhost16(vq, vq->avail_idx), > + vhost_avail_event(vq)); > +} > + > +static inline int vhost_put_used(struct vhost_virtqueue *vq, > + struct vring_used_elem *head, int idx, > + int count) > +{ > + return vhost_copy_to_user(vq, vq->used->ring + idx, head, > + count * sizeo...
2019 Mar 06
1
[RFC PATCH V2 2/5] vhost: fine grain userspace memory accessors
...+++ b/drivers/vhost/vhost.c > @@ -869,6 +869,34 @@ static inline void __user *__vhost_get_user(struct vhost_virtqueue *vq, > ret; \ > }) > > +static inline int vhost_put_avail_event(struct vhost_virtqueue *vq) > +{ > + return vhost_put_user(vq, cpu_to_vhost16(vq, vq->avail_idx), > + vhost_avail_event(vq)); > +} > + > +static inline int vhost_put_used(struct vhost_virtqueue *vq, > + struct vring_used_elem *head, int idx, > + int count) > +{ > + return vhost_copy_to_user(vq, vq->used->ring + idx, head, > + count * sizeo...
2014 Aug 31
0
[PATCH envytools] nvamemtiming: Handle target < initial case when iterating values
...=> 0x6a73: 0d 06 0f 26 00 45 00 1b 00 0b 0d 08 04 0c 01 00 00 00 03 03 10 0a 09 00 03 Entry 5 => 0x6aa5: 05 04 08 05 00 09 00 03 00 02 02 02 02 0c 02 00 00 00 03 03 08 0a 0f 00 02 With the current code, I get these iterations: timing table at: 6a22 Deep mode: Will iterate between 5 and 24 idx 5, initial 45, target 9 idx 7, initial 1b, target 3 idx 9, initial b, target 2 idx 10, initial d, target 2 idx 11, initial 8, target 2 idx 12, initial 4, target 2 idx 13, initial c, target c idx 18, initial 3, target 3 idx 19, initial 3, target 3 idx 20, initial 10, target 8 idx 21, initial a, targ...
2013 Jun 04
0
[LLVMdev] Missing InstCombine optimization.
> 1. hi*8 -> hi << 3 > > 2. ((idx >> 3) << 3) -> idx & -8 > > 3. hi*8+lo -> hi*8 | lo > > 4. (idx & -8) | (idx & 7) -> idx & (-8 | 7) -> idx > > > > After 155362 pattern #2 is deferred to DAGCombine stage, so InstCombine is > unable to apply pattern #4:...
2008 May 17
1
Correlated Columns in data frame
...### r2test <- function(df, cutoff=0.8) { if (cutoff > 1 || cutoff <= 0) { stop(" 0 <= cutoff < 1") } if (!is.matrix(d) && !is.data.frame(d)) { stop("Must supply a data.frame or matrix") } r2cut = sqrt(cutoff); cormat <- cor(d); bad.idx <- which(abs(cormat)>r2cut,arr.ind=T); bad.idx <- matrix( bad.idx[bad.idx[,1] > bad.idx[,2]], ncol=2); drop.idx <- ifelse(runif(nrow(bad.idx)) > .5, bad.idx[,1], bad.idx [,2]); if (length(drop.idx) == 0) { 1:ncol(d) } else { (1:ncol(d))[-unique(drop.idx)] } }...
2013 Apr 03
3
arrayInd and which
..., 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 3, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 3, 6, 6, 6, 6, 6, 6, 6), .Dim = c(20L, 10L )) I want to find the cells which (hah!) are <= c(rep(5,5), rep(4,5)). That is my bounds are by column. Is there a better way to do this other than: bounds<-c(rep(5,5), rep(4,5)) idxs<-which(apply(td, 2, "<=", bounds), arr.ind = TRUE) > idxs row col [1,] 1 1 [2,] 13 1 [3,] 13 2 [4,] 1 3 [5,] 8 3 [6,] 13 3 [7,] 1 4 [8,] 13 4 [9,] 1 5 [10,] 13 5 [11,] 1 6 [12,] 4 6 [13,] 13 6 [14,] 4 7 [15,] 13...
2014 Aug 31
2
[PATCH envytools] nvamemtiming: Handle target < initial case when iterating values
On 31/08/2014 15:00, Christian Costa wrote: > Otherwise some values are not tested at all. I would rather have a warning than the program doing stuff behind my back. This is a dev tool, dumb == good ;)
2008 Jan 09
2
[PATCH 1/1] Clear joining_node no matter whether it is in the domain map or not.
...--- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c index 2fde7bf..3502bec 100644 --- a/fs/ocfs2/dlm/dlmrecovery.c +++ b/fs/ocfs2/dlm/dlmrecovery.c @@ -2270,6 +2270,12 @@ static void __dlm_hb_node_down(struct dlm_ctxt *dlm, int idx) } } + /* Clean up join state on node death. */ + if (dlm->joining_node == idx) { + mlog(0, "Clearing join state for node %u\n", idx); + __dlm_set_joining_node(dlm, DLM_LOCK_RES_OWNER_UNKNOWN); + } + /* check to see if the node is already considered dead */ if (!test_bit(i...
2008 Nov 11
0
read.table not clearing colClasses
..., skip=9, fill=TRUE, quote="") #initialize col.classes to NULL vector seq(1,length(cnames))->column.classes column.classes[1:length(cnames)]="NULL" #find where the desired columns are idx<-which(cnames=="Row") column.classes[idx]="integer" idx<-which(cnames=="Col") column.classes[idx]="integer" idx<-which(cnames=="ControlType")...