Displaying 20 results from an estimated 21 matches for "sum3".
Did you mean:
sum
2007 Feb 01
3
Help with efficient double sum of max (X_i, Y_i) (X & Y vectors)
...ouble 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 <- sum1 + sum(ifelse(x[i]>x,x[i],x))
sum3 <- sum3 +...
2013 Mar 25
2
Faster way of summing values up based on expand.grid
...,]
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[[mycombos[i,"Var1"]]] +
values2[[m...
2010 Nov 28
2
ssh-agent fails to hold values
Hello list
I am attempting to manage my key logins with ssh-agent. However EVERY
time I try to ssh I have to go through the same exact routing and it's
getting a little old...
[bluethundr at LCENT01:~]#ssh sum3
Enter passphrase for key '/home/bluethundr/.ssh/id_rsa':
[bluethundr at LCENT01:~]#exec ssh-agent bash
[bluethundr at LCENT01:~]#ssh-add
Enter passphrase for /home/bluethundr/.ssh/id_rsa:
Identity added: /home/bluethundr/.ssh/id_rsa (/home/bluethundr/.ssh/id_rsa)
[bluethundr at LCENT01:~]#...
2012 Jun 04
1
simulation of modified bartlett's test
...-1)*v2+(n3-1)*v3)/(N-k)
#calculate B
B=((N-k)*(log(A)))-((n1-1)*log(v1)+(n2-1)*log(v2)+(n3-1)*log(v3))
#calculate C
C=1+(1/(3*(k-1))*(((1/(n1-1))+(1/(n2-1))+(1/(n3-1)))-(1/(N-k))))
#calculate layard estimator
xbar1=mean(g1)
xbar2=mean(g2)
xbar3=mean(g3)
sum1=sum((g1-xbar1)^4)
sum2=sum((g2-xbar2)^4)
sum3=sum((g3-xbar3)^4)
sum4=sum((g1-xbar1)^2)
sum5=sum((g2-xbar2)^2)
sum6=sum((g3-xbar3)^2)
y= (N*(sum1+sum2+sum3))/((sum4+sum5+sum6)^2)
#calculate bartlett modified statistic
bar2=B/(C*(1/2)*(y-1))
bar2
pv[i]<-pchisq(bar2,2,lower=FALSE)
}
mean(pv<0.01)
mean(pv<0.05)
--
View this message in c...
2015 Jun 01
2
sum(..., na.rm=FALSE): Summing over NA_real_ values much more expensive than non-NAs for na.rm=FALSE? Hmm...
I'm observing that base::sum(x, na.rm=FALSE) for typeof(x) == "double"
is much more time consuming when there are missing values versus when
there are not. I'm observing this on both Window and Linux, but it's
quite surprising to me. Currently, my main suspect is settings in on
how R was built. The second suspect is my brain. I hope that someone
can clarify the below
2015 Mar 13
1
[RFC PATCH v3] Intrinsics/RTCD related fixes. Mostly x86.
...2 sum[ 4 ], int len)
+
+void dual_inner_prod_sse(const opus_val16 *x, const opus_val16 *y01, const opus_val16 *y02,
+ int N, opus_val32 *xy1, opus_val32 *xy2)
{
- int j;
-
- __m128i vecX, vecX0, vecX1, vecX2, vecX3;
- __m128i vecY0, vecY1, vecY2, vecY3;
- __m128i sum0, sum1, sum2, sum3, vecSum;
- __m128i initSum;
-
- celt_assert(len >= 3);
-
- sum0 = _mm_setzero_si128();
- sum1 = _mm_setzero_si128();
- sum2 = _mm_setzero_si128();
- sum3 = _mm_setzero_si128();
-
- for (j=0;j<(len-7);j+=8)
- {
- vecX = _mm_loadu_si128((__m128i *)(&x[j + 0]))...
2015 Mar 12
1
[RFC PATCHv2] Intrinsics/RTCD related fixes. Mostly x86.
...2 sum[ 4 ], int len)
+
+void dual_inner_prod_sse(const opus_val16 *x, const opus_val16 *y01, const opus_val16 *y02,
+ int N, opus_val32 *xy1, opus_val32 *xy2)
{
- int j;
-
- __m128i vecX, vecX0, vecX1, vecX2, vecX3;
- __m128i vecY0, vecY1, vecY2, vecY3;
- __m128i sum0, sum1, sum2, sum3, vecSum;
- __m128i initSum;
-
- celt_assert(len >= 3);
-
- sum0 = _mm_setzero_si128();
- sum1 = _mm_setzero_si128();
- sum2 = _mm_setzero_si128();
- sum3 = _mm_setzero_si128();
-
- for (j=0;j<(len-7);j+=8)
- {
- vecX = _mm_loadu_si128((__m128i *)(&x[j + 0]))...
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 :
2015 Jun 01
0
sum(..., na.rm=FALSE): Summing over NA_real_ values much more expensive than non-NAs for na.rm=FALSE? Hmm...
...ase::sum() is that the latter uses LDOUBLE
= long double (on some system it's only double, cf.
https://github.com/wch/r-source/blob/trunk/src/nmath/nmath.h#L28-L33),
whereas my sum2() code uses double. So using long double, I can
reproduce the penalty of having NA_real_ with na.rm=FALSE;
> sum3 <- inline::cfunction(sig=c(x="double", narm="logical"), body='
#define LDOUBLE long double
double *x_ = REAL(x);
int narm_ = asLogical(narm);
int n = length(x);
LDOUBLE sum = 0.0;
for (R_xlen_t i = 0; i < n; i++) {
if (!narm_ || !ISNAN(x_[i])) sum += x_[i];
}...
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
2015 Mar 02
13
Patch cleaning up Opus x86 intrinsics configury
The attached patch cleans up Opus's x86 intrinsics configury.
It:
* Makes ?enable-intrinsics work with clang and other non-GCC compilers
* Enables RTCD for the floating-point-mode SSE code in Celt.
* Disables use of RTCD in cases where the compiler targets an instruction set by default.
* Enables the SSE4.1 Silk optimizations that apply to the common parts of Silk when Opus is built in
2011 Nov 14
0
[LLVMdev] algebraic (de)optimizations form long chains of dependent operations
Hi,
when I compile (clang -O3) and optimize (opt -O3) C-code like this:
sum1 = val1 + val2;
sum2 = val3 + val4;
sum3 = val5 + val6;
sum4 = val7 + val8;
sum5 = sum1 + sum2;
sum6 = sum3 + sum4;
sum7 = sum5 + sum6;
sum += sum7;
I get bitcode like this:
if.end152: ; preds = %if.then150, %if.else146, %if.end137
%val8.0 = phi i32 [ -2048, %if.then...
2014 Aug 02
2
[LLVMdev] Create "appending" section that can be partially dead stripped
On 01/08/14 19:37, Reid Kleckner wrote:
> What happens if you drop appending linkage? I think it will just work,
> since you are already using a custom section, which will ensure that all
> the data appears contiguously in memory.
Thanks for the suggestion, but it still puts everything in a single
.section statement.
> Although, I do worry about what LLVM's alias analysis will
2014 Aug 05
2
[LLVMdev] Create "appending" section that can be partially dead stripped
...*
br label %LoopStart
; sum all elements in the array
LoopStart:
%looparr = phi i32* [%looparrinit, %Entry], [%looparrnext, %LoopBody]
%loopcond = icmp eq i64 %loopcount, 0
br i1 %loopcond, label %LoopEnd, label %LoopBody
LoopBody:
%val = load i32* %looparr
%sum2 = load i32* %sumvar
%sum3 = add i32 %val, %sum2
store i32 %sum3, i32* %sumvar
%looparrnext = getelementptr i32* %looparr, i64 1
br label %LoopStart
; return the sum
LoopEnd:
%retval = load i32* %sumvar
ret i32 %retval
}
; this declaration inserts a 0 byte
@arrstart = global [0 x i32] [ ], section "mytest"...
2015 Mar 18
5
[RFC PATCH v1 0/4] Enable aarch64 intrinsics/Ne10
Hi All,
Since I continue to base my work on top of Jonathan's patch,
and my previous Ne10 fft/ifft/mdct_forward/backward patches,
I thought it would be better to just post all new patches
as a patch series. Please let me know if anyone disagrees
with this approach.
You can see wip branch of all latest patches at
https://git.linaro.org/people/viswanath.puttagunta/opus.git
Branch:
2015 Mar 31
6
[RFC PATCH v1 0/5] aarch64: celt_pitch_xcorr: Fixed point series
Hi Timothy,
As I mentioned earlier [1], I now fixed compile issues
with fixed point and resubmitting the patch.
I also have new patch that does intrinsics optimizations
for celt_pitch_xcorr targetting aarch64.
You can find my latest work-in-progress branch at [2]
For reference, you can use the Ne10 pre-built libraries
at [3]
Note that I am working with Phil at ARM to get my patch at [4]
2004 Aug 06
2
[PATCH] Make SSE Run Time option. Add Win32 SSE code
...clude "speex.h"
#include "speex_bits.h"
-#ifdef _USE_SSE
-#include "ltp_sse.h"
-#else
-static float inner_prod(float *x, float *y, int len)
+extern int global_use_mmx_sse;
+
+static float inner_prod(float *a, float *b, int len)
{
- int i;
- float sum1=0,sum2=0,sum3=0,sum4=0;
- for (i=0;i<len;)
- {
- sum1 += x[i]*y[i];
- sum2 += x[i+1]*y[i+1];
- sum3 += x[i+2]*y[i+2];
- sum4 += x[i+3]*y[i+3];
- i+=4;
- }
- return sum1+sum2+sum3+sum4;
-}
+ if (!(global_use_mmx_sse & SPEEX_ASM_MMX_SSE_FP))
+ {
+/*
+//Older, slo...
2015 May 08
8
[RFC PATCH v2]: Ne10 fft fixed and previous 0/8]
Hi All,
As per Timothy's suggestion, disabling mdct_forward
for fixed point. Only effects
armv7,armv8: Extend fixed fft NE10 optimizations to mdct
Rest of patches are same as in [1]
For reference, latest wip code for opus is at [2]
Still working with NE10 team at ARM to get corner cases of
mdct_forward. Will update with another patch
when issue in NE10 gets fixed.
Regards,
Vish
[1]:
2015 May 15
11
[RFC V3 0/8] Ne10 fft fixed and previous
Hi All,
Changes from RFC v2 [1]
armv7,armv8: Extend fixed fft NE10 optimizations to mdct
- Overflow issue fixed by Phil at ARM. Ne10 wip at [2]. Should be upstream soon.
- So, re-enabled using fixed fft for mdct_forward which was disabled in RFCv2
armv7,armv8: Optimize fixed point fft using NE10 library
- Thanks to Jonathan Lennox, fixed some build fixes on iOS and some copy-paste errors
Rest
2015 Apr 28
10
[RFC PATCH v1 0/8] Ne10 fft fixed and previous
Hello Timothy / Jean-Marc / opus-dev,
This patch series is follow up on work I posted on [1].
In addition to what was posted on [1], this patch series mainly
integrates Fixed point FFT implementations in NE10 library into opus.
You can view my opus wip code at [2].
Note that while I found some issues both with the NE10 library(fixed fft)
and with Linaro toolchain (armv8 intrinsics), the work