# HG changeset patch # User jwe # Date 845076725 0 # Node ID c90105b9947936cc0f2679a940eed7e41df03a3e # Parent 7c60f8a6e6a0f338eae4bc36f5113141dac4069d [project @ 1996-10-11 23:22:27 by jwe] diff --git a/src/arith-ops.cc b/src/arith-ops.cc --- 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: // diff --git a/src/data.cc b/src/data.cc --- 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 (); } } diff --git a/src/dirfns.cc b/src/dirfns.cc --- 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; } diff --git a/src/resource.cc b/src/resource.cc --- 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" diff --git a/src/strfns.cc b/src/strfns.cc --- a/src/strfns.cc +++ b/src/strfns.cc @@ -32,7 +32,7 @@ #include "error.h" #include "gripes.h" #include "help.h" -#include "pt-const.h" +#include "ov.h" #include "oct-obj.h" #include "utils.h" diff --git a/src/syscalls.cc b/src/syscalls.cc --- a/src/syscalls.cc +++ b/src/syscalls.cc @@ -53,6 +53,7 @@ #include "sysdep.h" #include "syswait.h" #include "utils.h" +#include "variables.h" static Octave_map mk_stat_map (const file_stat& fs)