void VU_cmconjIP_f(vsip_cmview_f *R) { vsip_cvview_f *R_row = vsip_cmrowview_f(R,0); vsip_length MR = vsip_cmgetcollength_f(R); vsip_stride Rcs = vsip_cmgetcolstride_f(R); vsip_offset offset = vsip_cmgetoffset_f(R); while(MR-- > 1){ vsip_cvconj_f(R_row,R_row); offset += Rcs; vsip_cvputoffset_f(R_row,offset); }vsip_cvconj_f(R_row,R_row); vsip_cvdestroy_f(R_row); }
void VU_rscjmvprod_f( vsip_scalar_f beta, vsip_cmview_f *A, vsip_cvview_f *v, vsip_cvview_f *w) { vsip_cvconj_f(v,v); vsip_cmvprod_f(A,v,w); vsip_cvconj_f(v,v); vsip_cvconj_f(w,w); vsip_rscvmul_f(beta,w,w); return; }
void vsip_ccorrelate1d_f( const vsip_ccorr1d_f *cor, vsip_bias bias, const vsip_cvview_f *h, const vsip_cvview_f *x, const vsip_cvview_f *y) { vsip_cvview_f xx = *cor->x, hh = *cor->h; vsip_cvview_f *xt = &xx, *ht = &hh; xt->length = cor->x->length - x->length; VI_cvfill_f(vsip_cmplx_f((vsip_scalar_f)0,(vsip_scalar_f)0),xt); xt->offset = xt->length; xt->length = x->length; VI_cvcopy_f_f(x,xt); xt->length = cor->x->length; xt->offset = 0; ht->length = cor->h->length - h->length; ht->offset = h->length; VI_cvfill_f(vsip_cmplx_f((vsip_scalar_f)0,(vsip_scalar_f)0),ht); ht->offset = 0; ht->length = h->length; VI_cvcopy_f_f(h,ht); vsip_ccfftip_f(cor->fft,cor->h); vsip_ccfftip_f(cor->fft,cor->x); vsip_cvjmul_f(cor->x,cor->h,cor->x); vsip_cvconj_f(cor->x,cor->x); vsip_rscvmul_f(1/(vsip_scalar_f)cor->N,cor->x,cor->x); vsip_ccfftip_f(cor->fft,cor->x); /* vsip_cvconj_f(cor->x,cor->x); */ switch(cor->support){ case VSIP_SUPPORT_FULL: xt->offset = xt->length - cor->mn; xt->length = y->length; if(bias == VSIP_UNBIASED){ VI_cvunbiasfull_f(cor,xt,y); } else { VI_cvcopy_f_f(xt,y); } break; case VSIP_SUPPORT_SAME: xt->offset = xt->length - cor->mn + (cor->m-1)/2; xt->length = y->length; if(bias == VSIP_UNBIASED){ VI_cvunbiassame_f(cor,xt,y); } else { VI_cvcopy_f_f(xt,y); } break; case VSIP_SUPPORT_MIN: xt->offset = xt->length - cor->mn + cor->m - 1; xt->length = y->length; if(bias == VSIP_UNBIASED){ vsip_rscvmul_f((vsip_scalar_f)1.0/(vsip_scalar_f)cor->m,xt,y); } else { VI_cvcopy_f_f(xt,y); } break; } return; }