Next: , Previous: bpipe_matrix_max, Up: Utility Functions


A.4.14 bpipe_matrix_new

create a binary pipe matrix specification

Synopsis

     #include <bpipe/bpipe.h>
     
     
     
BPMatrix *bpipe_matrix_new( size_t nd, size_t extent[] );

Parameters

size_t nd
the number of dimensions in the matrix
size_t extent[]
if non NULL, points to an extents array to be duplicated

Description

This routine creates a binary pipe matrix specification of a given dimensionality. It allocates memory for the matrix structure and its associated data. If a premade extents array is available, the parameter extent should point to it, and the routine will use it as is, directing the BPipe cleanup code to take responsibility for freeing it. The user should not free it, nor should it pass it to any other BPipe routine which takes responsibility for freeing it. If extent is NULL, the extents array is initialized to all ones.

Returns

Upon successful completion a pointer to the new matrix is returned. Upon error bpipe_errno is set and NULL is returned.

Errors

Upon error bpipe_errno is set to one of the following errors:

BPEBADARG
the passed argument is bogus or the matrix specification was illegal
BPENOMEM
a memory allocation failed