Adelsbach/VSIPL
Core Light Double Precision Programming Reference Guide
DD-00014-015
Core Light +DP

5.3 vsip_cblockbind_p - Create a block using existing data (complex)

typedef enum _vsip_memory_hint { 
  VSIP_MEM_NONE          = 0, 
  VSIP_MEM_RDONLY        = 1, 
  VSIP_MEM_CONST         = 2, 
  VSIP_MEM_SHARED        = 3, 
  VSIP_MEM_SHARED_RDONLY = 4, 
  VSIP_MEM_SHARED_CONST  = 5 
} vsip_memory_hint; 
 
vsip_cblock_f* vsip_cblockbind_f(vsip_scalar_f *r, vsip_scalar_f *i, vsip_length n, vsip_memory_hint h); 
vsip_cblock_d* vsip_cblockbind_d(vsip_scalar_d *r, vsip_scalar_d *i, vsip_length n, vsip_memory_hint h);
Description

This function creates a new complex data block using existing data, which can be either interleaved complex numbers or split real and imaginary data arrays. If the imaginary data array i is NULL, it is assumed that r is interleaved and contains 2n> 0 elements. If the imaginary data array is provided, it is assumed that each of the r and i arrays contains n> 0 elements.

The block must be admitted before it can be used.

Parameters
Return Value
Error Handling

If an error occurs, the function returns NULL.

Example

vsip_scalar_f real_data[10]; // Example data array 
vsip_scalar_f imag_data[10]; // Example imaginary data array 
vsip_length length = 10; 
vsip_memory_hint hint = VSIP_MEM_NONE; 
vsip_cblock_f *block; 
 
// Create a block with split real and imaginary data 
block = vsip_cblockbind_f(real_data, imag_data, length, hint); 
 
if (block == NULL) { 
    // Handle error 
} 
 
// Admit the block before using it 
int result = vsip_cblockadmit_f(block, VSIP_TRUE); 
if (result != 0) { 
    // Handle error 
} 
 
// Create a block with interleaved data 
vsip_scalar_f interleaved_data[20]; // Example interleaved data array 
block = vsip_cblockbind_f(interleaved_data, NULL, length, hint); 
 
if (block == NULL) { 
    // Handle error 
} 
 
// Admit the block before using it 
result = vsip_cblockadmit_f(block, VSIP_TRUE); 
if (result != 0) { 
    // Handle error 
}