Beispiel #1
0
void vsip_mcumsum_d(
   const vsip_mview_d *a,
   vsip_major major,
   const vsip_mview_d *r) {
   {
      vsip_vview_d *va,vaa;
      vsip_vview_d *vr,vrr;
      vsip_index i;
      vsip_length m = a->col_length;
      vsip_length n = a->row_length;
      va = &vaa; vr = &vrr;
      if(major == VSIP_ROW){
         for(i=0; i<m; i++){
            VI_mrowview_d(a,i,va);
            VI_mrowview_d(r,i,vr);
            VI_vcumsum_d(va,vr);
         }
      } else { /* must be VSIP_COL */
         for(i=0; i<n; i++){
            VI_mcolview_d(a,i,va);
            VI_mcolview_d(r,i,vr);
            VI_vcumsum_d(va,vr);
         }
      }
   }
   return;
}
Beispiel #2
0
void vsip_mpolar_d(const vsip_cmview_d* a, const vsip_mview_d* r, const vsip_mview_d* t){
    vsip_index i;
    vsip_vview_d rv; vsip_vview_d tv; vsip_cvview_d av;
    if(a->row_stride < a->col_stride){
        for(i=0; i < a->col_length; i++){
            VI_mrowview_d(r,i,&rv); VI_mrowview_d(t,i,&tv);VI_cmrowview_d(a,i,&av);
            vpolar_d(&av,&rv,&tv);
        }
    } else {
        for(i=0; i < a->col_length; i++){
            VI_mcolview_d(r,i,&rv); VI_mcolview_d(t,i,&tv);VI_cmcolview_d(a,i,&av);
            vpolar_d(&av,&rv,&tv);
        }
    }
}
static void VI_mprodq_d(
     vsip_mview_d *C,
     vsip_qr_d *qr)
{
     vsip_mview_d *H = qr->A;
     vsip_scalar_d *beta = qr->beta;
     vsip_vview_d *h, hh;
     vsip_length j;
     vsip_stride k;
     vsip_vview_d vv = *(qr->v),
                  ww = *(qr->w); 
     vsip_vview_d *v = &vv,
                  *w = &ww;
     h = VI_mcolview_d(H,0,&hh);
     w->length = C->col_length;
     for(k= 0; k < (vsip_stride)H->row_length; k++){
         j = (vsip_length)k;
         h->offset = j * H->row_stride +
                     j * H->col_stride + H->offset;
         h->length = H->col_length - j;
         v->length = h->length;
         v->offset = qr->M - h->length;
         VI_vcopy_d_d(h,v);
         VI_VPUT_D(v,(vsip_index) 0, (vsip_scalar_d)1.0);
         vv = *(qr->v);
         v->length = C->col_length;
         VI_smvprod_d(-beta[j],C,v,w);
         v->length = qr->M;
         VI_opu_d(C,w,v);
         vv = *(qr->v);
         VI_VPUT_D(v,k,0);
     }   
     return;
}
static 
void 
VI_qprodm_d(
       vsip_mview_d *C,
       vsip_qr_d *qr)
{
     vsip_mview_d *H = qr->A;
     vsip_scalar_d *beta = qr->beta;
     vsip_vview_d *h, hh;
     vsip_length j;
     vsip_stride k;
     vsip_vview_d vv = *(qr->v),
                  ww = *(qr->w);
     vsip_vview_d *v = &vv, *w = &ww;
     VI_vfill_d(0,v);
     h = VI_mcolview_d(H,0,&hh);
     w->length = C->row_length;
     for(k = qr->N -1; k >= 0; k--){
          j = (vsip_length)k;
          h->offset = j * (H->row_stride + H->col_stride) + H->offset;
          h->length = H->col_length -j;
          v->length = h->length;
          v->offset = qr->M - h->length;
          VI_vcopy_d_d(h,v);
          VI_VPUT_D(v,(vsip_index)0,(vsip_scalar_d)1);
          vv = *(qr->v);
          v->length = C->col_length;
          VI_svmprod_d(-beta[j],v,C,w);
          v->length = qr->M;
          VI_opu_d(C,v,w);
     }
     return;
}