vsip_vview_f* (vsip_vcreate_f)(
  vsip_length n, 
  vsip_memory_hint h) {
   vsip_block_f* b = VI_blockcreate_f((size_t)n, h);
   vsip_vview_f* v = (vsip_vview_f*)NULL;
   if(b != (vsip_block_f*)NULL){
      v = vsip_vbind_f(b, (vsip_offset)0, (vsip_stride)1, n);
      if(v == (vsip_vview_f*)NULL) vsip_blockdestroy_f(b);
   }
   return v;
}
Exemple #2
0
vsip_mview_f* (vsip_mcreate_f)(
  vsip_length m, 
  vsip_length n, 
  vsip_major rc, 
  vsip_memory_hint h) {
   vsip_block_f* b = VI_blockcreate_f((vsip_length)(m*n), h);
   vsip_mview_f* v = (vsip_mview_f*)NULL;
   if(b != (vsip_block_f*)NULL){

      v = (rc == VSIP_ROW)
         ?  
         vsip_mbind_f(b, (vsip_offset)0,
           (vsip_stride)n, m, (vsip_stride)1, n)
         :  
         vsip_mbind_f(b, (vsip_offset)0,
           (vsip_stride)1, m, (vsip_stride)m, n);
 
        if(v == (vsip_mview_f*)NULL) VI_blockdestroy_f(b);   
   }
   return v;
}