similar to: another matrix problem

Displaying 20 results from an estimated 30000 matches similar to: "another matrix problem"

2016 Aug 05
3
enabling interleaved access loop vectorization
Hi Michael, Sometime back I did some experiments with interleave vectorizer and did not found any degrade, probably my tests/benchmarks are not extensive enough to cover much. Elina is the right person to comment on it as she already experienced cases where it hinders performance. For interleave vectorizer on X86 we do not have any specific costing, it goes to BasicTTI where the costing is not
2016 Aug 05
2
enabling interleaved access loop vectorization
Regarding InterleavedAccessPass - sure, but proper strided/interleaved access optimization ought to have a positive impact even without target support. Case in point - Hal enabled it on PPC last September. An important difference vs. x86 seems to be that arbitrary shuffles are cheap on PPC, but, as I said below, I hope we can enable it on x86 with a conservative cost function, and still get
2009 Jul 04
5
matrix problem
Can anybody please tell me a good way to do the following? Given a vector, number of rows and number of columns, return a matrix as follows. Easiest to give an example: x=c(1,2), nrow=5, ncol=4 return the matrix: 1 0 0 0 2 1 0 0 0 2 1 0 0 0 2 1 0 0 0 2 Thanks very much for any help! Bill
2008 Nov 30
6
Regex: workaround for variable length negative lookbehind
Hi all I have the following regular expression problem: I want to find complete elements of a vector that end in a repeated character but where the repetition doesn't make up the whole word. That is, for the vector vec: vec<-c("aaaa", "baaa", "bbaa", "bbba", "baamm", "aa") I would like to get "baaa" "bbaa"
2008 Apr 21
4
matrix problem
Hi Everyone, I am running into a problem with matrices. I use R version 2.4.1 and an older version. The problem is this: m<-matrix(ncol=3,nrow=4) m[,1:3]<-runif(n=4) That does what I expect; it fills up the rows of the matrix with the data vector > m [,1] [,2] [,3] [1,] 0.2083071 0.2083071 0.2083071 [2,] 0.5865763 0.5865763 0.5865763 [3,] 0.7901782 0.7901782
2010 Jul 12
3
How to mean, min lists and numbers
I would like to sum/mean/min a list of lists and numbers to return the related lists. -1+2*c(1,1,0)+2+c(-1,10,-1) returns c(2,13,0) but sum(1,2*c(1,1,0),2,c(-1,10,-1)) returns 15 not a list. Using the suggestions of Gabor Grothendieck, Reduce('+',list(-1,2*c(1,1,0),2,c(-1,10,-1))) returns what we want, c(2,13,0). However, it seems that this way does not work to mean/min. So, how to
2016 May 26
2
enabling interleaved access loop vectorization
Interleaved access is not enabled on X86 yet. We looked at this feature and got into conclusion that interleaving (as loads + shuffles) is not always profitable on X86. We should provide the right cost which depends on number of shuffles. Number of shuffles depends on permutations (shuffle mask). And even if we estimate the number of shuffles, the shuffles are not generated in-place. Vectorizer
2006 Apr 14
5
vector-factor operation
I found myself wanting to average a vector [vec] within each level of a factor [Fac], returning a vector of the same length as vec. After a while I realised that lm1 <- lm(vec ~ Fac) fitted(lm1) did what I want. But there must be another way to do this, and it would be good to be able to apply other functions than mean() in this way. Cheers, Murray -- Dr Murray Jorgensen
2004 Aug 18
5
labeled break statements in R?
Hi, Are there labeled break statements in R? i.e., something along the lines of TOPLOOP: for(i in 1:m) { for(j in 1:n) { ... if(condition) { break TOPLOOP } } } Thanks, Roger
2006 Mar 11
6
is there a formatted output in R?
something like "sprintf" in C? so I can do: print(sprintf("the correct result is %3.4f\n", myresult)); ------- Also, I am desperately looking for a "clear console screen" function in R... thanks a lot! [[alternative HTML version deleted]]
2013 Oct 11
3
matrix values linked to vector index
Hi, In the example you showed: m1<- matrix(0,length(vec),max(vec)) 1*!upper.tri(m1) #or ?m1[!upper.tri(m1)] <-? rep(rep(1,length(vec)),vec) #But, in a case like below, perhaps: vec1<- c(3,4,5) ?m2<- matrix(0,length(vec1),max(vec1)) ?indx <- cbind(rep(seq_along(vec1),vec1),unlist(tapply(vec1,list(vec1),FUN=seq),use.names=FALSE)) m2[indx]<- 1 ?m2 #???? [,1] [,2] [,3] [,4] [,5]
2016 Sep 01
2
enabling interleaved access loop vectorization
So turns out it is a full reproducer after all (choosing to vectorize on AVX), good. > The details are in PR29025. Interesting. (So we should carefully insert unconditional branches inside shuffle sequences, eh? ;-) > But if we modify the program by adding "*out++ = 0" right after "*out++ = q;" (thus eliminating the pesky <12 x i8>), we get: Indeed such
2016 Aug 16
2
enabling interleaved access loop vectorization
Hi Ayal, Elena, I'd really like to enable this by default. As I wrote above, I didn't see any regressions in internal benchmarks, and there doesn't seem to be anything in SPEC2006 either. I do see a performance improvement in an internal benchmark (that is, a real workload). Would you be able to provide an example that gets pessimized? I have no doubt you've seen regressions
2016 Aug 07
2
enabling interleaved access loop vectorization
We checked the gathered data again. All regressions that we see are in 32-bit mode. The 64-bit mode looks good overall. - Elena From: Michael Kuperstein [mailto:mkuper at google.com] Sent: Saturday, August 06, 2016 02:56 To: Renato Golin <renato.golin at linaro.org> Cc: Demikhovsky, Elena <elena.demikhovsky at intel.com>; Matthew Simpson <mssimpso at codeaurora.org>;
2016 Aug 17
2
enabling interleaved access loop vectorization
Thanks Ayal! On Wed, Aug 17, 2016 at 2:14 PM, Zaks, Ayal <ayal.zaks at intel.com> wrote: > Hi Michael, > > > > Don’t quite have a full reproducer for you yet. You’re welcome to try and > see what’s happening in 32 bit mode when enabling interleaving for the > following, based on “https://en.wikipedia.org/wiki/YIQ#From_RGB_to_YIQ”: > > > > void rgb2yik
2009 Jan 09
3
Programming Question (setting ylim generally)
library(StreamMetabolism) day <- (structure(c(10.08, 10.08, 10.05, 10.03, 10, 9.98, 9.96, 9.95, 9.95, 9.96, 9.96, 9.98, 10.01, 10.05, 10.06, 10.09, 10.11, 10.11, 10.13, 10.13, 10.15, 10.15, 10.13, 10.14, 10.11, 10.13, 10.14, 10.13, 10.12, 10.13, 10.14, 10.16, 10.18, 10.19, 10.23, 10.27, 10.33, 10.37, 10.45, 10.57, 10.6, 10.66, 10.73, 10.77, 10.84, 10.86, 10.87, 10.94, 10.98, 11.01, 11.05,
2005 Aug 16
2
problem using model.frame()
Hi I'm having a problem with model.frame, encapsulated in this example: y1 <- matrix(c(3,1,0,1,0,1,1,0,0,0,1,0,0,0,1,1,0,1,1,1), nrow = 5, byrow = TRUE) y1 <- as.data.frame(y1) rownames(y1) <- paste("site", 1:5, sep = "") colnames(y1) <- paste("spp", 1:4, sep = "") y1 model.frame(~ y1) Error in model.frame(formula, rownames,
2005 Mar 16
1
Code to replace nested for loops
Dear list members, How can I replace the nested for loops at then end of the script below with more efficient code? # Begin script__________________________________________________ # Dichotomous scores for 100 respondents on 3 items with # probabilities of a correct response = .6, .4, and .7, # respectively x1 <- rbinom(100,1,.6) x2 <- rbinom(100,1,.4) x3 <- rbinom(100,1,.7) #
2012 Mar 07
3
GPS handling libraries or (String manipulation)
Dear all, I would like to ask you if R has a library that can work with different GPS formats For example  I have a string of this format N50° 47.513 E006° 03.985 and I would like to convert to GPS decimal format. that means for example converting the part N50° 47.513 to 50 + 47/60 + 513/3600. Is it possible to do that with R? What is the name of such a library? I would like to thank you in
2008 Jul 18
3
Change font-face in title
Dear List, Is there a possibility to change the font-face for a part of the title of a plot? For example I have the following... plot(nirs, type="l", xlab="Wellenl?nge [nm]", col="darkslategray", main = "Spektrum Deschampsia caespitosa") ...and I would like to change the part of the title-string "Deschampsia caespitosa" to italics? Is