Mercurial > hg > octave-terminal
changeset 3088:f33738510eb2
[project @ 1997-10-02 06:38:36 by jwe]
author | jwe |
---|---|
date | Thu, 02 Oct 1997 06:41:15 +0000 |
parents | dd4a9ab9c2bd |
children | 3462187925ff |
files | ChangeLog mkoctfile.in src/ChangeLog src/DLD-FUNCTIONS/filter.cc src/DLD-FUNCTIONS/rand.cc src/variables.cc |
diffstat | 6 files changed, 81 insertions(+), 60 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Oct 2 01:37:15 1997 John W. Eaton <jwe@bevo.che.wisc.edu> + + * mkoctfile.in: Handle -IDIR option. + Thu Sep 25 11:47:45 1997 John W. Eaton <jwe@bevo.che.wisc.edu> * mkoctfile.in: Really add link options to link command.
--- a/mkoctfile.in +++ b/mkoctfile.in @@ -44,6 +44,7 @@ objfiles= octfiles= octfile= +incflags= ldflags= dbg=: strip=false @@ -82,6 +83,7 @@ Options: -h, -? --help Print this message. + -IDIR Add -IDIR to compile commands. -lLIB Add library LIB to link command. -LDIR Add -LDIR to link command. -o FILE, --output FILE Output file name. Default extension is .oct. @@ -101,10 +103,11 @@ EOF exit 0 ;; + -I*) + incflags="$incflags $1";; + ;; -[lL]*) ldflags="$ldflags $1";; - "") - break ;; -o | --output) shift @@ -155,8 +158,8 @@ b=`echo $f | sed 's,\.c$,,'` o=$b.o objfiles="$objfiles $o" - $dbg $CC -c $CPPFLAGS $CPICFLAG $ALL_CFLAGS $f -o $o - eval $CC -c $CPPFLAGS $CPICFLAG $ALL_CFLAGS $f -o $o + $dbg $CC -c $CPPFLAGS $CPICFLAG $ALL_CFLAGS $incflags $f -o $o + eval $CC -c $CPPFLAGS $CPICFLAG $ALL_CFLAGS $incflags $f -o $o done fi @@ -175,8 +178,8 @@ esac o=$b.o objfiles="$objfiles $o" - $dbg $CXX -c $CPPFLAGS $CXXPICFLAG $ALL_CXXFLAGS $f -o $o - eval $CXX -c $CPPFLAGS $CXXPICFLAG $ALL_CXXFLAGS $f -o $o + $dbg $CXX -c $CPPFLAGS $CXXPICFLAG $ALL_CXXFLAGS $incflags $f -o $o + eval $CXX -c $CPPFLAGS $CXXPICFLAG $ALL_CXXFLAGS $incflags $f -o $o done fi
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,7 +1,13 @@ +Thu Sep 25 10:17:26 1997 John W. Eaton <jwe@bevo.che.wisc.edu> + + * DLD-FUNCTIONS/filter.cc (Ffilter): Return second output value + even when called with only 3 arguments. + Mon Sep 22 16:44:27 1997 John W. Eaton <jwe@bevo.che.wisc.edu> * DLD-FUNCTIONS/rand.cc (do_rand): Print error if first of two args is a string but doesn't match "seed". + (Frand, Frandn): Fix doc string. Mon Aug 25 10:42:07 1997 John W. Eaton <jwe@bevo.che.wisc.edu>
--- a/src/DLD-FUNCTIONS/filter.cc +++ b/src/DLD-FUNCTIONS/filter.cc @@ -193,9 +193,31 @@ if (! error_state) { + ComplexColumnVector si; + if (nargin == 3) { - ComplexColumnVector y (filter (b, a, x)); + int a_len = a.length (); + int b_len = b.length (); + + int si_len = (a_len > b_len ? a_len : b_len) - 1; + + si.resize (si_len, 0.0); + } + else + si = args(3).complex_vector_value (); + + if (! error_state) + { + ComplexColumnVector y (filter (b, a, x, si)); + + if (nargout == 2) + { + if (si_is_vector) + retval (1) = octave_value (si, (args(3).columns () == 1)); + else + retval (1) = si; + } if (x_is_vector) retval (0) = octave_value (y, (args(2).columns () == 1)); @@ -203,26 +225,7 @@ retval (0) = y; } else - { - ComplexColumnVector si = args(3).complex_vector_value (); - - if (! error_state) - { - ComplexColumnVector y (filter (b, a, x, si)); - - if (si_is_vector) - retval (1) = octave_value (si, (args(3).columns () == 1)); - else - retval (1) = si; - - if (x_is_vector) - retval (0) = octave_value (y, (args(2).columns () == 1)); - else - retval (0) = y; - } - else - error (errmsg); - } + error (errmsg); } else error (errmsg); @@ -235,9 +238,31 @@ if (! error_state) { + ColumnVector si; + if (nargin == 3) { - ColumnVector y (filter (b, a, x)); + int a_len = a.length (); + int b_len = b.length (); + + int si_len = (a_len > b_len ? a_len : b_len) - 1; + + si.resize (si_len, 0.0); + } + else + si = args(3).vector_value (); + + if (! error_state) + { + ColumnVector y (filter (b, a, x, si)); + + if (nargout == 2) + { + if (si_is_vector) + retval (1) = octave_value (si, (args(3).columns () == 1)); + else + retval (1) = si; + } if (x_is_vector) retval (0) = octave_value (y, (args(2).columns () == 1)); @@ -245,26 +270,7 @@ retval (0) = y; } else - { - ColumnVector si = args(3).vector_value (); - - if (! error_state) - { - ColumnVector y (filter (b, a, x, si)); - - if (si_is_vector) - retval (1) = octave_value (si, (args(3).columns () == 1)); - else - retval (1) = si; - - if (x_is_vector) - retval (0) = octave_value (y, (args(2).columns () == 1)); - else - retval (0) = y; - } - else - error (errmsg); - } + error (errmsg); } else error (errmsg);
--- a/src/DLD-FUNCTIONS/rand.cc +++ b/src/DLD-FUNCTIONS/rand.cc @@ -327,13 +327,13 @@ } DEFUN_DLD (rand, args, nargout, - "rand -- generate a random value from a uniform distribution\n\ + "rand -- generate a random value from a uniform distribution\n\ \n\ -rand (N) -- generate N x N matrix\n\ -rand (size (A)) -- generate matrix the size of A\n\ -rand (N, M) -- generate N x M matrix\n\ -rand (SEED) -- get current seed\n\ -rand (SEED, N) -- set seed\n\ +rand (N) -- generate N x N matrix\n\ +rand (size (A)) -- generate matrix the size of A\n\ +rand (N, M) -- generate N x M matrix\n\ +rand (\"seed\") -- get current seed\n\ +rand (\"seed\", N) -- set seed\n\ \n\ See also: randn") { @@ -361,13 +361,13 @@ } DEFUN_DLD (randn, args, nargout, - "randn -- generate a random value from a normal distribution\n\ + "randn -- generate a random value from a normal distribution\n\ \n\ -randn (N) -- generate N x N matrix\n\ -randn (size (A)) -- generate matrix the size of A\n\ -randn (N, M) -- generate N x M matrix\n\ -randn (SEED) -- get current seed\n\ -randn (SEED, N) -- set seed\n\ +randn (N) -- generate N x N matrix\n\ +randn (size (A)) -- generate matrix the size of A\n\ +randn (N, M) -- generate N x M matrix\n\ +randn (\"seed\") -- get current seed\n\ +randn (\"seed\", N) -- set seed\n\ \n\ See also: rand") {