Metropoli BBS
VIEWER: memixf.c MODE: TEXT (ASCII)
/* Copyright (C) 1995 by Thomas Glen Smith.  All Rights Reserved. */
/* memixf APL2 V1.0.0 **************************************************
* Called from memixcm to complete processing for member and indexof    *
* when the input data are complex numbers (APLCPLX).                   *
***********************************************************************/
#define INCLUDES APLCB
#include "includes.h"
Aplcb memixf(key,left,rite,out)
int key;
Aplcb left,rite,out;
{
	Errstop; Eqx;
	extern int indxorg;
	int i,j,k,*op;
	double *lp,*rp,*lw;

	lp = left->aplptr.apldata;
	rp = rite->aplptr.apldata;
	op = out->aplptr.aplint; /* output data ptr */
	for (i=0; i<rite->aplcount; i++) {
		lw = lp; /* left data ptr */
		k = 0;
		for (j=0; j<left->aplcount; j++) {
			eqx(rp, lw, &k);
			lw += 2;
			if (k) break;
		}
		if (key)
			k = j+indxorg; /* it is indexof */
		*op++ = k;
		rp += 2;
	}
	return(errstop(0,left,rite,out));
}

[ RETURN TO DIRECTORY ]