File: bcast.h

package info (click to toggle)
yorick 1.4-14
  • links: PTS
  • area: main
  • in suites: potato
  • size: 5,948 kB
  • ctags: 6,609
  • sloc: ansic: 63,898; yacc: 889; makefile: 605; sh: 65; lisp: 60; fortran: 19
file content (64 lines) | stat: -rw-r--r-- 2,304 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
    BCAST.H
    Declare generic broadcast, scatter, and gather functions.

    $Id: bcast.h,v 1.1 1993/08/27 18:32:09 munro Exp $
 */
/*    Copyright (c) 1994.  The Regents of the University of California.
                    All rights reserved.  */

#ifndef BCAST_H
#define BCAST_H

/*--------------------------------------------------------------------------*/

#ifndef NOT_YORICK
#include "ydata.h"

/* Broadcast(dst, ddims, src, sdims, base)
   broadcasts the src array into the dst array (where both src
   and dst array elements are size bytes long), returning 0 on
   success, 1 if sdims is not L-conformable with ddims. */

extern int Broadcast(void *dst, const Dimension *ddims,
		     void *src, const Dimension *sdims, StructDef *base);

#else
/* Only Scatter and Gather functions are relevant to standalone
   binary file package.  */
#include "binio.h"
#endif

/*--------------------------------------------------------------------------*/

/* Scatter(src, dst, base, number, strider)
   scatters the src array into the dst array, given the strider for
   the dst array and the base StructDef for the objects to be scattered.
   If the strider is 0, the given number of contiguous objects is
   copied.
      x(index list)= expression      */

extern void Scatter(void *src, void *dst, StructDef *base, long number,
		    const Strider *strider);

/* Gather(dst, src, base, number, strider)
   gathers into the dst array from the src array, given the strider for
   the src array and the base StructDef for the objects to be gathered.
   If the strider is 0, the given number of contiguous objects is
   copied.
      ... evaluate x(index list) ...  */

extern void Gather(void *dst, void *src, StructDef *base, long number,
		   const Strider *strider);

/* Scatter and Gather have analogues YWrite and YRead when the data
   resides on an IOStream instead of in memory.  CastRead and CastWrite
   are low-level workers for YRead and YWrite which do not perform
   format conversions.  */
extern void CastWrite(void *src, long dst, StructDef *base, long number,
		      const Strider *strider);
extern void CastRead(void *dst, long src, StructDef *base, long number,
		     const Strider *strider);

/*--------------------------------------------------------------------------*/
#endif