/* Copyright (C) 1992, 1995 by Thomas Glen Smith. All Rights Reserved. */
/* comexpb APL2 V1.0.0 *************************************************
* Called by compress and expand to obtain the output aplcb. *
***********************************************************************/
#define INCLUDES APLCB
#include "includes.h"
Aplcb comexpb(rite,axis,axicnt,botcnt,topcnt,pdatatyp)
Aplcb rite;
int axis,axicnt,botcnt,topcnt,*pdatatyp;
{
Errstop; Getcb; Imax; Intcopy;
Aplcb out;
int *dimptr;
out = getcb(NULL,botcnt*axicnt*topcnt,
(*pdatatyp = rite->aplflags & (APLMASK + APLAPL)) + APLTEMP,
imax(1,rite->aplrank),NULL);
/* now define output dimensions */
if (out->aplrank > 1) /* rank > vector? */
dimptr = intcopy(out->apldim,rite->apldim,out->aplrank,1);
*(out->apldim + axis - 1) = axicnt; /* set axis dimension */
return(errstop(0,NULL,NULL,out));
}