search for: sum1

Displaying 20 results from an estimated 78 matches for "sum1".

Did you mean: sum
2007 Sep 01
2
Comparing "transform" to "with"
...them out from help files or books. So I created a simplified version of what I'm doing: rm( list=ls() ) x1<-c(1,3,3) x2<-c(3,2,1) x3<-c(2,5,2) x4<-c(5,6,9) myDF<-data.frame(x1,x2,x3,x4) rm(x1,x2,x3,x4) ls() myDF This creates two new variables just fine" transform(myDF, sum1=x1+x2, sum2=x3+x4 ) This next code does not see sum1, so it appears that "transform" cannot see the variables that it creates. Would I need to transform new variables in a second pass? transform(myDF, sum1=x1+x2, sum2=x3+x4, total=sum1+sum2 ) Next I'm trying the same thing...
2004 Jun 29
2
Calculate correctly, but gives an error message
Hi! I will calculate sum??s in the following way: E.g.: a <- rpois(100,20) b <- rpois(100,5) x <- data.frame(cbind(a,b)) # the sum??s should be calculated based on a. attach(x) sort.nace <- unique(sort(x[,1])) sum1 <- matrix(ncol=1, nrow=length(sort.nace)) # I calculate the sum of all values of b, which have the same category in a. Eg.: sum1[1,] <- sum(subset(x, a==sort.nace[1], select=b), na.rm=TRUE) # or: sum1[5,] <- sum(subset(x, a==sort.nace[5], select=b), na.rm=TRUE) # all is ok. # but when...
2008 Apr 22
4
how to convert non numeric data into numeric?
I am having the following error in my function function(theta,reqdIRR) { theta1<-theta[1] theta2<-theta[2] n<-length(reqdIRR) constant<- n*(theta1+theta2) sum1<-lapply(reqdIRR*exp(theta1),FUN = sum) sum2<-lapply(exp(theta2 - reqdIRR*exp(theta1)),FUN = sum) sum = sum1 + sum2 log.fcn = constant - as.numeric(sum) result = - log.fcn return(result) } *error : neg.log.gumbel(1,reqdIRR) Error in sum1 + sum2 : non-numeric argument to binary operator >...
2016 May 04
2
GVN pass: does global value numbering remove duplicate computations in loops?
...GVN pass. I have been reading a bit about global value numbering, and from what I understand, there are polynomial time algorithms for removing duplicate computations from loops[1]. I have an example program[2] which computes the sum of an array twice, in two separate accumulators. Here, sum0 and sum1 are both sums of the array A. void b01_sums(int size, int* A) { int sum0 = 0; int sum1 = 0; for (int i = 0; i != size; ++i) { sum0 = sum0 + A[i]; sum1 = sum1 + A[i]; printf("sum0: %d\nsum1: %d\n", sum0, sum1); } } I would have expected global value numbering to see...
2008 Oct 17
2
Text (eg. summary) to text file, Howto?
Simple question... I would like to dump some summries of lm()'s to small seperate text files. I have looked at: print(), but it don't support output to file cat(), but it claims that 'sum1' is a list write, but that just uses cat()... The script goes something like this: ... lmMax <- lm(NUMAMMON ~ YYYY*MM*DD) sum1 <- summary(lmMax) # help needed here... how to dump sum1 to a small text file??? ... :-? Martin at Hvidberg.net
2007 Feb 01
3
Help with efficient double sum of max (X_i, Y_i) (X & Y vectors)
...mplement a Cramer-von Mises type test statistic which involves double sums of max(X_i,Y_j) where X and Y are vectors of differing length. I am currently using ifelse pointwise in a vector, but have a nagging suspicion that there is a more efficient way to do this. Basically, I require three sums: sum1: \sum_i\sum_j max(X_i,X_j) sum2: \sum_i\sum_j max(Y_i,Y_j) sum3: \sum_i\sum_j max(X_i,Y_j) Here is my current implementation - any pointers to more efficient computation greatly appreciated. nx <- length(x) ny <- length(y) sum1 <- 0 sum3 <- 0 for(i in 1:nx) { sum1...
2018 Jul 10
9
[PATCH 0/7] PowerPC64 performance improvements
The following series adds initial vector support for PowerPC64. On POWER9, flac --best is about 3.3x faster. Amitay Isaacs (2): Add m4 macro to check for C __attribute__ features Check if compiler supports target attribute on ppc64 Anton Blanchard (5): configure.ac: Remove SPE detection code configure.ac: Add VSX enable/disable configure.ac: Fix FLAC__CPU_PPC on little endian, and add
2014 Sep 29
2
[LLVMdev] Alias Analysis across functions
...Alias" for arrays "A" and "B" in both the functions instead of "NoAlias". What passes should I run in opt before the alias analysis pass to get the accurate result? Example: //Note: static and called by func() only. static int sum(int *A, int *B) { int i = 0, sum1 = 0; for (i = 0; i < 100; ++i) { sum1 += A[i] + B[i]; } return sum1; } int func () { int A[100], B[100]; int i = 0; for (; i < 100; ++i) { A[i] = B[i] = i; } return sum(A,B); } Arguments to opt: "-mem2reg -basicaa -scev-aa -print-alias-sets" Output: Fun...
2010 Sep 24
2
grep contents of file on remote server
Hello, I am attempting to grep the contents of a key file I have SCP'd to a remote server. I am able to cat it: [code] [bluethundr at LBSD2:~]$:ssh root at sum1 cat /root/id_rsa.pub root at lcent01.summitnjhome.com's password: ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEApnUSYyrM96qIBZKjwSNYycgeSv/FAKE-KEY-DATA--KEY-DATA-PWReyVuOn9Fb/uH/FAKE-KEY-DATA-+ttLzUELGrfn/n+FAKE-KEY-DATA-/FAKE-KEY-DATA-/FAKE-KEY-DATA-/FAKE-KEY-DATA-== bluethundr at lbsd8-2.summitnjhome....
2007 Apr 03
1
Speex ARM4 patch
The attached patch eliminates some warnings while compiling for ARM4 targets. It also simplifies the asm constraints a bit. Now we can use the ARM4 optimisations when compiling for PortalPlayer targets in Rockbox. Cheers, Dan -------------- next part -------------- A non-text attachment was scrubbed... Name: speex_arm4.patch Type: text/x-diff Size: 1550 bytes Desc: not available Url :
2013 Mar 25
2
Faster way of summing values up based on expand.grid
...mycombos[!(mycombos$Var2 == mycombos$Var4),] mycombos<-mycombos[!(mycombos$Var3 == mycombos$Var4),] dim(mycombos) # I want to write sums of elements from values1, values2, and values 3 whose numbers are contained in each column of mycombos. Here is how I am going it now - using a loop: mycombos$sum1<-NA mycombos$sum2<-NA mycombos$sum3<-NA for(i in 1:nrow(mycombos)){ mycombos$sum1[i]<-values1[[mycombos[i,"Var1"]]] + values1[[mycombos[i,"Var2"]]] + values1[[mycombos[i,"Var3"]]] + values1[[mycombos[i,"Var4"]]] mycombos$sum2[i]<-values2[[m...
2008 Nov 26
1
SSE2 code won't compile in VC
...); } - sum = _mm_add_sd(sum, (__m128d) _mm_movehl_ps((__m128) sum, (__m128) sum)); + sum = _mm_add_sd(sum, _mm_unpackhi_pd(sum, sum)); _mm_store_sd(&ret, sum); return ret; } @@ -120,7 +120,7 @@ static inline double interpolate_product_double(const float *a, const float *b, sum1 = _mm_mul_pd(f1, sum1); sum2 = _mm_mul_pd(f2, sum2); sum = _mm_add_pd(sum1, sum2); - sum = _mm_add_sd(sum, (__m128d) _mm_movehl_ps((__m128) sum, (__m128) sum)); + sum = _mm_add_sd(sum, _mm_unpackhi_pd(sum, sum)); _mm_store_sd(&ret, sum); return ret; }
2003 Mar 20
1
rsync 2.5.6 still hangs
...20M (but only about 200K difference). I tried doing the same with -vvvv (which shows the individual checksums), and it had this: recv_generator(file_33,32) gen mapped file_33 of size 21308244 generating and sending sums for 32 count=10014 rem=580 n=2128 flength=21308244 chunk[0] offset=0 len=2128 sum1=77f93b94 chunk[1] offset=2128 len=2128 sum1=3ec13ce7 chunk[2] offset=4256 len=2128 sum1=99573c59 chunk[3] offset=6384 len=2128 sum1=6a7735a9 <snip> chunk[7800] offset=16598400 len=2128 sum1=cc0995f1 chunk[7801] offset=16600528 len=2128 sum1=6c2a8f1b chunk[7802] offset=16602656 len=2128 sum1=5...
2003 Oct 05
2
Possible security hole
...where? I didn't notice any so here it goes: sender.c:receive_sums() s->count = read_int(f); .. s->sums = (struct sum_buf *)malloc(sizeof(s->sums[0])*s->count); if (!s->sums) out_of_memory("receive_sums"); for (i=0; i < (int) s->count;i++) { s->sums[i].sum1 = read_int(f); read_buf(f,s->sums[i].sum2,csum_length); .. If I read this right, given high enough s->count makes the malloc() parameter wraps around to a few bytes while still reading data past it. Exploiting is probably pretty difficult if at all possible. There would have to be some...
2002 Apr 23
1
patch: timeout problem solved
.../* tell the other guy how many we are going to be - doing and how many bytes there are in the last - chunk */ - write_int(f_out, s->count); - write_int(f_out, s->n); - write_int(f_out, s->remainder); - - for (i = 0; i < s->count; i++) { - write_int(f_out, s->sums[i].sum1); - write_buf(f_out, s->sums[i].sum2, csum_length); - } - } else { - /* we don't have checksums */ - write_int(f_out, 0); - write_int(f_out, block_size); - write_int(f_out, 0); - } + /* we don't have checksums */ + write_int(f_out, 0); + write_int(f_out, block_size); + write_int(f...
2018 Mar 16
3
Discrepancy: R sum() VS C or Fortran sum
...C [1] 0 My sumf and sumc are subroutine sumf(x, n, sx1, sx2) integer i, n double precision x(n), sx1, sx2 sx1 = sum(x) sx2 = 0.0d0 do i=1,n sx2 = sx2+x(i) end do end void sumc(double *x, int *n, double *sum) { int i; double sum1 = 0.0; for (i=0; i< *n; i++) { sum1 += x[i]; } *sum = sum1; } Can that be a bug? Thanks. -- Pierre Chauss? Assistant Professor Department of Economics University of Waterloo
2016 May 04
2
GVN pass: does global value numbering remove duplicate computations in loops?
...e are polynomial time algorithms for removing > > duplicate computations from loops[1]. > > Yes > The current GVN will not do it. > > I have an example program[2] which computes the sum of an array > > twice, in two separate accumulators. > > > Here, sum0 and sum1 are both sums of the array A. > > > void b01_sums(int size, int* A) > > > { > > > int sum0 = 0; > > > int sum1 = 0; > > > for (int i = 0; i != size; ++i) > > > { > > > sum0 = sum0 + A[i]; > > > sum1 = sum1 + A[i]; &gt...
2017 Feb 01
2
RFC: Generic IR reductions
Constant propagation: %sum = add <N x float> %a, %b @llvm.reduce(ext <N x double> %sum) if %a and %b are vector of constants, the %sum also becomes a vector of constants. At this point you have @llvm.reduce(ext <N x double> %sum) and don't know what kind of reduction do you need. - Elena -----Original Message----- From: Renato Golin [mailto:renato.golin at linaro.org]
2009 Jul 15
0
Fwd: DLLs
...ype array1= array[1..2,1..num] of Double; array2=array[1..num,1..num] of longint; array3=array[1..num,1..num] of Double; array4=array[1..num] of longint; pA1=^array1; pA2=^array2; pA3=^array3; pA4=^array4; pD=^Double; procedure learning(loc1:pA1;adj1:pA2;alpha:pD); cdecl; var i1,i2,neighs:longint; sum1,sum2:double; newloc: array [1..2,1..num] of double; begin for i1:=1 to 2 do for i2:=1 to num do newloc[i1,i2]:=0; for i1:= 1 to num do begin neighs:=0; sum1:=0; sum2:=0; for i2:= 1 to num do begin if (adj1^[i1,i2]=1) then begin neighs:=neighs+1; sum1:=sum1+loc1[1,i2]; sum2:=su...
2018 Mar 16
1
Discrepancy: R sum() VS C or Fortran sum
...n >> double precision x(n), sx1, sx2 >> sx1 = sum(x) >> sx2 = 0.0d0 >> do i=1,n >> sx2 = sx2+x(i) >> end do >> end >> >> void sumc(double *x, int *n, double *sum) >> { >> int i; >> double sum1 = 0.0; >> for (i=0; i< *n; i++) { >> sum1 += x[i]; >> } >> *sum = sum1; >> } >> >> Can that be a bug? Thanks. >> >> > -- Pierre Chauss? Assistant Professor Department of Economics University of Waterloo