FFTPACK and J 
Author Message
 FFTPACK and J

#!/bin/sh
# This is a shell archive (produced by shar 3.50)
# To extract the files from this archive, save it to a file, remove
# everything above the "!/bin/sh" line above, and type "sh file_name".
#

# Source directory /usr/cp2/emclean/src
#
# existing files will NOT be overwritten unless -c is specified
#
# This shar contains:
# length  mode       name
# ------ ---------- ------------------------------------------
#   1151 -rw------- readme
#    673 -rw------- makefile
#   1041 -rw------- ft.c
#
# ============= readme ==============
if test -f 'readme' -a X"$1" != X"-c"; then
        echo 'x - skipping readme (File already exists)'
else
echo 'x - extracting readme (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'readme' &&
X
X Here is an alpa version of my fftpack-J stuff.
X Spellings and usages are very likely to change.
X
X The following are implemented :
X
/* 40!:0 jfft  Fourier Transform                     */
/* 40!:1 jifft Inverse Fourier Transform             */
X
X To compile this with J you must
X compile or have libF77.a and libI77.a from
X att.research.com in netlib.
X
X You also must get create the libraries in rblas.tar.Z and
X rfft-0.11.tar.Z from RLaB. RLaB can be found at :
X
X       evans.ee.adfa.oz.au     /pub/RLaB
X
X       mizar.docs.uu.se        /pub/gnu/RLaB
X
X       csi.jpl.nasa.gov        pub/matlab/RLaB
X
X if(40==p){AF*f1,*f2;
X  ASSERT(jft(q,&f1,&f2),EVDOMAIN);
X  R CDERIV(CIBEAM, f1,f2, RMAXL,RMAXL,RMAXL);}
X
X For now I'd perfer not to ask Dr.{*filter*}ey to put this at watserv
X as, I repeat, this is an *ALPHA* version.  I'm simply eager to have
X someone else aside from myself experiment with the code. (I hope
X someone else is interested!
X
X I've included my makefile. If you do not have jk.c the keyed file
X stuff I posted then you will have to delete jk.o from the OBJ line.
X Similarly you may not have sd.o, the file for the fourier transform
X stuff, or cb.o the file with combinations.
X
SHAR_EOF
chmod 0600 readme ||
echo 'restore of readme failed'
Wc_c="`wc -c < 'readme'`"
test 1151 -eq "$Wc_c" ||
        echo 'readme: original size 1151, current size' "$Wc_c"
fi
# ============= makefile ==============
if test -f 'makefile' -a X"$1" != X"-c"; then
        echo 'x - skipping makefile (File already exists)'
else
echo 'x - extracting makefile (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'makefile' &&
# J Makefile for Unix
X
CC     = cc
CFLAGS = -g
HDR    = a.h io.h j.h jc.h je.h js.h jt.h p.h v.h x.h f2c.h
OBJ    = sd.o ft.o jk.o czero.o cb.o j.o a.o ai.o ap.o au.o \
X       c.o cc.o cd.o cf.o cg.o cp.o cr.o ct.o cx.o \
X       f.o i.o io.o  k.o  m.o  p.o pc.o pv.o \
X       r.o rl.o rt.o s.o t.o ta.o u.o ut.o \
X       v.o ve.o vg.o vi.o vm.o vp.o vs.o vx.o vz.o \
X       w.o wn.o x.o xa.o xf.o xl.o  
X
OB2    = vh.o vb.o xs.o
X
j      : $(OBJ) $(OB2)
X       $(CC) -g $(OBJ) $(OB2) \
X    -L./lib/lapack-C -lClapack\
X    -L./lib/blas-C -lCblas\
X    -L./lib/fftpack-C -lCfftpack\
X    -L./lib/libF77  -lF77\
X    -L./lib/libI77  -lI77\
X     -lm -o j
X
$(OBJ) : $(HDR)
X

X       $(CC) -g -c $<
X
SHAR_EOF
chmod 0600 makefile ||
echo 'restore of makefile failed'
Wc_c="`wc -c < 'makefile'`"
test 673 -eq "$Wc_c" ||
        echo 'makefile: original size 673, current size' "$Wc_c"
fi
# ============= ft.c ==============
if test -f 'ft.c' -a X"$1" != X"-c"; then
        echo 'x - skipping ft.c (File already exists)'
else
echo 'x - extracting ft.c (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'ft.c' &&
#include "j.h"
#include <stdio.h>
#define max(a,b) ((a) >= (b) ? (a) : (b))
#define min(a,b) ((a) <= (b) ? (a) : (b))
#define NUMERIC  (BOOL+INT+FL+CMPX)
X
static A jfft();          
static A jifft();          
X
static F1(jfft){PROLOG;
X  A ws,t,z;I i,m,n,mn;
X  int cffti_(),cfftf_(),cfftb_();
X  F1RANK(1,jfft,0);RZ(w);
X  if(AN(w)==0)EPILOG(mtv);
X  ASSERT((AR(w)<=1)&&NUMERIC&AT(w),EVDOMAIN);
X  w=cvt(CMPX,w);
X  n=i0(tally(w));
X  GA(ws,FL,4*n+15,1,0);
X  cffti_(&n,AV(ws));
X  cfftf_(&n,AV(w),AV(ws));
X  EPILOG(divide(w,sc(n)));
Quote:
}

X
static F1(jifft){PROLOG;
X  A ws,t,z;I i,m,n,mn;
X  int cffti_(),cfftf_(),cfftb_();
X  F1RANK(1,jifft,0);RZ(w);
X  if(AN(w)==0)EPILOG(mtv);
X  ASSERT((AR(w)<=1)&&NUMERIC&AT(w),EVDOMAIN);
X  w=cvt(CMPX,w);
X  n=i0(tally(w));
X  GA(ws,FL,4*n+15,1,0);
X  cffti_(&n,AV(ws));
X  cfftb_(&n,AV(w),AV(ws));
X  EPILOG(w);
Quote:
}

X
C jft (k, f1, f2) I k;
AF * f1, *f2;
{
X  switch (k) {
X    case 0: *f1 = jfft    ; *f2 = NULL     ; R 1;                      
X    case 1: *f1 = jifft   ; *f2 = NULL     ; R 1;                      
X    default:
X      ASSERT (0, EVNONCE);    
X  }
Quote:
}

SHAR_EOF
chmod 0600 ft.c ||
echo 'restore of ft.c failed'
Wc_c="`wc -c < 'ft.c'`"
test 1041 -eq "$Wc_c" ||
        echo 'ft.c: original size 1041, current size' "$Wc_c"
fi
exit 0


Sat, 23 Dec 1995 13:08:02 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. JS-EAI with *JS*-callback

2. js.exception 3279.js

3. fftpack getting started (install)

4. Passing complex arrays as real ones (fftpack)

5. Passing complex arrays as real ones (fftpack)

6. Fortran 90 LAPACK, BLAS[123], FFTPACK, VFFTPACK, LINPACK released for NT, Linux

7. NB. gray.js: a J verb that generates a grayscale postscript image from a 2d array

8. lapackTest.js

9. profile.js

10. J script file profile.js

11. JS valueOf() in RB ?

12. JS for functional programming?

 

 
Powered by phpBB® Forum Software