/*************************************************************************\ * Copyright (c) 2002 The University of Chicago, as Operator of Argonne * National Laboratory. * Copyright (c) 2002 The Regents of the University of California, as * Operator of Los Alamos National Laboratory. * This file is distributed subject to a Software License Agreement found * in the file LICENSE that is included with this distribution. \*************************************************************************/ /* $Log: atest1.c,v $ Revision 1.3 2002/08/14 17:12:35 soliday Added Open License Revision 1.2 2001/08/29 18:08:40 borland Added a 3-D array plus nonequispaced y values. Revision 1.1 2001/08/29 17:56:02 borland First version. Revision 1.3 1995/12/12 04:26:45 borland Added SDDS_SetNoRowCounts() routine, plus support for writing and appending to files with no_row_counts=1. * Revision 1.2 1995/09/05 21:11:28 saunders * First test release of the SDDS1.5 package. * */ #include "mdb.h" #include "SDDS.h" #define NX 40 #define NY 200 #define NZ 5 main() { long d2[2] = {NX, NY}, dx[1] = {NX}, dy[1] = {NY}, dz[1] = {NZ}; long d3[3] = {NX, NY, NZ } ; double **p2, *x, *y, ***p3, *z; long i, j, k; SDDS_DATASET SDDS_dataset; /* make pointer arrays that index the data--note that the data * is NOT copied here. All I'm doing is setting up multi-level * pointer arrays into the existing data. */ if (!(p2=(double**)zarray_2d(sizeof(double), d2[0], d2[1])) || !(p3=(double***)zarray_2d(sizeof(**p3), d3[0], d3[1])) || !(x = malloc(sizeof(double)*d2[0])) || !(y=malloc(sizeof(double)*d2[1])) || !(z = malloc(sizeof(double)*d3[2]))) { SDDS_PrintErrors(stderr, 1); exit(1); } for (i=0; i