Mercurial > hg > octave-nkf
changeset 4786:fc316bde0053
[project @ 2004-02-18 12:52:20 by jwe]
author | jwe |
---|---|
date | Wed, 18 Feb 2004 12:52:20 +0000 |
parents | d3018a33c584 |
children | 02c748eb2ddc |
files | ChangeLog configure.in liboctave/Array.cc liboctave/Array.h liboctave/ChangeLog liboctave/oct-fftw.cc |
diffstat | 6 files changed, 53 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-02-18 Per Persson <persquare@mac.com> + + * configure.in (*-*-darwin*): Define SONAME_FLAGS. + 2004-02-16 David Bateman <dbateman@free.fr> * configure.in: Test for the presence of FFTW 3.x and use it in
--- a/configure.in +++ b/configure.in @@ -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*)
--- a/liboctave/Array.cc +++ b/liboctave/Array.cc @@ -931,6 +931,39 @@ Array<T>& Array<T>::insert (const Array<T>& a, int r, int c) { + if (ndims () == 2 && a.ndims () == 2) + insert2 (a, r, c); + else + insertN (a, r, c); + + return *this; +} + + +template <class T> +Array<T>& +Array<T>::insert2 (const Array<T>& 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 <class T> +Array<T>& +Array<T>::insertN (const Array<T>& a, int r, int c) +{ dim_vector a_dv = a.dims (); int n = a_dv.length ();
--- a/liboctave/Array.h +++ b/liboctave/Array.h @@ -446,8 +446,10 @@ { resize_and_fill (dv, val); } Array<T>& insert (const Array<T>& a, int r, int c); + Array<T>& insert2 (const Array<T>& a, int r, int c); + Array<T>& insertN (const Array<T>& a, int r, int c); - Array<T>& insert (const Array<T>& a, const Array<int>& dv); + Array<T>& insert (const Array<T>& a, const Array<int>& idx); bool is_square (void) const { return (dim1 () == dim2 ()); }
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,12 @@ +2004-02-18 John W. Eaton <jwe@bevo.che.wisc.edu> + + * Array.cc (Array<T>::insertN (const Array<T>&, int, int)): + Rename from Array<T>::insert. + (Array<T>::insert2 (const Array<T>&, int, int)): + Reinstate old Array<T>::insert function under this name. + (Array<T>::insert (const Array<T>&, int, int)): + New function. Dispatch to insert2 or insertN as appropriate. + 2004-02-17 John W. Eaton <jwe@bevo.che.wisc.edu> * oct-fftw.cc (convert_packcomplex_1d, convert_packcomplex_Nd):
--- a/liboctave/oct-fftw.cc +++ b/liboctave/oct-fftw.cc @@ -27,8 +27,9 @@ #include <iostream> #include <vector> +#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