rarray.h File Reference

Dimension information, array type and its operations. More...

#include "utils.h"
#include "exchangeinfo.h"

Go to the source code of this file.

Classes

struct  INFODIM
 Information about one dimension of the array. More...
struct  RARR
 Array type. More...

Typedefs

typedef int( RA_CREATE_FUN )(RARR *arr, IPNT v1, IPNT v2)
typedef int( RA_SET_FUN )(RARR *arr, const IPNT v1, const IPNT v2)

Functions

int ra_getdim (IPNT s, IPNT e)
 Helper function - returns dimension based on principle: dimension = largest index for which start, end indices differ = loop limit for loop over axes - not necessarily actual dimension of subarray.
int ra_setnull (RARR *arr)
 Set all fields in an array to zeros (NO DEALLOCATION).
int ra_create_s (RARR *arr, IPNT gs, IPNT n)
 Create array (given gs and n).
int ra_create_e (RARR *arr, IPNT ge, IPNT n)
 Create array (given ge and n).
int ra_create (RARR *arr, IPNT gs, IPNT ge)
 Create array (given gs and ge).
int ra_declare_s (RARR *arr, IPNT gs, IPNT n)
 Declare array (given gs and n).
int ra_declare_e (RARR *arr, IPNT ge, IPNT n)
 Declare array (given gs and n).
int ra_declare (RARR *arr, IPNT gs, IPNT ge)
 Declare array (given gs and n).
int ra_allocate (RARR *arr)
 Allocate array.
int ra_destroy (RARR *arr)
 Destroy array (STORAGE DEALLOCATION).
int ra_greset_s (RARR *arr, const IPNT gs, const IPNT n)
 Reset the working (computational virtual) array (given gs and n) (NO STORAGE ALLOCATION).
int ra_greset_e (RARR *arr, const IPNT ge, const IPNT n)
 Reset the working (computational virtual) array (given ge and n) (NO STORAGE ALLOCATION).
int ra_greset (RARR *arr, const IPNT gs, const IPNT ge)
 Reset the working (computational virtual) array (given gs and ge) (NO STORAGE ALLOCATION).
int ra_offset_s (RARR *arr, const IPNT os, const IPNT n)
 Reset the working (computational virtual) array (given os and n) (NO STORAGE ALLOCATION).
int ra_offset_e (RARR *arr, const IPNT oe, const IPNT n)
 Reset the working (computational virtual) array (given oe and n) (NO STORAGE ALLOCATION).
int ra_offset (RARR *arr, const IPNT os, const IPNT oe)
 Reset the working (computational virtual) array (given oe and n) (NO STORAGE ALLOCATION).
int ra_dump (const RARR *arr, FILE *stream)
 Dump array information.
int ra_print (RARR *arr, FILE *stream)
 Output the working (computational virtual) array to stream.
int ra_fprint (RARR *arr, const char *path)
 Output the working (computational virtual) array to a file.
int ra_write (RARR *arr, FILE *stream)
 Output the working (computational virtual) array to stream.
int ra_fwrite (RARR *arr, const char *path)
 Output the working (computational virtual) array to a file.
int ra_read (RARR *arr, FILE *stream)
 read the working (computational virtual) array from a binary stream
int ra_fread (RARR *arr, const char *path)
 read the working (computational virtual) array from a binary file
int ra_printslice (RARR *arr, FILE *stream, int idim, int islice)
 Output a slice of the working (computational virtual) array to a stream.
int ra_fprintslice (RARR *arr, const char *path, int idim, int islice)
 Output a slice of the working (computational virtual) array to a stream.
int ra_writeslice (RARR *arr, FILE *stream, int idim, int islice)
 Output a slice of the working (computational virtual) array to a file.
int ra_fwriteslice (RARR *arr, const char *path, int idim, int islice)
 Output a slice of the working (computational virtual) array to a file.
ireal ra_get (const RARR *arr, IPNT li)
 Get value at a local index relative to gs.
ireal ra_gget (const RARR *arr, IPNT gi)
 Get value at a global index.
void ra_set (RARR *arr, IPNT li, ireal r)
 Set value at a local index relative to gs.
void ra_gset (RARR *arr, IPNT gi, ireal r)
 Set value at a global index.
int ra_size (const RARR *arr, IPNT n)
 Get axis lengths of the working (computational virtual) array.
