🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: sci.math.stat
Article #186

Re: C Matrix Inversion from SPlus

#186
From: Andrew Mullhaupt
Date: Mon, 06 Apr 1992 03:50
33 lines
1795 bytes
In article <1992Apr3.231735.27376@unixg.ubc.ca> turkel@unixg.ubc.ca (Bill Turkel) writes:
>I have the C routines for matrix inversion from _Numerical Recipes in C_
>and I would like to dynamically link them into SPlus and call them from
>S. ...

This sounds like a very do-able but bad idea. Why not use the Splus qr or
svd functions?

>   The matrices are stored dynamically as (float **) in C.  The S manual 
	....
>... If I use S_alloc, then
>I get error messages to the effect that S is unable to allocate 15 million
>bytes for a 2x2 matrix.  Has anyone done this?  What am I doing wrong?

Sounds like you are passing things by value which have to be passed by
reference. You could use malloc(), but then the storage will not be
available to you after the call. Allocation which should persist across
calls (either Splus or C) should be memory-mapped to files. This is
the best way to avoid Splus's horrifying memory inefficiency (which it
inherited from S and is entirely AT&T's fault not to mention any names...)

>
>We are running SunOS 4.1.1 and Splus (the manual has a copyright of 1990,
>but I could find no version number).

You should go through an example from the blue book. This will show you how
dynamic loading is supposed to work. If it doesn't, then maybe your copy
of Splus is broken. You might consider their excellent technical support,
which is not too expensive.


Later,
Andrew Mullhaupt
Technical Details
Message-ID: <790@kepler1.rentec.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!psinntp!kepler1!andrew
References: <1992Apr3.231735.27376@unixg.ubc.ca>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!psinntp!kepler1!andrew
From: andrew@rentec.com (Andrew Mullhaupt)
Newsgroups: sci.math.stat
Subject: Re: C Matrix Inversion from SPlus
Message-ID: <790@kepler1.rentec.com>
Date: 6 Apr 92 03:50:54 GMT
References: <1992Apr3.231735.27376@unixg.ubc.ca>
Organization: Renaissance Technologies Corp., Setauket, NY.
Lines: 33