*** empty log message ***
authorPanayotis Skordos <edu/mit/csail/zurich/pas>
Tue, 2 Jan 1990 18:35:32 +0000 (18:35 +0000)
committerPanayotis Skordos <edu/mit/csail/zurich/pas>
Tue, 2 Jan 1990 18:35:32 +0000 (18:35 +0000)
v7/src/microcode/fft.c
v7/src/microcode/image.c

index c019ddbd9961561e5e208e1cf20e61b76ac2afa1..2a011ea9449e38a91f70144bf7251f4b8d16998e 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/fft.c,v 9.28 1989/12/20 18:03:39 pas Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/fft.c,v 9.29 1990/01/02 18:35:22 pas Rel $
 
 Copyright (c) 1987, 1988, 1989 Massachusetts Institute of Technology
 
@@ -1619,16 +1619,17 @@ DEFINE_PRIMITIVE ("ARRAY-CZT!", Prim_array_czt, 6,6, 0)
 
   PRIMITIVE_HEADER (6);
   phi = (arg_real_number (1)); /* starting point [0,1]*/
-  phi = (arg_real_number (2)); /* resolution [0,1] */
+  rho = (arg_real_number (2)); /* resolution [0,1] */
   CHECK_ARG (3, ARRAY_P);      /* input real */
   CHECK_ARG (4, ARRAY_P);      /* input imag */
   CHECK_ARG (5, ARRAY_P);      /* output real */
   CHECK_ARG (6, ARRAY_P);      /* output imag */
+  
   a = ARRAY_CONTENTS(ARG_REF(3));
   b = ARRAY_CONTENTS(ARG_REF(4));
   c = ARRAY_CONTENTS(ARG_REF(5));
   d = ARRAY_CONTENTS(ARG_REF(6));
-
+  
   N = ARRAY_LENGTH(ARG_REF(3));        /* N = input length */
   M = ARRAY_LENGTH(ARG_REF(5));        /* M = output length */
   if (N!=(ARRAY_LENGTH(ARG_REF(4))))    error_bad_range_arg(3);
index ee099fb1258f97b1521290a57420c67d8c61b553..532bf6dc2ec938568192086e8351c3adcafb55f1 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/image.c,v 9.29 1989/09/20 23:09:13 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/image.c,v 9.30 1990/01/02 18:35:32 pas Exp $
 
 Copyright (c) 1987, 1988, 1989 Massachusetts Institute of Technology
 
@@ -590,37 +590,26 @@ C_Image_Periodic_Shift(Array, New_Array, nrows, ncols, ver_shift, hor_shift)
 \f
 /* Rotations and stuff */
 
-DEFINE_PRIMITIVE ("IMAGE-TRANSPOSE!", Prim_image_transpose, 1, 1, 0)
-{
-  long nrows;
-  long ncols;
-  REAL * Array;
-  PRIMITIVE_HEADER (1);
-  {
-    SCHEME_OBJECT Parray;
-    arg_image (1, (&nrows), (&ncols), (&Parray));
-    Array = (ARRAY_CONTENTS (Parray));
-  }
-  if (nrows == ncols)
-    {
-      Image_Fast_Transpose (Array, nrows); /* side-effecting ... */
-    }
+DEFINE_PRIMITIVE ("IMAGE-TRANSPOSE!", Prim_image_transpose, 4,4, 0)
+{ long rows, cols;
+  REAL *x, *y;
+  PRIMITIVE_HEADER (4);
+  CHECK_ARG (1, FIXNUM_P);     /* rows */
+  CHECK_ARG (2, FIXNUM_P);     /* cols */
+  CHECK_ARG (3, ARRAY_P);      /* image array 1 */
+  CHECK_ARG (4, ARRAY_P);      /* image array 2,  empty for rows=cols */
+  
+  rows = arg_nonnegative_integer(1);
+  cols = arg_nonnegative_integer(2);
+  x = (ARRAY_CONTENTS (ARG_REF(3)));
+  y = (ARRAY_CONTENTS (ARG_REF(4)));
+  
+  if (rows==cols)              /* square image ==> ignore argument 4  */
+    Image_Fast_Transpose (x, rows);
   else
-    {
-      REAL *New_Array;
-      long Length = (nrows * ncols);
-      /* making space in scheme heap */
-      Primitive_GC_If_Needed (Length * REAL_SIZE);
-      New_Array = ((REAL *) Free);
-      Image_Transpose (Array, New_Array, nrows, ncols);
-      C_Array_Copy (New_Array, Array, Length);
-    }
-  {
-    SCHEME_OBJECT argument = (ARG_REF (1));
-    SET_PAIR_CAR (argument, (LONG_TO_UNSIGNED_FIXNUM (ncols)));
-    SET_PAIR_CAR ((PAIR_CDR (argument)), (LONG_TO_UNSIGNED_FIXNUM (nrows)));
-    PRIMITIVE_RETURN (argument);
-  }
+    Image_Transpose (x, y, rows, cols);
+  
+  PRIMITIVE_RETURN (UNSPECIFIC);
 }
 
 DEFINE_PRIMITIVE ("IMAGE-ROTATE-90CLW!", Prim_image_rotate_90clw, 1, 1, 0)