DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ T p

⟦a9509ed81⟧ TextFile

    Length: 969 (0x3c9)
    Types: TextFile
    Names: »prodlist.h«

Derivation

└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki
    └─ ⟦this⟧ »EUUGD11/stat-5.3/eu/stat/src/prodlist.h« 

TextFile

/* Copyright 1986 Gary Perlman */

#ifndef	PRODLIST_H
#define	PRODLIST_H

typedef struct
	{
	int 	*power;     /* power[i] is the exponent of i */
	int  	n;          /* number of terms in power list */
	} PLIST;

#define	MAXN    1000         /* maximum exponent in a product list */

#define	prod_get(list,i)       (list->power[i])
#define	prod_set(list,i,p)     (list->power[i] = (p))
#define	prod_n(list)           (list->n)
#define	prod_pow(list,i,p)     prod_set (list, (i), prod_get (list, (i)) + (p))
#define	prod_mult(list,i)      prod_pow (list, i, 1)
#define	prod_div(list,i)       prod_pow (list, i, (-1))

PLIST	*prod_new ();      /* returns a pointer to a product list */
void	prod_rel();        /* release space for a product list */
void	prod_init ();      /* set all product list exponents to zero */
void	prod_fact ();      /* insert an expanded factorial to list */
double	prod_compute ();   /* compute the value of a product list */

#endif	PRODLIST_H