[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
add me to list; general comments; dld?
From: |
HORNE |
Subject: |
add me to list; general comments; dld? |
Date: |
Sat, 16 Jul 1994 22:50:13 -0400 (EDT) |
1) It's not clear exactly how to get on this mailing list; please add me,
or let me know how to become a member.
2) I have used a competitor of Matlab (IDL) very extensively over the
last 10 years or so. Octave seems to be the most useful "free" alternative.
("Free" in the FSF sense.)
I'd appreciate an explanation on the legal issues surrounding octave/Matlab.
3) The single most useful function any system like octave can have,
is dynamic loading of user compiled fortran or C functions. I have more
or less built a career on connecting codes from netlib (TOMS, particularly)
into IDL. I work primarily on DEC machines under VMS, which supports
what DEC calls "shareable images". I don't know much about Unix (I'm
learning; running Linux on 486 at home) but the DLD package seems roughly
equivalent. I see notes in the documentation refering to DLD, but my
impression is that the idea is to make all (or at least very many) modules
loadable, and that this is still a distant hope. A more modest goal
which will add a huge amount of functionality is described below.
4) Is anyone working on an octave routine to do the following:
("filename" is a library or .o file)
a) Take arguments of (filename, entry_point, arg_1, arg_2,...)
b) use DLD to load into memory the code (in filename) associated
with entry_point
c) call entry_point with arguments arg_1, arg_2,... , passing
them by reference so as to maximize convenience for fortran.
An important point-- the octave routine (call it call_fortran)
need not make any assumptions or be clever. It should not, for instance,
try to determine array sizes automagically. It should be dead dumb.
A wrapper routine (in octave) can interface between any given routine, and
call_fortran. As a specific example, I include below the IDL code I wrote
years ago to call the IMSL routine LSVRR from IDL. The equivalent
to call_fortran was the routine DOIT, which I wrote in fortran and linked
into IDL. (If you're familiar with IDL, the functionality of my DOIT
has since been incorporated into IDL as "CALL_EXTERNAL". 'imsl' is the
VMS shareable image containing most of the IMSL library.)
============
pro lsvrr,a,s,u,v,tol,rank
;
; S. Horne
; Return singular value decomposition of A
; Call l2vrr from imsl v10. See that documentation.
; Remember, all integer arguments to DOIT or ICF must be longwords (32 bits)
; See aml$root:[idl]doit.txt
; Should check for complex array and call appropriate routine, but doesn't.
;
; Modified to return rank estimate 8/21/90 -- smw
np=n_params(0) ; get number of arguments.
if (np lt 4) then begin ; not enough args
print,'Not enough arguments to IMSL routine L2VRR'
return
endif
if (np eq 4) then tol=0. ; Default tol.
; Correct no of args.
q=size(a)
if (q(0) ne 2) then begin
print,'Array must be 2 dimensional, not',q(0),'dimensional.'
return
endif
; Correct dimensions, let's go.
zero=long(0)
one=long(1)
doit,'imsl','erset', zero,one,zero ; Print errors, but don't stop.
nra=q(1) ; get dimensions of a
nca=q(2)
at=float(a) ; array must be real*4
lda=nra
ipath=long(11)
irank=long(0) ; rank.
s=fltarr(min( [nra+1,nca ])) ; singular values.
;ncu=min( [nra,nca] )
ncu=nra
u=fltarr(nra,ncu)
ldu=nra
v=fltarr(nca,nca)
ldv=nca
; now compute the workspace arrays.
acopy=at
wk=fltarr(nra*nca+nra+nca+max( [nra,nca] )-1)
; CALL THE ROUTINE
doit,'imsl','l2vrr',nra,nca,at,lda,ipath,tol,irank,s,u,ldu,v,ldv,acopy,wk
if np lt 6 then print,'rank=',irank else rank=irank
doit,'imsl','erset', zero,long(2),long(2) ; Print errors, but don't stop.
return
end
==================
There are many calculations the guts of which are better coded in
fortran than a higher level language; I've found the ability to write
subroutines in fortran, but to call the routines from a higher level language
(IDL, in my case; hopefully octave) to do all I/O and post-processing
a tremendous win. (My record is about 30 minutes from "I'd like to solve
these equations in L1 norm instead of least squares" to looking
at the solution. This involved finding the appropriate routiine at netlib,
pulling it in, compiling & linking as shareable image, writing 10-line
IDL wrapper routine.)
I plan to devote some effort to adding this kind of functionality to octave.
If anybody else is working in this general direction,
please email me.
5) Is anybody working on a VMS version of octave? I don't know how
competent I would be to assist, but I'd certainly be interested.
Finally, thanks to everyone who supports this system. It has tremendous
potential. I've been long-winded; sorry if I'm preaching to the choir.
address@hidden
- add me to list; general comments; dld?,
HORNE <=