int ra_datasize (const RARR *arr, size_t *n)
 Get size of the working (computational virtual) array.
int ra_a_size (const RARR *arr, IPNT n)
 Get axis lengths of the allocated array.
int ra_a_datasize (const RARR *arr, size_t *n)
 Get size of the allocated array.
int ra_gse (const RARR *arr, IPNT gs, IPNT ge)
 Get the global start and end indices of the working (computational virtual) array.
int ra_gse (const RARR *arr1, const RARR *arr2, IPNT gs, IPNT ge)
int ra_se (const RARR *arr, IPNT s, IPNT e)
 Get the start and end indices of the working (computational virtual) array RELATIVE to the allocated array.
int ra_a_gse (const RARR *arr, IPNT gs, IPNT ge)
 Get the start and end indices of the allocated array.
int ra_ds (const RARR *tgt, const RARR *src, IPNT ds)
 Relative index shift from source rarray to target array.
int ra_checkbound (const RARR *arr, int idim, int li)
 Check if a local index relative to gs (and idim) is within bounds of the allocated array.
int ra_gcheckbound (const RARR *arr, int idim, int gi)
 Check if a gloabal index (and idim) is within bounds of the allocated array.
int ra_ndim (const RARR *arr, int *ndim)
 Get number of dimensions.
int ra_empty (RARR *arr, int *empty)
 Array empty query.
int ra_setempty (RARR *arr)
 Set the working (computational virtual) array empty.
int ra_setexchangeinfo (RARR *arr, EXCHANGEINFO *einfo)
 Populates exchange info.
int ra_overlap (RARR *arr1, RARR *arr2, int *overlap)
 Checks if the two working (computational virtual) arrays of arr1 and arr2 overlap.
int ra_setoverlap (RARR *arr1, RARR *arr2)
 Set the working (computational virtual) array's dimension info of arr1 to be that of the overlap part of arr1 and arr2.
int ra_zero (RARR *arr)
 Set the entries of the computational array all zero.
int ra_a_zero (RARR *arr)
 Set the entries of the allocated array all zero.
int ra_ghost_zero (RARR *arr)
 Set the entries of the ghost cells or halo (complement of computational array in allocated array) to zero.
int ra_deepcopy (RARR const *src, RARR *tgt)
 Copy all of the members of the source struct to the target struct.
int ra_copy (RARR *arr_des, RARR *arr_src)
 Copy the contents of the source VIRTUAL array to the destination VIRTUAL array.
int ra_a_copy (RARR *arr_des, RARR *arr_src)
 Copy the contents of the source ALLOCATED arry to the destination ALLOCATED array.
int ra_a_scale (RARR *tgt, ireal fac)
 scale ALLOCATED array elements
int ra_a_inner (RARR const *arr1, RARR const *arr2, ireal *ip)
 part of infrastructure to give RDOM minimal DataContainer characteristics
int ra_axpy (RARR *arry, RARR const *arrx, ireal a)
 part of infrastructure to give RDOM minimal DataContainer characteristics
int ra_compare_meta (const RARR *a, const RARR *b)
 comparison function - required to make RARR behave like a proper metadata object


Detailed Description

Dimension information, array type and its operations.

Functions:

Notes:

Definition in file rarray.h.


Typedef Documentation

typedef int( RA_CREATE_FUN)(RARR *arr, IPNT v1, IPNT v2)

Definition at line 133 of file rarray.h.

typedef int( RA_SET_FUN)(RARR *arr, const IPNT v1, const IPNT v2)

Definition at line 231 of file rarray.h.


Function Documentation

int ra_getdim ( IPNT  s,
IPNT  e 
)

Helper function - returns dimension based on principle: dimension = largest index for which start, end indices differ = loop limit for loop over axes - not necessarily actual dimension of subarray.

Parameters:
[in] s - start indices
[in] e - end indices
Returns:
apparent dimension

int ra_setnull ( RARR arr  ) 

Set all fields in an array to zeros (NO DEALLOCATION).

Parameters:
[out] arr - (RARR *)
Returns:
0

int ra_create_s ( RARR arr,
IPNT  gs,
IPNT  n 
)

Create array (given gs and n).

Declaration + allocation. Set n=n0, gs=gs0, ge=ge0 and _s=_s0.

