Next: bpipe_matrix_map_delete, Previous: bpipe_iochannel_write, Up: Internal Functions
Copy all or part of an N-dimensional matrix to a destination matrix.
#include <bpipe/bpipe.h>int bpipe_matrix_copy( BPDataType type, BPXMap xmap, BPMatrix *src, BPMatrix *dst, BPMatrixMap *map, void *udata, int (*copy)(void *udata,size_t dest,size_t src,size_t nbytes) );
BPDataType type
- type of a datum
Possible values for aBPDataType
are as follows:BPDType_char
,BPDType_double
,BPDType_int
,BPDType_uint
,BPDType_DVector2
,BPDType_DVector3
,BPDType_IVector2
,BPDType_IVector3
,BPDType_UIVector2
,BPDType_UIVector3
,BPDType_DComplex
,BPDType_DCVector2
,BPDType_DCVector3
BPXMap xmap
- what type of mapping
Possible values for aBPXMap
are as follows:BPXMap_Input_to_Core
,BPXMap_Core_to_Output
,BPXMap_Core_to_Core
BPMatrix *src
- description of the source matrix
BPMatrix *dst
- description of the destination matrix
BPMatrixMap *map
- the mapping from source to destination
void *udata
- copy routine specific information
int (*copy)(void *udata,size_t dest,size_t src,size_t nbytes)
- this will be called multiple times to copy the chunks of data
This routine analyzes the structure of the matrix (or submatrix) to
be copied and the destination matrix to ensure that the largest
possible chunks of memory are transferred. It passes information
about contigous chunks to a user supplied function, which is
responsible for the actual copying operation. The user supplied function
is called by bpipe_datatype_copy
.
It returns zero upon success, non-zero otherwise. Upon error
bpipe_errno
is set.
Upon error bpipe_errno
is set to one of the following errors:
BPEBADARG
BPEIOERR
BPENOMEM