Mercurial > hg > octave-nkf
changeset 2366:c90105b99479
[project @ 1996-10-11 23:22:27 by jwe]
author | jwe |
---|---|
date | Fri, 11 Oct 1996 23:32:05 +0000 |
parents | 7c60f8a6e6a0 |
children | 5c9e8f5c10c3 |
files | src/arith-ops.cc src/data.cc src/dirfns.cc src/resource.cc src/strfns.cc src/syscalls.cc |
diffstat | 6 files changed, 9 insertions(+), 129 deletions(-) [+] |
line wrap: on
line diff
--- a/src/arith-ops.cc +++ b/src/arith-ops.cc @@ -34,9 +34,10 @@ #include "error.h" #include "gripes.h" #include "mappers.h" -#include "pt-const.h" #include "unwind-prot.h" #include "utils.h" +#include "ov.h" +#include "variables.h" #include "xdiv.h" #include "xpow.h" @@ -67,128 +68,6 @@ Matrix_OR, }; -// Check row and column dimensions for binary matrix operations. - -static inline int -m_add_conform (const Matrix& a, const Matrix& b, int warn) -{ - int ar = a.rows (); - int ac = a.columns (); - int br = b.rows (); - int bc = b.columns (); - - int ok = (ar == br && ac == bc); - - if (! ok && warn) - gripe_nonconformant (ar, ac, br, bc); - - return ok; -} - -static inline int -m_add_conform (const Matrix& a, const ComplexMatrix& b, int warn) -{ - int ar = a.rows (); - int ac = a.columns (); - int br = b.rows (); - int bc = b.columns (); - - int ok = (ar == br && ac == bc); - - if (! ok && warn) - gripe_nonconformant (ar, ac, br, bc); - - return ok; -} - -static inline int -m_add_conform (const ComplexMatrix& a, const Matrix& b, int warn) -{ - int ar = a.rows (); - int ac = a.columns (); - int br = b.rows (); - int bc = b.columns (); - - int ok = (ar == br && ac == bc); - - if (! ok && warn) - gripe_nonconformant (ar, ac, br, bc); - - return ok; -} - -static inline int -m_add_conform (const ComplexMatrix& a, const ComplexMatrix& b, int warn) -{ - int ar = a.rows (); - int ac = a.columns (); - int br = b.rows (); - int bc = b.columns (); - - int ok = (ar == br && ac == bc); - - if (! ok && warn) - gripe_nonconformant (ar, ac, br, bc); - - return ok; -} - -static inline int -m_mul_conform (const Matrix& a, const Matrix& b, int warn) -{ - int ac = a.columns (); - int br = b.rows (); - - int ok = (ac == br); - - if (! ok && warn) - gripe_nonconformant (a.rows (), ac, br, b.columns ()); - - return ok; -} - -static inline int -m_mul_conform (const Matrix& a, const ComplexMatrix& b, int warn) -{ - int ac = a.columns (); - int br = b.rows (); - - int ok = (ac == br); - - if (! ok && warn) - gripe_nonconformant (a.rows (), ac, br, b.columns ()); - - return ok; -} - -static inline int -m_mul_conform (const ComplexMatrix& a, const Matrix& b, int warn) -{ - int ac = a.columns (); - int br = b.rows (); - - int ok = (ac == br); - - if (! ok && warn) - gripe_nonconformant (a.rows (), ac, br, b.columns ()); - - return ok; -} - -static inline int -m_mul_conform (const ComplexMatrix& a, const ComplexMatrix& b, int warn) -{ - int ac = a.columns (); - int br = b.rows (); - - int ok = (a.columns () == br); - - if (! ok && warn) - gripe_nonconformant (a.rows (), ac, br, b.columns ()); - - return ok; -} - // Stupid binary comparison operations like the ones Matlab provides. // One for each type combination, in the order given here: //
--- a/src/data.cc +++ b/src/data.cc @@ -45,7 +45,8 @@ #include "gripes.h" #include "help.h" #include "oct-map.h" -#include "pt-const.h" +#include "ov.h" +#include "variables.h" #include "oct-obj.h" #include "utils.h" @@ -794,7 +795,7 @@ if (args(0).is_map () && args(1).is_string ()) { string s = args(1).string_value (); - octave_value tmp = args(0).lookup_map_element (s, 0, 1); + octave_value tmp = args(0).struct_elt_val (s); retval = (double) tmp.is_defined (); } }
--- a/src/dirfns.cc +++ b/src/dirfns.cc @@ -345,8 +345,7 @@ } string directory = get_working_directory ("cd"); - octave_value *dir = new octave_value (directory); - bind_builtin_variable ("PWD", dir, 1); + bind_builtin_variable ("PWD", directory, 1); return retval; }
--- a/src/resource.cc +++ b/src/resource.cc @@ -53,7 +53,7 @@ #include "help.h" #include "oct-map.h" #include "sysdep.h" -#include "pt-const.h" +#include "ov.h" #include "oct-obj.h" #include "utils.h"