Parameters:
[out] arr - (RARR *)
[in] gs - (IPNT) global start indices of the array in all dimensions
[in] n - (IPNT) sizes of the array in all dimensions
Returns:
0 if successful, else error code as in base/include/utils.h.

int ra_create_e ( RARR arr,
IPNT  ge,
IPNT  n 
)

Create array (given ge and n).

Declaration + allocation. Set n=n0, gs=gs0, ge=ge0 and _s=_s0.

Parameters:
[out] arr - (RARR *)
[in] ge - (IPNT) global end indices of the array in all dimensions
[in] n - (IPNT) sizes of the array in all dimensions
Returns:
0 if successful, else error code as in base/include/utils.h.

int ra_create ( RARR arr,
IPNT  gs,
IPNT  ge 
)

Create array (given gs and ge).

Declaration + allocation. Set n=n0, gs=gs0, ge=ge0 and _s=_s0.

Parameters:
[out] arr - (RARR *)
[in] gs - (IPNT) global start indices of the array in all dimensions
[in] ge - (IPNT) global end indices of the array in all dimensions
Returns:
0 if successful, else error code as in base/include/utils.h.

int ra_declare_s ( RARR arr,
IPNT  gs,
IPNT  n 
)

Declare array (given gs and n).

Works like create, but does not allocate memory. Also set n=n0, gs=gs0, ge=ge0. Use ra_allocate to allocate memory.

Parameters:
[out] arr - (RARR *)
[in] gs - (IPNT) global start indices of the array in all dimensions
[in] n - (IPNT) sizes of the arr as in base/include/utils.h.

int ra_declare_e ( RARR arr,
IPNT  ge,
IPNT  n 
)

Declare array (given gs and n).

Works like create, but does not allocate memory. Also set n=n0, gs=gs0, ge=ge0. Use ra_allocate to allocate memory.

Parameters:
[out] arr - (RARR *)
[in] ge - (IPNT) global end indices of the array in all dimensions
[in] n - (IPNT) sizes of the array in all dimensions
Returns:
0 if successful, else error code as in base/include/utils.h.

int ra_declare ( RARR arr,
IPNT  gs,
IPNT  ge 
)

Declare array (given gs and n).

Works like create, but does not allocate memory. Also set n=n0, gs=gs0, ge=ge0. Use ra_allocate to allocate memory.

Parameters:
[out] arr - (RARR *)
[in] gs - (IPNT) global start indices of the array in all dimensions
[in] ge - (IPNT) global end indices of the array in all dimensions
Returns:
0 if successful, else error code as in base/include/utils.h.

int ra_allocate ( RARR arr  ) 

Allocate array.

Allocate memory. Set _s=_s0.

Parameters:
[out] arr - (RARR *)
Returns:
0 if successful, else error code as in base/include/utils.h.

int ra_destroy ( RARR arr  ) 

Destroy array (STORAGE DEALLOCATION).

Free the allocated memory pointed by _s0

Parameters:
[out] arr - (RARR *)
Returns:
0 if successful, else error code as in base/include/utils.h.

int ra_greset_s ( RARR arr,
const IPNT  gs,
const IPNT  n 
)

Reset the working (computational virtual) array (given gs and n) (NO STORAGE ALLOCATION).

Parameters:
[out] arr - (RARR *)
[in] gs - (IPNT) global start indices of the working (computational virtual) array in all dimensions
[in] n - (IPNT) sizes of the working (computational virtual) array in all dimensions
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_greset_e ( RARR arr,
const IPNT  ge,
const IPNT  n 
)

Reset the working (computational virtual) array (given ge and n) (NO STORAGE ALLOCATION).

Parameters:
[out] arr - (RARR *)
[in] ge - (IPNT) global end indices of the working (computational virtual) array in all dimensions
[in] n - (IPNT) sizes of the working (computational virtual) array in all dimensions
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_greset ( RARR arr,
const IPNT  gs,
const IPNT  ge 
)

Reset the working (computational virtual) array (given gs and ge) (NO STORAGE ALLOCATION).

Parameters:
[out] arr - (RARR *)
[in] gs - (IPNT) global start indices of the working (computational virtual) array in all dimensions.
[in] ge - (IPNT) global end indices of the working (computational virtual) array in all dimensions.
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_offset_s ( RARR arr,
const IPNT  os,
const IPNT  n 
)

