NAME

cxConnEleSet - set the connections of one element in a connection list structure
#include <cx/DataAccess.h>

cxErrorCode cxConnEleSet(cxConnection *src, long index, long numConnections, long *connections)
integer function cxConnEleSet (src, index, numconnections, connections)
integer src
integer index
integer numconnections
integer connections(numconnections)
src
Input connection list data structure.
index
Input number of the element whose connections are to be set.
numConnections
Input length of the connections array.
connections
Input array of all connections (represented by the index number of the connection's destination) for the lattice element indicated by index.
The return value for this function is an integer error code enumeration. cxConnEleSet sets the number of connections associated with the element numbered index and copies the contents of the connections array into the cxConnection structure, overwriting any previous list of connections for that element. index uses a one-based indexing scheme, so that the first element is numbered one, rather than zero.

If the number of connections changes from its previous value, then the remainder of the cxConnection structure is shifted to accommodate the change. No shifting is necessary when setting connections for the last non-empty element in a connection list. Thus initializing connections with increasing values of index is more efficient than initializing connections with decreasing values of index.

If the new, shifted connections would exceed the internal size of the cxConnection array, that array is reallocated to a larger size. No reallocation is done when src->connections is not filled entirely.

Because of the array reallocation and shifting of contents, it is often more efficient to use cxConnPtrSet that to make multiple calls to cxConnEleSet.

A return value of cx_err_none indicates success, while another value indicates a bad source or an allocation error.

cxConnNew(3E), cxConnPtrSet(3E), cxConnEleGet(3E), cxDataRealloc(3E),
Last modified: Mon Nov 6 16:32:58 GMT 2000
[ Documentation Home ]
© The Numerical Algorithms Group Ltd, Oxford UK. 1996