# HG changeset patch # User jwe # Date 1077108740 0 # Node ID fc316bde0053928962de93e48a45e38ed7bc78c9 # Parent d3018a33c5847a258edc62b8ed2f8757b722c564 [project @ 2004-02-18 12:52:20 by jwe] diff -r d3018a33c584 -r fc316bde0053 ChangeLog --- a/ChangeLog Tue Feb 17 21:58:17 2004 +0000 +++ b/ChangeLog Wed Feb 18 12:52:20 2004 +0000 @@ -1,3 +1,7 @@ +2004-02-18 Per Persson + + * configure.in (*-*-darwin*): Define SONAME_FLAGS. + 2004-02-16 David Bateman * configure.in: Test for the presence of FFTW 3.x and use it in diff -r d3018a33c584 -r fc316bde0053 configure.in --- a/configure.in Tue Feb 17 21:58:17 2004 +0000 +++ b/configure.in Wed Feb 18 12:52:20 2004 +0000 @@ -29,7 +29,7 @@ EXTERN_CXXFLAGS="$CXXFLAGS" AC_INIT -AC_REVISION($Revision: 1.446 $) +AC_REVISION($Revision: 1.447 $) AC_PREREQ(2.57) AC_CONFIG_SRCDIR([src/octave.cc]) AC_CONFIG_HEADER(config.h) @@ -700,6 +700,7 @@ SHLEXT_VER='$(version).$(SHLEXT)' SHLLIB_VER='$(version).$(SHLLIB)' NO_OCT_FILE_STRIP=true + SONAME_FLAGS='-install_name $(octlibdir)/$@' library_path_var=DYLD_LIBRARY_PATH ;; *-*-cygwin* | *-*-mingw*) diff -r d3018a33c584 -r fc316bde0053 liboctave/Array.cc --- a/liboctave/Array.cc Tue Feb 17 21:58:17 2004 +0000 +++ b/liboctave/Array.cc Wed Feb 18 12:52:20 2004 +0000 @@ -931,6 +931,39 @@ Array& Array::insert (const Array& a, int r, int c) { + if (ndims () == 2 && a.ndims () == 2) + insert2 (a, r, c); + else + insertN (a, r, c); + + return *this; +} + + +template +Array& +Array::insert2 (const Array& a, int r, int c) +{ + int a_rows = a.rows (); + int a_cols = a.cols (); + + if (r < 0 || r + a_rows > rows () || c < 0 || c + a_cols > cols ()) + { + (*current_liboctave_error_handler) ("range error for insert"); + return *this; + } + + for (int j = 0; j < a_cols; j++) + for (int i = 0; i < a_rows; i++) + elem (r+i, c+j) = a.elem (i, j); + + return *this; +} + +template +Array& +Array::insertN (const Array& a, int r, int c) +{ dim_vector a_dv = a.dims (); int n = a_dv.length (); diff -r d3018a33c584 -r fc316bde0053 liboctave/Array.h --- a/liboctave/Array.h Tue Feb 17 21:58:17 2004 +0000 +++ b/liboctave/Array.h Wed Feb 18 12:52:20 2004 +0000 @@ -446,8 +446,10 @@ { resize_and_fill (dv, val); } Array& insert (const Array& a, int r, int c); + Array& insert2 (const Array& a, int r, int c); + Array& insertN (const Array& a, int r, int c); - Array& insert (const Array& a, const Array& dv); + Array& insert (const Array& a, const Array& idx); bool is_square (void) const { return (dim1 () == dim2 ()); } diff -r d3018a33c584 -r fc316bde0053 liboctave/ChangeLog --- a/liboctave/ChangeLog Tue Feb 17 21:58:17 2004 +0000 +++ b/liboctave/ChangeLog Wed Feb 18 12:52:20 2004 +0000 @@ -1,3 +1,12 @@ +2004-02-18 John W. Eaton + + * Array.cc (Array::insertN (const Array&, int, int)): + Rename from Array::insert. + (Array::insert2 (const Array&, int, int)): + Reinstate old Array::insert function under this name. + (Array::insert (const Array&, int, int)): + New function. Dispatch to insert2 or insertN as appropriate. + 2004-02-17 John W. Eaton * oct-fftw.cc (convert_packcomplex_1d, convert_packcomplex_Nd): diff -r d3018a33c584 -r fc316bde0053 liboctave/oct-fftw.cc --- a/liboctave/oct-fftw.cc Tue Feb 17 21:58:17 2004 +0000 +++ b/liboctave/oct-fftw.cc Wed Feb 18 12:52:20 2004 +0000 @@ -27,8 +27,9 @@ #include #include +#include "lo-error.h" #include "oct-fftw.h" -#include "lo-error.h" +#include "quit.h" // Helper class to create and cache fftw plans for both 1d and 2d. This // implementation uses FFTW_ESTIMATE to create the plans, which in theory