Reset the working (computational virtual) array (given os and n) (NO STORAGE ALLOCATION).

new_gs = gs + os, new_ge = ge - oe.

Parameters:
[out] arr - (RARR *)
[in] os - (IPNT) start index offsets (forward) of the working (computational virtual) array in all dimensions.
[in] n - (IPNT) sizes of the working (computational virtual) array in all dimensions
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_offset_e ( RARR arr,
const IPNT  oe,
const IPNT  n 
)

Reset the working (computational virtual) array (given oe and n) (NO STORAGE ALLOCATION).

Parameters:
[out] arr - (RARR *)
[in] oe - (IPNT) end index offsets (backward) of the working (computational virtual) array in all dimensions.
[in] n - (IPNT) sizes of the working (computational virtual) array in all dimensions
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_offset ( RARR arr,
const IPNT  os,
const IPNT  oe 
)

Reset the working (computational virtual) array (given oe and n) (NO STORAGE ALLOCATION).

Parameters:
[out] arr - (RARR *)
[in] os - (IPNT) start index offsets (forward) of the working (computational virtual) array in all dimensions.
[in] oe - (IPNT) end index offsets (backward) of the working (computational virtual) array in all dimensions.
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_dump ( const RARR arr,
FILE *  stream 
)

Dump array information.

Parameters:
[in] arr - (RARR *)
[in] stream - (FILE *)
Returns:
0 if successful, else error code as in base/include/utils.h.

int ra_print ( RARR arr,
FILE *  stream 
)

Output the working (computational virtual) array to stream.

Format: formatted ASCII.

Parameters:
[in] arr - (RARR *)
[in] stream - (FILE *)
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_fprint ( RARR arr,
const char *  path 
)

Output the working (computational virtual) array to a file.

Format: formatted ASCII

Parameters:
[in] arr - (RARR *)
[in] path - (const char *) file name
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_write ( RARR arr,
FILE *  stream 
)

Output the working (computational virtual) array to stream.

Format: binary

Parameters:
[in] arr - (RARR *)
[in] stream - (FILE *)
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_fwrite ( RARR arr,
const char *  path 
)

Output the working (computational virtual) array to a file.

Format: binary

Parameters:
[in] arr - (RARR *)
[in] path - (const char *) file name
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_read ( RARR arr,
FILE *  stream 
)

read the working (computational virtual) array from a binary stream

Parameters:
[in] arr - (RARR *)
[in] stream - (FILE *)
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_fread ( RARR arr,
const char *  path 
)

read the working (computational virtual) array from a binary file

Parameters:
[in] arr - (RARR *)
[in] path - (const char *) file name
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_printslice ( RARR arr,
FILE *  stream,
int  idim,
int  islice 
)

Output a slice of the working (computational virtual) array to a stream.

Format: formatted ASCII.

Parameters:
[in] arr - (RARR *)
[in] stream - (FILE *)
[in] idim - (int) dimension number. the idim'th index is fixed
[in] islice - (int) the fixed index
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_fprintslice ( RARR arr,
const char *  path,
int  idim,
int  islice 
)

Output a slice of the working (computational virtual) array to a stream.

Format: formatted ASCII.

Parameters:
[in] arr - (RARR *)
[in] path - (const char *) file name
[in] idim - (int) dimension number. the idim'th index is fixed
[in] islice - (int) the fixed index
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_writeslice ( RARR arr,
FILE *  stream,
int  idim,
int  islice 
)

Output a slice of the working (computational virtual) array to a file.

Format: binary.

Parameters:
[in] arr - (RARR *)
[in] stream - (FILE *)
[in] idim - (int) dimension number. the idim'th index is fixed
[in] islice - (int) the fixed index
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_fwriteslice ( RARR arr,
const char *  path,
int  idim,
int  islice 
)

Output a slice of the working (computational virtual) array to a file.

Format: binary.

Parameters:
[in] arr - (RARR *)
[in] path - (const char *) file name
[in] idim - (int) dimension number. the idim'th index is fixed
[in] islice - (int) the fixed index
Returns:
0 on successful completion, else error code as in base/include/utils.h.

ireal ra_get ( const RARR arr,
IPNT  li 
)

Get value at a local index relative to gs.

[No difference with ra_gget, since gs is alway 0]

