[18902] in s-news-athena
Re: [S] S_alloc()
daemon@ATHENA.MIT.EDU (Prof Brian D Ripley)
Tue Aug 10 07:30:28 1999
Date: Tue, 10 Aug 1999 12:26:12 +0100 (BST)
From: Prof Brian D Ripley <ripley@stats.ox.ac.uk>
To: Yih Chong Chin <ycchin@maths.uwa.edu.au>
Cc: s-news@wubios.wustl.edu
In-Reply-To: <37AFF8AE.F5208EF5@maths.uwa.edu.au>
Message-Id: <Pine.GSO.4.05.9908101220430.24753-100000@auk.stats>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
On Tue, 10 Aug 1999, Yih Chong Chin wrote:
> Pardon me if this is a FAQ.
Not yet!
> I am trying to upgrade my C routines for Splus 3.4 to Splus 5.
> The S_alloc() function need to have an additional parameter of type
> "s_evaluator *". I was going through the manuals and couldn't find much
> about this.
>
> Can someone enlighten me about this s_evaluator?
Look at the examples in survival5 or the VR libraries. You need to use
macros, e.g.
#if( defined(SPLUS_VERSION) && SPLUS_VERSION >= 5000 )
# define RANDIN seedin((long *)NULL, S_evaluator)
# define RANDOUT seedout((long *)NULL, S_evaluator)
# define UNIF unif_rand(S_evaluator)
#else
# define RANDIN seed_in((long *)NULL)
# define RANDOUT seed_out((long *)NULL)
# define UNIF unif_rand()
# define Salloc(n, t) (t *)S_alloc(n, sizeof(t))
# define S_EVALUATOR
#endif
and in your code start with S_EVALUATOR, as in
void
VR_max_col(double *matrix, int *pnr, int *nc, int *maxes)
{
int r, c, m, nr = *pnr, ntie;
double a, b, tol;
S_EVALUATOR
RANDIN;
...
--
Brian D. Ripley, ripley@stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272860 (secr)
Oxford OX1 3TG, UK Fax: +44 1865 272595
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news