Parameters:
[in] arr - (RARR *)
[in] li - (IPNT) local index relative to gs
Returns:
the value at the specified entry, else REAL_NAN.

ireal ra_gget ( const RARR arr,
IPNT  gi 
)

Get value at a global index.

Parameters:
[in] arr - (RARR *)
[in] gi - (IPNT) global index
Returns:
the value at the specified entry, else REAL_NAN.

void ra_set ( RARR arr,
IPNT  li,
ireal  r 
)

Set value at a local index relative to gs.

[No difference with ra_gset, since gs is alway 0]

Parameters:
[out] arr - (RARR *)
[in] li - (IPNT) local index relative to gs
[in] r - (ireal) the value to be set

void ra_gset ( RARR arr,
IPNT  gi,
ireal  r 
)

Set value at a global index.

Parameters:
[out] arr - (RARR *)
[in] gi - (IPNT) global index
[in] r - (ireal) the value to be set

int ra_size ( const RARR arr,
IPNT  n 
)

Get axis lengths of the working (computational virtual) array.

Parameters:
[in] arr - (RARR *)
[out] n - (IPNT)
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_datasize ( const RARR arr,
size_t *  n 
)

Get size of the working (computational virtual) array.

Parameters:
[in] arr - arg
[out] n - size of array = prod of axis lengths
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_a_size ( const RARR arr,
IPNT  n 
)

Get axis lengths of the allocated array.

Parameters:
[in] arr - (RARR *)
[out] n - (IPNT)
Returns:
the value at the specified entry, else error code as in base/include/utils.h.

0 on successful completion, else error code as in base/include/utils.h.

int ra_a_datasize ( const RARR arr,
size_t *  n 
)

Get size of the allocated array.

Parameters:
[in] arr - (RARR *)
[out] n - size of array = prod of axis lengths
Returns:
the value at the specified entry, else error code as in base/include/utils.h.

0 on successful completion, else error code as in base/include/utils.h.

int ra_gse ( const RARR arr,
IPNT  gs,
IPNT  ge 
)

Get the global start and end indices of the working (computational virtual) array.

Parameters:
[in] arr - (RARR *)
[out] gs - (IPNT) start indices
[out] ge - (IPNT) end indices
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_gse ( const RARR arr1,
const RARR arr2,
IPNT  gs,
IPNT  ge 
)

int ra_se ( const RARR arr,
IPNT  s,
IPNT  e 
)

Get the start and end indices of the working (computational virtual) array RELATIVE to the allocated array.

That is, return s = gs-gs0, e = ge-gs0. These are the correct index limits to loop over the computational array by indexing into the multidimensinal array representation of the allocated array. For example, if a is 2D, then you can assign to its computational part by the nested loop

ra_se(&a,s,e); for (i[1]=s[1];i[1]<=e[1];i[1]++) for (i[0]=s[0];i[0]<=e[0];i[0]++) a._s02[i[1]][i[0]] = ...

Parameters:
[in] arr - (RARR *)
[out] s - (IPNT) start indices
[out] e - (IPNT) end indices
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_a_gse ( const RARR arr,
IPNT  gs,
IPNT  ge 
)

Get the start and end indices of the allocated array.

Parameters:
[in] arr - (RARR *)
[out] gs - (IPNT) start indices
[out] ge - (IPNT) end indices
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_ds ( const RARR tgt,
const RARR src,
IPNT  ds 
)

Relative index shift from source rarray to target array.

Used to align multidimensional index references: for example, if ds is retrieved by

ra_ds(&tgt,&src,ds)

and tgt, src are 3D rarrays, then

tgt._s3[i[2]+ds[2]][i[1]+ds[1]][i[0]+ds[0]]

and

src._s3[i[2]][i[1]][i[0]]

refer to values at the same global grid location

Parameters:
[in] tgt - (RARR *) target rarray (shifted indices)
[in] src - (RARR *) source rarray (unshifted indices)
[out] ds - (IPNT) index shift from source to target
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_checkbound ( const RARR arr,
int  idim,
int  li 
)

Check if a local index relative to gs (and idim) is within bounds of the allocated array.

Parameters:
[in] arr - (RARR *)
[in] idim - (int) dimension number.
[in] li - local index relative to gs
Returns:
0 if within bounds, else error code as in base/include/utils.h.

int ra_gcheckbound ( const RARR arr,
int  idim,
int  gi 
)

Check if a gloabal index (and idim) is within bounds of the allocated array.

Parameters:
[in] arr - (RARR *)
[in] idim - (int) dimension number.
[in] gi - global index
Returns:
0 if within bounds, else error code as in base/include/utils.h.

int ra_ndim ( const RARR arr,
int *  ndim 
)

Get number of dimensions.

Parameters:
[in] arr - (RARR *)
[out] ndim - (int *) number of dimensions
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_empty ( RARR arr,
int *  empty 
)

Array empty query.

Parameters:
[in] arr - (RARR *)
[out] empty - (int *) 0: nonempty, 1: empty
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_setempty ( RARR arr  ) 

Set the working (computational virtual) array empty.

Parameters:
[in] arr - (RARR *)
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_setexchangeinfo ( RARR arr,
EXCHANGEINFO einfo 
)

Populates exchange info.

Creates MPI_Datatype inside - do not forget to destoy.

Parameters:
[in] arr - (RARR *)
[out] einfo - (EXCHANGEINFO *)
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_overlap ( RARR arr1,
RARR arr2,
int *  overlap 
)

Checks if the two working (computational virtual) arrays of arr1 and arr2 overlap.

Parameters:
[in] arr1,arr2 - (RARR *)
[out] overlap - (int *) 0: not overlap, 1: overlap
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_setoverlap ( RARR arr1,
RARR arr2 
)

Set the working (computational virtual) array's dimension info of arr1 to be that of the overlap part of arr1 and arr2.

Parameters:
[in,out] arr1 - (RARR *)
[in] arr2 - (RARR *)
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_zero ( RARR arr  ) 

Set the entries of the computational array all zero.

Parameters:
[in] arr - (RARR *)
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_a_zero ( RARR arr  ) 

Set the entries of the allocated array all zero.

Parameters:
[in] arr - (RARR *)
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_ghost_zero ( RARR arr  ) 

Set the entries of the ghost cells or halo (complement of computational array in allocated array) to zero.

Parameters:
[in] arr - (RARR *)
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_deepcopy ( RARR const *  src,
RARR tgt 
)

Copy all of the members of the source struct to the target struct.

No allocation occurs. tgt works as a reference of src.

Parameters:
[in] src - (RARR const *) src cannot be pointed to other array, but one can change the array pointed by it
[out] tgt - (RARR *)
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_copy ( RARR arr_des,
RARR arr_src 
)

Copy the contents of the source VIRTUAL array to the destination VIRTUAL array.

Both arrays must have the same structure and be allocated.

Parameters:
[in] src - (RARR const *) data copied from
[out] tgt - (RARR *) data copied to
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_a_copy ( RARR arr_des,
RARR arr_src 
)

Copy the contents of the source ALLOCATED arry to the destination ALLOCATED array.

Both arrays must have the same structure and be allocated.

Parameters:
[in] src - (RARR const *) data copied from
[out] tgt - (RARR *) data copied to
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_a_scale ( RARR tgt,
ireal  fac 
)

scale ALLOCATED array elements

Parameters:
[in] tgt - (RARR *) target data
[in] fac - (ireal) scale factor
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_a_inner ( RARR const *  arr1,
RARR const *  arr2,
ireal ip 
)

part of infrastructure to give RDOM minimal DataContainer characteristics

note that inner product is over entire ALLOCATED array, not just virtual array

Parameters:
[in] arr1 - (RARR const *) input array 1
[in] arr2 - (RARR const *) input array 2
[out] ip - (ireal) inner product - unscaled l2
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_axpy ( RARR arry,
RARR const *  arrx,
ireal  a 
)

part of infrastructure to give RDOM minimal DataContainer characteristics

saxpy for virtual arrays

Parameters:
[in] arrx - (RARR const *) input array
[in] arry - (RARR *) input/output array = y <- ax+y
[in] a - (ireal) multiplier
Returns:
0 on successful completion, else error code as in base/include/utils.h.

int ra_compare_meta ( const RARR a,
const RARR b 
)

comparison function - required to make RARR behave like a proper metadata object

Returns:
0 if arguments have same ndim, gs and ge, 1 otherwise


Generated on 5 Jan 2017 for IWAVEGRID by  doxygen 1.4.7