Mercurial > hg > octave-avbm
changeset 2305:5a3f1d00a474
[project @ 1996-07-09 16:20:40 by jwe]
author | jwe |
---|---|
date | Tue, 09 Jul 1996 16:20:40 +0000 |
parents | 532542bd9493 |
children | 2fbf9bb1cd7a |
files | src/arith-ops.cc src/balance.cc src/dassl.cc src/data.cc src/filter.cc src/find.cc src/fsolve.cc src/load-save.cc src/log.cc src/lsode.cc src/minmax.cc src/npsol.cc src/oct-stream.cc src/pr-output.cc src/pt-const.cc src/pt-fvc.cc src/pt-plot.cc src/quad.cc src/rand.cc src/sighandlers.cc src/sort.cc src/syscalls.cc src/xdiv.cc src/xpow.cc |
diffstat | 24 files changed, 402 insertions(+), 402 deletions(-) [+] |
line wrap: on
line diff
--- a/src/arith-ops.cc +++ b/src/arith-ops.cc @@ -226,35 +226,35 @@ switch (op) { case Matrix_LT: - t.elem (i,j) = s < a.elem (i,j); + t (i,j) = s < a (i,j); break; case Matrix_LE: - t.elem (i,j) = s <= a.elem (i,j); + t (i,j) = s <= a (i,j); break; case Matrix_EQ: - t.elem (i,j) = s == a.elem (i,j); + t (i,j) = s == a (i,j); break; case Matrix_GE: - t.elem (i,j) = s >= a.elem (i,j); + t (i,j) = s >= a (i,j); break; case Matrix_GT: - t.elem (i,j) = s > a.elem (i,j); + t (i,j) = s > a (i,j); break; case Matrix_NE: - t.elem (i,j) = s != a.elem (i,j); + t (i,j) = s != a (i,j); break; case Matrix_AND: - t.elem (i,j) = s && a.elem (i,j); + t (i,j) = s && a (i,j); break; case Matrix_OR: - t.elem (i,j) = s || a.elem (i,j); + t (i,j) = s || a (i,j); break; default: @@ -289,35 +289,35 @@ switch (op) { case Matrix_LT: - t.elem (i,j) = s < real (a.elem (i,j)); + t (i,j) = s < real (a (i,j)); break; case Matrix_LE: - t.elem (i,j) = s <= real (a.elem (i,j)); + t (i,j) = s <= real (a (i,j)); break; case Matrix_EQ: - t.elem (i,j) = s == a.elem (i,j); + t (i,j) = s == a (i,j); break; case Matrix_GE: - t.elem (i,j) = s >= real (a.elem (i,j)); + t (i,j) = s >= real (a (i,j)); break; case Matrix_GT: - t.elem (i,j) = s > real (a.elem (i,j)); + t (i,j) = s > real (a (i,j)); break; case Matrix_NE: - t.elem (i,j) = s != a.elem (i,j); + t (i,j) = s != a (i,j); break; case Matrix_AND: - t.elem (i,j) = s && (a.elem (i,j) != 0.0); + t (i,j) = s && (a (i,j) != 0.0); break; case Matrix_OR: - t.elem (i,j) = s || (a.elem (i,j) != 0.0); + t (i,j) = s || (a (i,j) != 0.0); break; default: @@ -352,35 +352,35 @@ switch (op) { case Matrix_LT: - t.elem (i,j) = a.elem (i,j) < s; + t (i,j) = a (i,j) < s; break; case Matrix_LE: - t.elem (i,j) = a.elem (i,j) <= s; + t (i,j) = a (i,j) <= s; break; case Matrix_EQ: - t.elem (i,j) = a.elem (i,j) == s; + t (i,j) = a (i,j) == s; break; case Matrix_GE: - t.elem (i,j) = a.elem (i,j) >= s; + t (i,j) = a (i,j) >= s; break; case Matrix_GT: - t.elem (i,j) = a.elem (i,j) > s; + t (i,j) = a (i,j) > s; break; case Matrix_NE: - t.elem (i,j) = a.elem (i,j) != s; + t (i,j) = a (i,j) != s; break; case Matrix_AND: - t.elem (i,j) = a.elem (i,j) && s; + t (i,j) = a (i,j) && s; break; case Matrix_OR: - t.elem (i,j) = a.elem (i,j) || s; + t (i,j) = a (i,j) || s; break; default: @@ -415,35 +415,35 @@ switch (op) { case Matrix_LT: - t.elem (i,j) = a.elem (i,j) < real (s); + t (i,j) = a (i,j) < real (s); break; case Matrix_LE: - t.elem (i,j) = a.elem (i,j) <= real (s); + t (i,j) = a (i,j) <= real (s); break; case Matrix_EQ: - t.elem (i,j) = a.elem (i,j) == s; + t (i,j) = a (i,j) == s; break; case Matrix_GE: - t.elem (i,j) = a.elem (i,j) >= real (s); + t (i,j) = a (i,j) >= real (s); break; case Matrix_GT: - t.elem (i,j) = a.elem (i,j) > real (s); + t (i,j) = a (i,j) > real (s); break; case Matrix_NE: - t.elem (i,j) = a.elem (i,j) != s; + t (i,j) = a (i,j) != s; break; case Matrix_AND: - t.elem (i,j) = a.elem (i,j) && (s != 0.0); + t (i,j) = a (i,j) && (s != 0.0); break; case Matrix_OR: - t.elem (i,j) = a.elem (i,j) || (s != 0.0); + t (i,j) = a (i,j) || (s != 0.0); break; default: @@ -481,35 +481,35 @@ switch (op) { case Matrix_LT: - c.elem (i, j) = a.elem (i, j) < b.elem (i, j); + c (i, j) = a (i, j) < b (i, j); break; case Matrix_LE: - c.elem (i, j) = a.elem (i, j) <= b.elem (i, j); + c (i, j) = a (i, j) <= b (i, j); break; case Matrix_EQ: - c.elem (i, j) = a.elem (i, j) == b.elem (i, j); + c (i, j) = a (i, j) == b (i, j); break; case Matrix_GE: - c.elem (i, j) = a.elem (i, j) >= b.elem (i, j); + c (i, j) = a (i, j) >= b (i, j); break; case Matrix_GT: - c.elem (i, j) = a.elem (i, j) > b.elem (i, j); + c (i, j) = a (i, j) > b (i, j); break; case Matrix_NE: - c.elem (i, j) = a.elem (i, j) != b.elem (i, j); + c (i, j) = a (i, j) != b (i, j); break; case Matrix_AND: - c.elem (i, j) = a.elem (i, j) && b.elem (i, j); + c (i, j) = a (i, j) && b (i, j); break; case Matrix_OR: - c.elem (i, j) = a.elem (i, j) || b.elem (i, j); + c (i, j) = a (i, j) || b (i, j); break; default: @@ -547,35 +547,35 @@ switch (op) { case Matrix_LT: - c.elem (i, j) = a.elem (i, j) < real (b.elem (i, j)); + c (i, j) = a (i, j) < real (b (i, j)); break; case Matrix_LE: - c.elem (i, j) = a.elem (i, j) <= real (b.elem (i, j)); + c (i, j) = a (i, j) <= real (b (i, j)); break; case Matrix_EQ: - c.elem (i, j) = a.elem (i, j) == b.elem (i, j); + c (i, j) = a (i, j) == b (i, j); break; case Matrix_GE: - c.elem (i, j) = a.elem (i, j) >= real (b.elem (i, j)); + c (i, j) = a (i, j) >= real (b (i, j)); break; case Matrix_GT: - c.elem (i, j) = a.elem (i, j) > real (b.elem (i, j)); + c (i, j) = a (i, j) > real (b (i, j)); break; case Matrix_NE: - c.elem (i, j) = a.elem (i, j) != b.elem (i, j); + c (i, j) = a (i, j) != b (i, j); break; case Matrix_AND: - c.elem (i, j) = a.elem (i, j) && (b.elem (i, j) != 0.0); + c (i, j) = a (i, j) && (b (i, j) != 0.0); break; case Matrix_OR: - c.elem (i, j) = a.elem (i, j) || (b.elem (i, j) != 0.0); + c (i, j) = a (i, j) || (b (i, j) != 0.0); break; default: @@ -609,35 +609,35 @@ switch (op) { case Matrix_LT: - t.elem (i,j) = real (s) < a.elem (i,j); + t (i,j) = real (s) < a (i,j); break; case Matrix_LE: - t.elem (i,j) = real (s) <= a.elem (i,j); + t (i,j) = real (s) <= a (i,j); break; case Matrix_EQ: - t.elem (i,j) = s == a.elem (i,j); + t (i,j) = s == a (i,j); break; case Matrix_GE: - t.elem (i,j) = real (s) >= a.elem (i,j); + t (i,j) = real (s) >= a (i,j); break; case Matrix_GT: - t.elem (i,j) = real (s) > a.elem (i,j); + t (i,j) = real (s) > a (i,j); break; case Matrix_NE: - t.elem (i,j) = s != a.elem (i,j); + t (i,j) = s != a (i,j); break; case Matrix_AND: - t.elem (i,j) = (s != 0.0) && a.elem (i,j); + t (i,j) = (s != 0.0) && a (i,j); break; case Matrix_OR: - t.elem (i,j) = (s != 0.0) || a.elem (i,j); + t (i,j) = (s != 0.0) || a (i,j); break; default: @@ -672,35 +672,35 @@ switch (op) { case Matrix_LT: - t.elem (i,j) = real (s) < real (a.elem (i,j)); + t (i,j) = real (s) < real (a (i,j)); break; case Matrix_LE: - t.elem (i,j) = real (s) <= real (a.elem (i,j)); + t (i,j) = real (s) <= real (a (i,j)); break; case Matrix_EQ: - t.elem (i,j) = s == a.elem (i,j); + t (i,j) = s == a (i,j); break; case Matrix_GE: - t.elem (i,j) = real (s) >= real (a.elem (i,j)); + t (i,j) = real (s) >= real (a (i,j)); break; case Matrix_GT: - t.elem (i,j) = real (s) > real (a.elem (i,j)); + t (i,j) = real (s) > real (a (i,j)); break; case Matrix_NE: - t.elem (i,j) = s != a.elem (i,j); + t (i,j) = s != a (i,j); break; case Matrix_AND: - t.elem (i,j) = (s != 0.0) && (a.elem (i,j) != 0.0); + t (i,j) = (s != 0.0) && (a (i,j) != 0.0); break; case Matrix_OR: - t.elem (i,j) = (s != 0.0) || (a.elem (i,j) != 0.0); + t (i,j) = (s != 0.0) || (a (i,j) != 0.0); break; default: @@ -735,35 +735,35 @@ switch (op) { case Matrix_LT: - t.elem (i,j) = real (a.elem (i,j)) < s; + t (i,j) = real (a (i,j)) < s; break; case Matrix_LE: - t.elem (i,j) = real (a.elem (i,j)) <= s; + t (i,j) = real (a (i,j)) <= s; break; case Matrix_EQ: - t.elem (i,j) = a.elem (i,j) == s; + t (i,j) = a (i,j) == s; break; case Matrix_GE: - t.elem (i,j) = real (a.elem (i,j)) >= s; + t (i,j) = real (a (i,j)) >= s; break; case Matrix_GT: - t.elem (i,j) = real (a.elem (i,j)) > s; + t (i,j) = real (a (i,j)) > s; break; case Matrix_NE: - t.elem (i,j) = a.elem (i,j) != s; + t (i,j) = a (i,j) != s; break; case Matrix_AND: - t.elem (i,j) = (a.elem (i,j) != 0.0) && s; + t (i,j) = (a (i,j) != 0.0) && s; break; case Matrix_OR: - t.elem (i,j) = (a.elem (i,j) != 0.0) || s; + t (i,j) = (a (i,j) != 0.0) || s; break; default: @@ -798,35 +798,35 @@ switch (op) { case Matrix_LT: - t.elem (i,j) = real (a.elem (i,j)) < real (s); + t (i,j) = real (a (i,j)) < real (s); break; case Matrix_LE: - t.elem (i,j) = real (a.elem (i,j)) <= real (s); + t (i,j) = real (a (i,j)) <= real (s); break; case Matrix_EQ: - t.elem (i,j) = a.elem (i,j) == s; + t (i,j) = a (i,j) == s; break; case Matrix_GE: - t.elem (i,j) = real (a.elem (i,j)) >= real (s); + t (i,j) = real (a (i,j)) >= real (s); break; case Matrix_GT: - t.elem (i,j) = real (a.elem (i,j)) > real (s); + t (i,j) = real (a (i,j)) > real (s); break; case Matrix_NE: - t.elem (i,j) = a.elem (i,j) != s; + t (i,j) = a (i,j) != s; break; case Matrix_AND: - t.elem (i,j) = (a.elem (i,j) != 0.0) && (s != 0.0); + t (i,j) = (a (i,j) != 0.0) && (s != 0.0); break; case Matrix_OR: - t.elem (i,j) = (a.elem (i,j) != 0.0) || (s != 0.0); + t (i,j) = (a (i,j) != 0.0) || (s != 0.0); break; default: @@ -864,35 +864,35 @@ switch (op) { case Matrix_LT: - c.elem (i, j) = real (a.elem (i, j)) < b.elem (i, j); + c (i, j) = real (a (i, j)) < b (i, j); break; case Matrix_LE: - c.elem (i, j) = real (a.elem (i, j)) <= b.elem (i, j); + c (i, j) = real (a (i, j)) <= b (i, j); break; case Matrix_EQ: - c.elem (i, j) = a.elem (i, j) == b.elem (i, j); + c (i, j) = a (i, j) == b (i, j); break; case Matrix_GE: - c.elem (i, j) = real (a.elem (i, j)) >= b.elem (i, j); + c (i, j) = real (a (i, j)) >= b (i, j); break; case Matrix_GT: - c.elem (i, j) = real (a.elem (i, j)) > b.elem (i, j); + c (i, j) = real (a (i, j)) > b (i, j); break; case Matrix_NE: - c.elem (i, j) = a.elem (i, j) != b.elem (i, j); + c (i, j) = a (i, j) != b (i, j); break; case Matrix_AND: - c.elem (i, j) = (a.elem (i, j) != 0.0) && b.elem (i, j); + c (i, j) = (a (i, j) != 0.0) && b (i, j); break; case Matrix_OR: - c.elem (i, j) = (a.elem (i, j) != 0.0) || b.elem (i, j); + c (i, j) = (a (i, j) != 0.0) || b (i, j); break; default: @@ -930,35 +930,35 @@ switch (op) { case Matrix_LT: - c.elem (i, j) = real (a.elem (i, j)) < real (b.elem (i, j)); + c (i, j) = real (a (i, j)) < real (b (i, j)); break; case Matrix_LE: - c.elem (i, j) = real (a.elem (i, j)) <= real (b.elem (i, j)); + c (i, j) = real (a (i, j)) <= real (b (i, j)); break; case Matrix_EQ: - c.elem (i, j) = a.elem (i, j) == b.elem (i, j); + c (i, j) = a (i, j) == b (i, j); break; case Matrix_GE: - c.elem (i, j) = real (a.elem (i, j)) >= real (b.elem (i, j)); + c (i, j) = real (a (i, j)) >= real (b (i, j)); break; case Matrix_GT: - c.elem (i, j) = real (a.elem (i, j)) > real (b.elem (i, j)); + c (i, j) = real (a (i, j)) > real (b (i, j)); break; case Matrix_NE: - c.elem (i, j) = a.elem (i, j) != b.elem (i, j); + c (i, j) = a (i, j) != b (i, j); break; case Matrix_AND: - c.elem (i, j) = (a.elem (i, j) != 0.0) && (b.elem (i, j) != 0.0); + c (i, j) = (a (i, j) != 0.0) && (b (i, j) != 0.0); break; case Matrix_OR: - c.elem (i, j) = (a.elem (i, j) != 0.0) || (b.elem (i, j) != 0.0); + c (i, j) = (a (i, j) != 0.0) || (b (i, j) != 0.0); break; default:
--- a/src/balance.cc +++ b/src/balance.cc @@ -201,8 +201,8 @@ for (int i = 0; i < a_nr; i++) for (int j = 0; j < a_nc; j++) { - aa.elem (i, j) = abs (caa.elem (i, j)); - bb.elem (i, j) = abs (cbb.elem (i, j)); + aa (i, j) = abs (caa (i, j)); + bb (i, j) = abs (cbb (i, j)); } }
--- a/src/dassl.cc +++ b/src/dassl.cc @@ -62,8 +62,8 @@ Matrix m2 (nstates, 1); for (int i = 0; i < nstates; i++) { - m1 (i, 0) = x.elem (i); - m2 (i, 0) = xdot.elem (i); + m1 (i, 0) = x (i); + m2 (i, 0) = xdot (i); } octave_value state (m1); octave_value deriv (m2); @@ -72,8 +72,8 @@ } else { - double d1 = x.elem (0); - double d2 = xdot.elem (0); + double d1 = x (0); + double d2 = xdot (0); octave_value state (d1); octave_value deriv (d2); args(1) = deriv; @@ -174,7 +174,7 @@ return retval; } - double tzero = out_times.elem (0); + double tzero = out_times (0); DAEFunc func (dassl_user_function); DASSL dae (state, deriv, tzero, func);
--- a/src/data.cc +++ b/src/data.cc @@ -107,7 +107,7 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) - retval.elem (i, j) = f (x, y.elem (i, j)); + retval (i, j) = f (x, y (i, j)); return retval; } @@ -122,7 +122,7 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) - retval.elem (i, j) = f (x.elem (i, j), y); + retval (i, j) = f (x (i, j), y); return retval; } @@ -142,7 +142,7 @@ for (int j = 0; j < x_nc; j++) for (int i = 0; i < x_nr; i++) - retval.elem (i, j) = f (x.elem (i, j), y.elem (i, j)); + retval (i, j) = f (x (i, j), y (i, j)); return retval; } @@ -334,7 +334,7 @@ int n = nc + ABS (k); Matrix m (n, n, 0.0); for (int i = 0; i < nc; i++) - m.elem (i+roff, i+coff) = v.elem (0, i); + m (i+roff, i+coff) = v (0, i); retval = octave_value (m); } else @@ -342,7 +342,7 @@ int n = nr + ABS (k); Matrix m (n, n, 0.0); for (int i = 0; i < nr; i++) - m.elem (i+roff, i+coff) = v.elem (i, 0); + m (i+roff, i+coff) = v (i, 0); retval = octave_value (m); } @@ -376,7 +376,7 @@ int n = nc + ABS (k); ComplexMatrix m (n, n, 0.0); for (int i = 0; i < nc; i++) - m.elem (i+roff, i+coff) = v.elem (0, i); + m (i+roff, i+coff) = v (0, i); retval = octave_value (m); } else @@ -384,7 +384,7 @@ int n = nr + ABS (k); ComplexMatrix m (n, n, 0.0); for (int i = 0; i < nr; i++) - m.elem (i+roff, i+coff) = v.elem (i, 0); + m (i+roff, i+coff) = v (i, 0); retval = octave_value (m); } @@ -475,13 +475,13 @@ else if (k > 0) { Matrix m (n, n, 0.0); - m.elem (0, k) = d; + m (0, k) = d; retval = m; } else if (k < 0) { Matrix m (n, n, 0.0); - m.elem (-k, 0) = d; + m (-k, 0) = d; retval = m; } } @@ -516,13 +516,13 @@ else if (k > 0) { ComplexMatrix m (n, n, 0.0); - m.elem (0, k) = c; + m (0, k) = c; retval = m; } else if (k < 0) { ComplexMatrix m (n, n, 0.0); - m.elem (-k, 0) = c; + m (-k, 0) = c; retval = m; } } @@ -626,8 +626,8 @@ if (nargout == 0 || nargout == 1) { Matrix m (1, 2); - m.elem (0, 0) = nr; - m.elem (0, 1) = nc; + m (0, 0) = nr; + m (0, 1) = nc; retval = m; } else if (nargout == 2) @@ -845,8 +845,8 @@ if (error_state) return; - nr = NINT (v.elem (0)); - nc = NINT (v.elem (1)); + nr = NINT (v (0)); + nc = NINT (v (1)); } else warning ("%s (A): use %s (size (A)) instead", warn_for, warn_for); @@ -970,7 +970,7 @@ { int n = MIN (nr, nc); for (int i = 0; i < n; i++) - m.elem (i, i) = 1.0; + m (i, i) = 1.0; } return m; @@ -991,7 +991,7 @@ { int n = MIN (nr, nc); for (int i = 0; i < n; i++) - m.elem (i, i) = 1.0; + m (i, i) = 1.0; } return m;
--- a/src/filter.cc +++ b/src/filter.cc @@ -65,7 +65,7 @@ return y; } - T norm = a.elem (0); + T norm = a (0); if (norm == 0.0) { @@ -87,41 +87,41 @@ for (int i = 0; i < x_len; i++) { - y.elem (i) = si.elem (0) + b.elem (0) * x.elem (i); + y (i) = si (0) + b (0) * x (i); if (si_len > 1) { for (int j = 0; j < si_len - 1; j++) - si.elem (j) = si.elem (j+1) - a.elem (j+1) * y.elem (i) - + b.elem (j+1) * x.elem (i); + si (j) = si (j+1) - a (j+1) * y (i) + + b (j+1) * x (i); - si.elem (si_len-1) = b.elem (si_len) * x.elem (i) - - a.elem (si_len) * y.elem (i); + si (si_len-1) = b (si_len) * x (i) + - a (si_len) * y (i); } else - si.elem (0) = b.elem (si_len) * x.elem (i) - - a.elem (si_len) * y.elem (i); + si (0) = b (si_len) * x (i) + - a (si_len) * y (i); } } else if (si_len > 0) { for (int i = 0; i < x_len; i++) { - y.elem (i) = si.elem (0) + b.elem (0) * x.elem (i); + y (i) = si (0) + b (0) * x (i); if (si_len > 1) { for (int j = 0; j < si_len - 1; j++) - si.elem (j) = si.elem (j+1) + b.elem (j+1) * x.elem (i); + si (j) = si (j+1) + b (j+1) * x (i); - si.elem (si_len-1) = b.elem (si_len) * x.elem (i); + si (si_len-1) = b (si_len) * x (i); } else - si.elem (0) = b.elem (1) * x.elem (i); + si (0) = b (1) * x (i); } } else - y = b.elem (0) * x; + y = b (0) * x; return y; }
--- a/src/find.cc +++ b/src/find.cc @@ -87,7 +87,7 @@ int i, j; for (j = 0; j < m_nc; j++) for (i = 0; i < m_nr; i++) - if (m.elem (i, j) != 0.0) + if (m (i, j) != 0.0) count++; octave_value_list retval (((nargout == 0) ? 1 : nargout), Matrix ()); @@ -103,7 +103,7 @@ for (j = 0; j < m_nc; j++) for (i = 0; i < m_nr; i++) { - double d = m.elem (i, j); + double d = m (i, j); if (d != 0.0) { i_idx (count) = i + 1; @@ -127,7 +127,7 @@ int i, j; for (j = 0; j < m_nc; j++) for (i = 0; i < m_nr; i++) - if (m.elem (i, j) != 0.0) + if (m (i, j) != 0.0) count++; octave_value_list retval (((nargout == 0) ? 1 : nargout), Matrix ()); @@ -143,7 +143,7 @@ for (j = 0; j < m_nc; j++) for (i = 0; i < m_nr; i++) { - Complex c = m.elem (i, j); + Complex c = m (i, j); if (c != 0.0) { i_idx (count) = i + 1;
--- a/src/fsolve.cc +++ b/src/fsolve.cc @@ -92,13 +92,13 @@ { Matrix m (n, 1); for (int i = 0; i < n; i++) - m (i, 0) = x.elem (i); + m (i, 0) = x (i); octave_value vars (m); args(0) = vars; } else { - double d = x.elem (0); + double d = x (0); octave_value vars (d); args(0) = vars; }
--- a/src/load-save.cc +++ b/src/load-save.cc @@ -1145,7 +1145,7 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) - ctmp.elem (i, j) = Complex (re.elem (i, j), im.elem (i, j)); + ctmp (i, j) = Complex (re (i, j), im (i, j)); tc = ctmp; } @@ -1823,11 +1823,11 @@ { for (int j = 0; j < nc; j++) { - double d = m.elem (i, j); + double d = m (i, j); if (xisnan (d)) goto next_row; else - retval.elem (k, j) = xisinf (d) ? (d > 0 ? OCT_RBV : -OCT_RBV) : d; + retval (k, j) = xisinf (d) ? (d > 0 ? OCT_RBV : -OCT_RBV) : d; } k++; @@ -1854,7 +1854,7 @@ { for (int j = 0; j < nc; j++) { - Complex c = m.elem (i, j); + Complex c = m (i, j); if (xisnan (c)) goto next_row; else @@ -1865,7 +1865,7 @@ re = xisinf (re) ? (re > 0 ? OCT_RBV : -OCT_RBV) : re; im = xisinf (im) ? (im > 0 ? OCT_RBV : -OCT_RBV) : im; - retval.elem (k, j) = Complex (re, im); + retval (k, j) = Complex (re, im); } } k++;
--- a/src/log.cc +++ b/src/log.cc @@ -93,11 +93,11 @@ for (int i = 0; i < nr; i++) { - Complex elt = lambda.elem (i); + Complex elt = lambda (i); if (imag (elt) == 0.0 && real (elt) > 0.0) - lambda.elem (i) = log (real (elt)); + lambda (i) = log (real (elt)); else - lambda.elem (i) = log (elt); + lambda (i) = log (elt); } ComplexDiagMatrix D (lambda); @@ -126,11 +126,11 @@ for (int i = 0; i < nr; i++) { - Complex elt = lambda.elem (i); + Complex elt = lambda (i); if (imag (elt) == 0.0 && real (elt) > 0.0) - lambda.elem (i) = log (real (elt)); + lambda (i) = log (real (elt)); else - lambda.elem (i) = log (elt); + lambda (i) = log (elt); } ComplexDiagMatrix D (lambda); @@ -205,11 +205,11 @@ for (int i = 0; i < nr; i++) { - Complex elt = lambda.elem (i); + Complex elt = lambda (i); if (imag (elt) == 0.0 && real (elt) > 0.0) - lambda.elem (i) = sqrt (real (elt)); + lambda (i) = sqrt (real (elt)); else - lambda.elem (i) = sqrt (elt); + lambda (i) = sqrt (elt); } ComplexDiagMatrix D (lambda); @@ -238,11 +238,11 @@ for (int i = 0; i < nr; i++) { - Complex elt = lambda.elem (i); + Complex elt = lambda (i); if (imag (elt) == 0.0 && real (elt) > 0.0) - lambda.elem (i) = sqrt (real (elt)); + lambda (i) = sqrt (real (elt)); else - lambda.elem (i) = sqrt (elt); + lambda (i) = sqrt (elt); } ComplexDiagMatrix D (lambda);
--- a/src/lsode.cc +++ b/src/lsode.cc @@ -58,13 +58,13 @@ { Matrix m (nstates, 1); for (int i = 0; i < nstates; i++) - m (i, 0) = x.elem (i); + m (i, 0) = x (i); octave_value state (m); args(0) = state; } else { - double d = x.elem (0); + double d = x (0); octave_value state (d); args(0) = state; } @@ -149,7 +149,7 @@ crit_times_set = 1; } - double tzero = out_times.elem (0); + double tzero = out_times (0); int nsteps = out_times.capacity (); ODEFunc func (lsode_user_function);
--- a/src/minmax.cc +++ b/src/minmax.cc @@ -54,8 +54,8 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) { - double m_elem = m.elem (i, j); - result.elem (i, j) = MIN (d, m_elem); + double m_elem = m (i, j); + result (i, j) = MIN (d, m_elem); } return result; @@ -72,8 +72,8 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) { - double m_elem = m.elem (i, j); - result.elem (i, j) = MIN (m_elem, d); + double m_elem = m (i, j); + result (i, j) = MIN (m_elem, d); } return result; @@ -93,11 +93,11 @@ { for (int i = 0; i < nr; i++) { - double abs_m_elem = abs (m.elem (i, j)); + double abs_m_elem = abs (m (i, j)); if (abs_c < abs_m_elem) - result.elem (i, j) = c; + result (i, j) = c; else - result.elem (i, j) = m.elem (i, j); + result (i, j) = m (i, j); } } @@ -117,11 +117,11 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) { - double abs_m_elem = abs (m.elem (i, j)); + double abs_m_elem = abs (m (i, j)); if (abs_m_elem < abs_c) - result.elem (i, j) = m.elem (i, j); + result (i, j) = m (i, j); else - result.elem (i, j) = c; + result (i, j) = c; } return result; @@ -143,9 +143,9 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) { - double a_elem = a.elem (i, j); - double b_elem = b.elem (i, j); - result.elem (i, j) = MIN (a_elem, b_elem); + double a_elem = a (i, j); + double b_elem = b (i, j); + result (i, j) = MIN (a_elem, b_elem); } return result; @@ -168,7 +168,7 @@ { int columns_are_real_only = 1; for (int i = 0; i < nr; i++) - if (imag (a.elem (i, j)) != 0.0 && imag (b.elem (i, j)) != 0.0) + if (imag (a (i, j)) != 0.0 && imag (b (i, j)) != 0.0) { columns_are_real_only = 0; break; @@ -178,24 +178,24 @@ { for (int i = 0; i < nr; i++) { - double a_elem = real (a.elem (i, j)); - double b_elem = real (b.elem (i, j)); + double a_elem = real (a (i, j)); + double b_elem = real (b (i, j)); if (a_elem < b_elem) - result.elem (i, j) = a_elem; + result (i, j) = a_elem; else - result.elem (i, j) = b_elem; + result (i, j) = b_elem; } } else { for (int i = 0; i < nr; i++) { - double abs_a_elem = abs (a.elem (i, j)); - double abs_b_elem = abs (b.elem (i, j)); + double abs_a_elem = abs (a (i, j)); + double abs_b_elem = abs (b (i, j)); if (abs_a_elem < abs_b_elem) - result.elem (i, j) = a.elem (i, j); + result (i, j) = a (i, j); else - result.elem (i, j) = b.elem (i, j); + result (i, j) = b (i, j); } } } @@ -214,8 +214,8 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) { - double m_elem = m.elem (i, j); - result.elem (i, j) = MAX (d, m_elem); + double m_elem = m (i, j); + result (i, j) = MAX (d, m_elem); } return result; @@ -232,8 +232,8 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) { - double m_elem = m.elem (i, j); - result.elem (i, j) = MAX (m_elem, d); + double m_elem = m (i, j); + result (i, j) = MAX (m_elem, d); } return result; @@ -252,11 +252,11 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) { - double abs_m_elem = abs (m.elem (i, j)); + double abs_m_elem = abs (m (i, j)); if (abs_c > abs_m_elem) - result.elem (i, j) = c; + result (i, j) = c; else - result.elem (i, j) = m.elem (i, j); + result (i, j) = m (i, j); } return result; @@ -275,11 +275,11 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) { - double abs_m_elem = abs (m.elem (i, j)); + double abs_m_elem = abs (m (i, j)); if (abs_m_elem > abs_c) - result.elem (i, j) = m.elem (i, j); + result (i, j) = m (i, j); else - result.elem (i, j) = c; + result (i, j) = c; } return result; @@ -301,9 +301,9 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) { - double a_elem = a.elem (i, j); - double b_elem = b.elem (i, j); - result.elem (i, j) = MAX (a_elem, b_elem); + double a_elem = a (i, j); + double b_elem = b (i, j); + result (i, j) = MAX (a_elem, b_elem); } return result; @@ -326,7 +326,7 @@ { int columns_are_real_only = 1; for (int i = 0; i < nr; i++) - if (imag (a.elem (i, j)) != 0.0 && imag (b.elem (i, j)) != 0.0) + if (imag (a (i, j)) != 0.0 && imag (b (i, j)) != 0.0) { columns_are_real_only = 0; break; @@ -336,24 +336,24 @@ { for (int i = 0; i < nr; i++) { - double a_elem = real (a.elem (i, j)); - double b_elem = real (b.elem (i, j)); + double a_elem = real (a (i, j)); + double b_elem = real (b (i, j)); if (a_elem > b_elem) - result.elem (i, j) = a_elem; + result (i, j) = a_elem; else - result.elem (i, j) = b_elem; + result (i, j) = b_elem; } } else { for (int i = 0; i < nr; i++) { - double abs_a_elem = abs (a.elem (i, j)); - double abs_b_elem = abs (b.elem (i, j)); + double abs_a_elem = abs (a (i, j)); + double abs_b_elem = abs (b (i, j)); if (abs_a_elem > abs_b_elem) - result.elem (i, j) = a.elem (i, j); + result (i, j) = a (i, j); else - result.elem (i, j) = b.elem (i, j); + result (i, j) = b (i, j); } } }
--- a/src/npsol.cc +++ b/src/npsol.cc @@ -58,12 +58,12 @@ { Matrix m (n, 1); for (int i = 0; i < n; i++) - m (i, 0) = x.elem (i); + m (i, 0) = x (i); decision_vars = m; } else { - double d = x.elem (0); + double d = x (0); decision_vars = d; } @@ -99,7 +99,7 @@ { Matrix m = objective_value.matrix_value (); if (m.rows () == 1 && m.columns () == 1) - retval = m.elem (0, 0); + retval = m (0, 0); else { gripe_user_returned_invalid ("npsol_objective"); @@ -131,12 +131,12 @@ { Matrix m (n, 1); for (int i = 0; i < n; i++) - m (i, 0) = x.elem (i); + m (i, 0) = x (i); decision_vars = m; } else { - double d = x.elem (0); + double d = x (0); decision_vars = d; }
--- a/src/oct-stream.cc +++ b/src/oct-stream.cc @@ -114,19 +114,19 @@ if (size.rows () == 1 && size.cols () > 0) { - dnr = size.elem (0, 0); + dnr = size (0, 0); if (size.cols () == 2) - dnc = size.elem (0, 1); + dnc = size (0, 1); else if (size.cols () > 2) ::error ("%s: invalid size specification", warn_for); } else if (size.cols () == 1 && size.rows () > 0) { - dnr = size.elem (0, 0); + dnr = size (0, 0); if (size.rows () == 2) - dnc = size.elem (1, 0); + dnc = size (1, 0); else if (size.rows () > 2) ::error ("%s: invalid size specification", warn_for); } @@ -201,7 +201,7 @@ for (int i = 0; i < n; i++) { - scanf_format_elt *elt = list.elem (i); + scanf_format_elt *elt = list (i); delete elt; } } @@ -226,7 +226,7 @@ if (num_elts == list.length ()) list.resize (2 * num_elts); - list.elem (num_elts++) = elt; + list (num_elts++) = elt; } else delete [] text; @@ -395,7 +395,7 @@ for (int i = 0; i < n; i++) { - scanf_format_elt *elt = list.elem (i); + scanf_format_elt *elt = list (i); cerr << elt->width << "\t" << elt->discard << "\t" @@ -414,7 +414,7 @@ { for (int i = 0; i < n; i++) { - scanf_format_elt *elt = list.elem (i); + scanf_format_elt *elt = list (i); switch (elt->type) { @@ -442,7 +442,7 @@ { for (int i = 0; i < n; i++) { - scanf_format_elt *elt = list.elem (i); + scanf_format_elt *elt = list (i); switch (elt->type) { @@ -522,7 +522,7 @@ for (int i = 0; i < n; i++) { - printf_format_elt *elt = list.elem (i); + printf_format_elt *elt = list (i); delete elt; } } @@ -547,7 +547,7 @@ if (num_elts == list.length ()) list.resize (2 * num_elts); - list.elem (num_elts++) = elt; + list (num_elts++) = elt; } else delete [] text; @@ -706,7 +706,7 @@ for (int i = 0; i < n; i++) { - printf_format_elt *elt = list.elem (i); + printf_format_elt *elt = list (i); cerr << elt->args<< "\t" << elt->type << "\t" @@ -2669,11 +2669,11 @@ for (int i = 0; i < curr_len; i++) { - octave_stream *tmp = list.elem (i); + octave_stream *tmp = list (i); if (! tmp) { - list.elem (i) = os; + list (i) = os; retval = i; break; } @@ -2686,7 +2686,7 @@ if (curr_len == total_len) list.resize (total_len * 2); - list.elem (curr_len) = os; + list (curr_len) = os; retval = curr_len; curr_len++; } @@ -2719,7 +2719,7 @@ octave_stream *retval = 0; if (fid >= 0 && fid < curr_len) - retval = list.elem (fid); + retval = list (fid); return retval; } @@ -2768,12 +2768,12 @@ if (fid > 2 && fid < curr_len) { - octave_stream *os = list.elem (fid); + octave_stream *os = list (fid); if (os) { delete os; - list.elem (fid) = 0; + list (fid) = 0; retval = 0; } } @@ -2821,18 +2821,18 @@ { // Do flush stdout and stderr. - list.elem (0) -> flush (); - list.elem (1) -> flush (); + list (0) -> flush (); + list (1) -> flush (); // But don't delete them or stdin. for (int i = 3; i < curr_len; i++) { - octave_stream *os = list.elem (i); + octave_stream *os = list (i); delete os; - list.elem (i) = 0; + list (i) = 0; } } @@ -2918,7 +2918,7 @@ for (int i = 0; i < curr_len; i++) { - octave_stream *os = list.elem (i); + octave_stream *os = list (i); if (os) { @@ -2964,7 +2964,7 @@ for (int i = 3; i < curr_len; i++) { - if (list.elem (i)) + if (list (i)) retval (0, num_open++) = i; } @@ -2997,7 +2997,7 @@ for (int i = 3; i < curr_len; i++) { - octave_stream *os = list.elem (i); + octave_stream *os = list (i); if (os && os->name () == nm) {
--- a/src/pr-output.cc +++ b/src/pr-output.cc @@ -108,7 +108,7 @@ int nc = a.columns (); for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) - if (a.elem (i, j) < 0.0) + if (a (i, j) < 0.0) return 1; return 0; } @@ -123,7 +123,7 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) { - double val = a.elem (i, j); + double val = a (i, j); if (xisinf (val) || xisnan (val)) return 1; } @@ -138,7 +138,7 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) { - Complex val = a.elem (i, j); + Complex val = a (i, j); if (xisinf (val) || xisnan (val)) return 1; } @@ -153,7 +153,7 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) { - double val = a.elem (i, j); + double val = a (i, j); if (xisnan (val) || D_NINT (val) == val) continue; else @@ -170,7 +170,7 @@ Matrix retval (nr, nc); for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) - retval.elem (i, j) = fabs (a.elem (i, j)); + retval (i, j) = fabs (a (i, j)); return retval; } @@ -185,7 +185,7 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) { - double val = m.elem (i, j); + double val = m (i, j); if (xisinf (val) || xisnan (val)) continue; @@ -206,7 +206,7 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) { - double val = m.elem (i, j); + double val = m (i, j); if (xisinf (val) || xisnan (val)) continue; @@ -1191,7 +1191,7 @@ if (j == 0) os << " "; - if (m.elem (i, j) == 0.0) + if (m (i, j) == 0.0) os << " "; else os << "+"; @@ -1257,7 +1257,7 @@ os << " "; } - pr_float (os, m.elem (i, j)); + pr_float (os, m (i, j)); } col += inc; @@ -1291,7 +1291,7 @@ { os << " "; - pr_float (os, m.elem (i, j), fw); + pr_float (os, m (i, j), fw); } os << "\n"; @@ -1343,7 +1343,7 @@ if (j == 0) os << " "; - if (cm.elem (i, j) == 0.0) + if (cm (i, j) == 0.0) os << " "; else os << "+"; @@ -1410,7 +1410,7 @@ os << " "; } - pr_complex (os, cm.elem (i, j)); + pr_complex (os, cm (i, j)); } col += inc; @@ -1444,7 +1444,7 @@ { os << " "; - pr_complex (os, cm.elem (i, j)); + pr_complex (os, cm (i, j)); } os << "\n"; }
--- a/src/pt-const.cc +++ b/src/pt-const.cc @@ -162,7 +162,7 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) - if (imag (a.elem (i, j)) != 0.0) + if (imag (a (i, j)) != 0.0) return true; return false; @@ -485,7 +485,7 @@ { if (m.rows () == 1 && m.columns () == 1) { - scalar = m.elem (0, 0); + scalar = m (0, 0); type_tag = scalar_constant; } else @@ -499,7 +499,7 @@ { if (d.rows () == 1 && d.columns () == 1) { - scalar = d.elem (0, 0); + scalar = d (0, 0); type_tag = scalar_constant; } else @@ -514,7 +514,7 @@ int len = v.capacity (); if (len == 1) { - scalar = v.elem (0); + scalar = v (0); type_tag = scalar_constant; } else @@ -527,7 +527,7 @@ { Matrix m (len, 1); for (int i = 0; i < len; i++) - m.elem (i, 0) = v.elem (i); + m (i, 0) = v (i); matrix = new Matrix (m); type_tag = matrix_constant; } @@ -535,7 +535,7 @@ { Matrix m (1, len); for (int i = 0; i < len; i++) - m.elem (0, i) = v.elem (i); + m (0, i) = v (i); matrix = new Matrix (m); type_tag = matrix_constant; } @@ -547,7 +547,7 @@ int len = v.capacity (); if (len == 1) { - scalar = v.elem (0); + scalar = v (0); type_tag = scalar_constant; } else @@ -560,7 +560,7 @@ { Matrix m (len, 1); for (int i = 0; i < len; i++) - m.elem (i, 0) = v.elem (i); + m (i, 0) = v (i); matrix = new Matrix (m); type_tag = matrix_constant; } @@ -568,7 +568,7 @@ { Matrix m (1, len); for (int i = 0; i < len; i++) - m.elem (0, i) = v.elem (i); + m (0, i) = v (i); matrix = new Matrix (m); type_tag = matrix_constant; } @@ -593,7 +593,7 @@ { if (m.rows () == 1 && m.columns () == 1) { - Complex c = m.elem (0, 0); + Complex c = m (0, 0); if (::imag (c) == 0.0) { @@ -617,7 +617,7 @@ { if (d.rows () == 1 && d.columns () == 1) { - Complex c = d.elem (0, 0); + Complex c = d (0, 0); if (::imag (c) == 0.0) { @@ -643,7 +643,7 @@ int len = v.capacity (); if (len == 1) { - Complex c = v.elem (0); + Complex c = v (0); if (::imag (c) == 0.0) { @@ -666,7 +666,7 @@ { ComplexMatrix m (len, 1); for (int i = 0; i < len; i++) - m.elem (i, 0) = v.elem (i); + m (i, 0) = v (i); complex_matrix = new ComplexMatrix (m); type_tag = complex_matrix_constant; } @@ -674,7 +674,7 @@ { ComplexMatrix m (1, len); for (int i = 0; i < len; i++) - m.elem (0, i) = v.elem (i); + m (0, i) = v (i); complex_matrix = new ComplexMatrix (m); type_tag = complex_matrix_constant; } @@ -687,7 +687,7 @@ int len = v.capacity (); if (len == 1) { - Complex c = v.elem (0); + Complex c = v (0); if (::imag (c) == 0.0) { @@ -710,7 +710,7 @@ { ComplexMatrix m (len, 1); for (int i = 0; i < len; i++) - m.elem (i, 0) = v.elem (i); + m (i, 0) = v (i); complex_matrix = new ComplexMatrix (m); type_tag = complex_matrix_constant; } @@ -718,7 +718,7 @@ { ComplexMatrix m (1, len); for (int i = 0; i < len; i++) - m.elem (0, i) = v.elem (i); + m (0, i) = v (i); complex_matrix = new ComplexMatrix (m); type_tag = complex_matrix_constant; } @@ -746,7 +746,7 @@ { nc = s[i].length (); for (int j = 0; j < nc; j++) - char_matrix->elem (i, j) = s[i][j]; + (*char_matrix) (i, j) = s[i][j]; } type_tag = char_matrix_constant_str; } @@ -1161,7 +1161,7 @@ Matrix m = (matrix->all ()) . all (); retval = (m.rows () == 1 && m.columns () == 1 - && m.elem (0, 0) != 0.0); + && m (0, 0) != 0.0); } break; @@ -1174,7 +1174,7 @@ Matrix m = (complex_matrix->all ()) . all (); retval = (m.rows () == 1 && m.columns () == 1 - && m.elem (0, 0) != 0.0); + && m (0, 0) != 0.0); } break; @@ -1208,7 +1208,7 @@ case matrix_constant: { if (Vdo_fortran_indexing && rows () > 0 && columns () > 0) - retval = matrix->elem (0, 0); + retval = (*matrix) (0, 0); else gripe_invalid_conversion ("real matrix", "real scalar"); } @@ -1230,7 +1230,7 @@ { if (Vdo_fortran_indexing && rows () > 0 && columns () > 0) - retval = ::real (complex_matrix->elem (0, 0)); + retval = ::real ((*complex_matrix) (0, 0)); else gripe_invalid_conversion ("complex matrix", "real scalar"); } @@ -1247,7 +1247,7 @@ int len = char_matrix->rows (); if ((char_matrix->rows () == 1 && len == 1) || (len > 1 && Vdo_fortran_indexing)) - retval = toascii ((int) char_matrix->elem (0, 0)); + retval = toascii ((int) (*char_matrix) (0, 0)); else gripe_invalid_conversion ("char matrix", "real scalar"); } @@ -1266,7 +1266,7 @@ if (flag && ((char_matrix->rows () == 1 && len == 1) || (len > 1 && Vdo_fortran_indexing))) - retval = toascii ((int) char_matrix->elem (0, 0)); + retval = toascii ((int) (*char_matrix) (0, 0)); else gripe_invalid_conversion ("string", "real scalar"); } @@ -1379,9 +1379,9 @@ if (Vdo_fortran_indexing && rows () > 0 && columns () > 0) { if (type_tag == complex_matrix_constant) - retval = complex_matrix->elem (0, 0); + retval = (*complex_matrix) (0, 0); else - retval = matrix->elem (0, 0); + retval = (*matrix) (0, 0); } else gripe_invalid_conversion ("real matrix", "real scalar"); @@ -1393,7 +1393,7 @@ int len = char_matrix->cols (); if ((char_matrix->rows () == 1 && len == 1) || (len > 1 && Vdo_fortran_indexing)) - retval = toascii ((int) char_matrix->elem (0, 0)); + retval = toascii ((int) (*char_matrix) (0, 0)); else gripe_invalid_conversion ("char matrix", "complex scalar"); } @@ -1412,7 +1412,7 @@ if (flag && ((char_matrix->rows () == 1 && len == 1) || (len > 1 && Vdo_fortran_indexing))) - retval = toascii ((int) char_matrix->elem (0, 0)); + retval = toascii ((int) (*char_matrix) (0, 0)); else gripe_invalid_conversion ("string", "complex scalar"); } @@ -1599,13 +1599,13 @@ { retval.resize (nc); for (int i = 0; i < nc; i++) - retval.elem (i) = m (0, i); + retval (i) = m (0, i); } else if (nc == 1) { retval.resize (nr); for (int i = 0; i < nr; i++) - retval.elem (i) = m.elem (i, 0); + retval (i) = m (i, 0); } else if (nr > 0 && nc > 0 && (Vdo_fortran_indexing || force_vector_conversion)) @@ -1614,7 +1614,7 @@ int k = 0; for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) - retval.elem (k++) = m.elem (i, j); + retval (k++) = m (i, j); } else gripe_invalid_conversion ("real matrix", "real vector"); @@ -1643,13 +1643,13 @@ { retval.resize (nc); for (int i = 0; i < nc; i++) - retval.elem (i) = m (0, i); + retval (i) = m (0, i); } else if (nc == 1) { retval.resize (nr); for (int i = 0; i < nr; i++) - retval.elem (i) = m.elem (i, 0); + retval (i) = m (i, 0); } else if (nr > 0 && nc > 0 && (Vdo_fortran_indexing || force_vector_conversion)) @@ -1658,7 +1658,7 @@ int k = 0; for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) - retval.elem (k++) = m.elem (i, j); + retval (k++) = m (i, j); } else gripe_invalid_conversion ("complex matrix", "complex vector"); @@ -1724,7 +1724,7 @@ { for (int i = 0; i < nr; i++) { - double d = m.elem (i, j); + double d = m (i, j); if (xisnan (d)) { @@ -1737,7 +1737,7 @@ // range conversions? int ival = NINT (d); - chm.elem (i, j) = (char) ival; + chm (i, j) = (char) ival; } } } @@ -1828,9 +1828,9 @@ for (int i = 0; i < len; i++) { if (new_nr == 1) - m->elem (0, i) = *cop_out++; + (*m) (0, i) = *cop_out++; else - m->elem (i, 0) = *cop_out++; + (*m) (i, 0) = *cop_out++; } delete matrix; @@ -1845,9 +1845,9 @@ for (int i = 0; i < len; i++) { if (new_nr == 1) - cm->elem (0, i) = *cop_out++; + (*cm) (0, i) = *cop_out++; else - cm->elem (i, 0) = *cop_out++; + (*cm) (i, 0) = *cop_out++; } delete complex_matrix; @@ -1951,7 +1951,7 @@ if (nr == 1 && nc == 1) { type_tag = scalar_constant; - double tmp = toascii ((int) char_matrix->elem (0, 0)); + double tmp = toascii ((int) (*char_matrix) (0, 0)); delete char_matrix; scalar = tmp; } @@ -1971,8 +1971,8 @@ { for (int j = 0; j < nc; j++) { - int c = (int) char_matrix->elem (i, j); - tm->elem (i, j) = toascii (c); + int c = (int) (*char_matrix) (i, j); + (*tm) (i, j) = toascii (c); } } delete char_matrix; @@ -1993,7 +1993,7 @@ double b = range->base (); double increment = range->inc (); for (int i = 0; i < len; i++) - tm->elem (0, i) = b + i * increment; + (*tm) (0, i) = b + i * increment; delete range; matrix = tm; } @@ -2223,7 +2223,7 @@ case matrix_constant: if (nr == 1 && nc == 1) { - double d = matrix->elem (0, 0); + double d = (*matrix) (0, 0); delete matrix; scalar = d; type_tag = scalar_constant; @@ -2233,7 +2233,7 @@ case complex_matrix_constant: if (nr == 1 && nc == 1) { - Complex c = complex_matrix->elem (0, 0); + Complex c = (*complex_matrix) (0, 0); delete complex_matrix; complex_scalar = new Complex (c); type_tag = complex_scalar_constant;
--- a/src/pt-fvc.cc +++ b/src/pt-fvc.cc @@ -54,7 +54,7 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) - if (a.elem (i, j) < val) + if (a (i, j) < val) return true; return false; @@ -68,7 +68,7 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) - if (a.elem (i, j) > val) + if (a (i, j) > val) return true; return false; @@ -669,8 +669,8 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) - result.elem (i, j) - = (*m_fcn.ch_mapper) (chm.elem (i, j)) ? 1 : 0; + result (i, j) + = (*m_fcn.ch_mapper) (chm (i, j)) ? 1 : 0; retval = result; } @@ -682,8 +682,8 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) - result.elem (i, j) - = (*m_fcn.ch_mapper) (chm.elem (i, j)); + result (i, j) + = (*m_fcn.ch_mapper) (chm (i, j)); retval = result; } @@ -695,8 +695,8 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) - result.elem (i, j) - = (*m_fcn.ch_mapper) (chm.elem (i, j)); + result (i, j) + = (*m_fcn.ch_mapper) (chm (i, j)); retval = octave_value (result, true); }
--- a/src/pt-plot.cc +++ b/src/pt-plot.cc @@ -479,7 +479,7 @@ return -1; } else - val.elem (i) = n; + val (i) = n; } else return -1; @@ -520,7 +520,7 @@ else plot_buf << ":"; - plot_buf << val.elem (i); + plot_buf << val (i); } return 0;
--- a/src/quad.cc +++ b/src/quad.cc @@ -196,10 +196,10 @@ switch (tol.capacity ()) { case 2: - reltol = tol.elem (1); + reltol = tol (1); case 1: - abstol = tol.elem (0); + abstol = tol (0); break; default:
--- a/src/rand.cc +++ b/src/rand.cc @@ -234,13 +234,13 @@ if (n == 1 && m == 2) { - n = NINT (a.elem (0, 0)); - m = NINT (a.elem (0, 1)); + n = NINT (a (0, 0)); + m = NINT (a (0, 1)); } else if (n == 2 && m == 1) { - n = NINT (a.elem (0, 0)); - m = NINT (a.elem (1, 0)); + n = NINT (a (0, 0)); + m = NINT (a (1, 0)); } else warning ("rand (A): use rand (size (A)) instead"); @@ -308,12 +308,12 @@ { case uniform_dist: F77_FCN (dgenunf, DGENUNF) (0.0, 1.0, val); - rand_mat.elem (i, j) = val; + rand_mat (i, j) = val; break; case normal_dist: F77_FCN (dgennor, DGENNOR) (0.0, 1.0, val); - rand_mat.elem (i, j) = val; + rand_mat (i, j) = val; break; default:
--- a/src/sighandlers.cc +++ b/src/sighandlers.cc @@ -464,11 +464,11 @@ for (int i = 0; i < curr_len; i++) { - octave_child& tmp = list.elem (i); + octave_child& tmp = list (i); if (tmp.pid < 0) { - list.elem (i) = octave_child (pid, f); + list (i) = octave_child (pid, f); enlarge = false; break; } @@ -486,7 +486,7 @@ list.resize (total_len * 2); } - list.elem (curr_len) = octave_child (pid, f); + list (curr_len) = octave_child (pid, f); curr_len++; } } @@ -512,7 +512,7 @@ for (int i = 0; i < curr_len; i++) { - octave_child& tmp = list.elem (i); + octave_child& tmp = list (i); if (tmp.pid == pid) {
--- a/src/sort.cc +++ b/src/sort.cc @@ -43,14 +43,14 @@ { Array<int> l (n+2); - l.elem (0) = 1; + l (0) = 1; for (int i = 1; i < n - 1; i++) - l.elem (i) = -(i+2); + l (i) = -(i+2); - l.elem (n-1) = 0; - l.elem (n) = 0; - l.elem (n+1) = 2; + l (n-1) = 0; + l (n) = 0; + l (n+1) = 2; return l; } @@ -58,8 +58,8 @@ #define SORT_INIT_PHASE(n) \ int s = 0; \ int t = n + 1; \ - int p = l.elem (s); \ - int q = l.elem (t); \ + int p = l (s); \ + int q = l (t); \ if (q == 0) \ break @@ -68,46 +68,46 @@ q = -q; \ if (q == 0) \ { \ - l.elem (s) = (l.elem (s) < 0) \ + l (s) = (l (s) < 0) \ ? ((p < 0) ? p : -p) \ : ((p >= 0) ? p : -p); \ - l.elem (t) = 0; \ + l (t) = 0; \ break; \ } \ #define SORT_REORDER_PHASE_ONE \ - l.elem (s) = (l.elem (s) < 0) \ + l (s) = (l (s) < 0) \ ? ((q < 0) ? q : -q) \ : ((q >= 0) ? q : -q); \ s = q; \ - q = l.elem (q); \ + q = l (q); \ if (q <= 0) \ { \ - l.elem (s) = p; \ + l (s) = p; \ s = t; \ do \ { \ t = p; \ - p = l.elem (p); \ + p = l (p); \ } \ while (p > 0); \ SORT_COMMON_CODE; \ } \ #define SORT_REORDER_PHASE_TWO \ - l.elem (s) = (l.elem (s) < 0) \ + l (s) = (l (s) < 0) \ ? ((p < 0) ? p : -p) \ : ((p >= 0) ? p : -p); \ s = p; \ - p = l.elem (p); \ + p = l (p); \ if (p <= 0) \ { \ - l.elem (s) = q; \ + l (s) = q; \ s = t; \ do \ { \ t = q; \ - q = l.elem (q); \ + q = l (q); \ } \ while (q > 0); \ SORT_COMMON_CODE; \ @@ -131,25 +131,25 @@ } #define VECTOR_CREATE_RETURN_VALUES(vs, v) \ - int k = l.elem (0); \ - idx.elem (0) = k; \ - vs.elem (0) = v.elem (k-1); \ + int k = l (0); \ + idx (0) = k; \ + vs (0) = v (k-1); \ for (int i = 1; i < n; i++) \ { \ - k = l.elem ((int) idx.elem (i-1)); \ - idx.elem (i) = k; \ - vs.elem (i) = v.elem (k-1); \ + k = l ((int) idx (i-1)); \ + idx (i) = k; \ + vs (i) = v (k-1); \ } #define MATRIX_CREATE_RETURN_VALUES(ms, m) \ - int k = l.elem (0); \ - idx.elem (0, j) = k; \ - ms.elem (0, j) = m.elem (k-1, j); \ + int k = l (0); \ + idx (0, j) = k; \ + ms (0, j) = m (k-1, j); \ for (int i = 1; i < nr; i++) \ { \ - k = l.elem ((int) idx.elem (i-1, j)); \ - idx.elem (i, j) = k; \ - ms.elem (i, j) = m.elem (k-1, j); \ + k = l ((int) idx (i-1, j)); \ + idx (i, j) = k; \ + ms (i, j) = m (k-1, j); \ } static octave_value_list @@ -176,7 +176,7 @@ { Array<int> l = create_index_array (nr); - DO_SORT (nr, (m.elem (p-1, j) > m.elem (q-1, j))); + DO_SORT (nr, (m (p-1, j) > m (q-1, j))); MATRIX_CREATE_RETURN_VALUES (ms, m); } @@ -209,7 +209,7 @@ { Array<int> l = create_index_array (n); - DO_SORT (n, (v.elem (p-1) > v.elem (q-1))); + DO_SORT (n, (v (p-1) > v (q-1))); VECTOR_CREATE_RETURN_VALUES (vs, v); } @@ -246,15 +246,15 @@ int all_elts_real = 1; for (int i = 0; i < nr; i++) - if (imag (cm.elem (i, j)) != 0.0) + if (imag (cm (i, j)) != 0.0) { all_elts_real = 0; break; } DO_SORT (nr, ((all_elts_real - && real (cm.elem (p-1, j)) > real (cm.elem (q-1, j))) - || abs (cm.elem (p-1, j)) > abs (cm.elem (q-1, j)))); + && real (cm (p-1, j)) > real (cm (q-1, j))) + || abs (cm (p-1, j)) > abs (cm (q-1, j)))); MATRIX_CREATE_RETURN_VALUES (cms, cm); } @@ -289,15 +289,15 @@ int all_elts_real = 1; for (int i = 0; i < n; i++) - if (imag (cv.elem (i)) != 0.0) + if (imag (cv (i)) != 0.0) { all_elts_real = 0; break; } DO_SORT (n, ((all_elts_real - && real (cv.elem (p-1)) > real (cv.elem (q-1))) - || abs (cv.elem (p-1)) > abs (cv.elem (q-1)))); + && real (cv (p-1)) > real (cv (q-1))) + || abs (cv (p-1)) > abs (cv (q-1)))); VECTOR_CREATE_RETURN_VALUES (cvs, cv); } @@ -342,7 +342,7 @@ int nc = m.columns (); RowVector v (nc); for (int i = 0; i < nc; i++) - v.elem (i) = m.elem (0, i); + v (i) = m (0, i); retval = mx_sort (v); } @@ -361,7 +361,7 @@ int nc = cm.columns (); ComplexRowVector cv (nc); for (int i = 0; i < nc; i++) - cv.elem (i) = cm.elem (0, i); + cv (i) = cm (0, i); retval = mx_sort (cv); }
--- a/src/syscalls.cc +++ b/src/syscalls.cc @@ -158,7 +158,7 @@ exec_args[i+1] = new char [nc+1]; for (int j = 0; j < nc; j++) - exec_args[i+1][j] = chm.elem (i, j); + exec_args[i+1][j] = chm (i, j); exec_args[i+1][nc] = '\0'; } @@ -407,8 +407,8 @@ Matrix file_ids (1, 2); - file_ids.elem (0, 0) = octave_stream_list::insert (is); - file_ids.elem (0, 1) = octave_stream_list::insert (os); + file_ids (0, 0) = octave_stream_list::insert (is); + file_ids (0, 1) = octave_stream_list::insert (os); retval(0) = file_ids; retval(1) = 0.0;
--- a/src/xdiv.cc +++ b/src/xdiv.cc @@ -203,7 +203,7 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) - result.elem (i, j) = a / b.elem (i, j); + result (i, j) = a / b (i, j); return result; } @@ -218,7 +218,7 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) - result.elem (i, j) = a / b.elem (i, j); + result (i, j) = a / b (i, j); return result; } @@ -233,7 +233,7 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) - result.elem (i, j) = a / b.elem (i, j); + result (i, j) = a / b (i, j); return result; } @@ -248,7 +248,7 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) - result.elem (i, j) = a / b.elem (i, j); + result (i, j) = a / b (i, j); return result; }
--- a/src/xpow.cc +++ b/src/xpow.cc @@ -50,7 +50,7 @@ int nc = a.columns (); for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) - if (a.elem (i, j) < 0.0) + if (a (i, j) < 0.0) return 1; return 0; } @@ -110,11 +110,11 @@ for (int i = 0; i < nr; i++) { - Complex elt = lambda.elem (i); + Complex elt = lambda (i); if (imag (elt) == 0.0) - lambda.elem (i) = pow (a, real (elt)); + lambda (i) = pow (a, real (elt)); else - lambda.elem (i) = pow (a, elt); + lambda (i) = pow (a, elt); } ComplexDiagMatrix D (lambda); @@ -155,11 +155,11 @@ for (int i = 0; i < nr; i++) { - Complex elt = lambda.elem (i); + Complex elt = lambda (i); if (imag (elt) == 0.0) - lambda.elem (i) = pow (a, real (elt)); + lambda (i) = pow (a, real (elt)); else - lambda.elem (i) = pow (a, elt); + lambda (i) = pow (a, elt); } ComplexDiagMatrix D (lambda); @@ -228,7 +228,7 @@ ComplexMatrix Q (a_eig.eigenvectors ()); for (int i = 0; i < nr; i++) - lambda.elem (i) = pow (lambda.elem (i), b); + lambda (i) = pow (lambda (i), b); ComplexDiagMatrix D (lambda); @@ -259,7 +259,7 @@ ComplexMatrix Q (a_eig.eigenvectors ()); for (int i = 0; i < nr; i++) - lambda.elem (i) = pow (lambda.elem (i), b); + lambda (i) = pow (lambda (i), b); ComplexDiagMatrix D (lambda); @@ -304,11 +304,11 @@ for (int i = 0; i < nr; i++) { - Complex elt = lambda.elem (i); + Complex elt = lambda (i); if (imag (elt) == 0.0) - lambda.elem (i) = pow (a, real (elt)); + lambda (i) = pow (a, real (elt)); else - lambda.elem (i) = pow (a, elt); + lambda (i) = pow (a, elt); } ComplexDiagMatrix D (lambda); @@ -348,11 +348,11 @@ for (int i = 0; i < nr; i++) { - Complex elt = lambda.elem (i); + Complex elt = lambda (i); if (imag (elt) == 0.0) - lambda.elem (i) = pow (a, real (elt)); + lambda (i) = pow (a, real (elt)); else - lambda.elem (i) = pow (a, elt); + lambda (i) = pow (a, elt); } ComplexDiagMatrix D (lambda); @@ -421,7 +421,7 @@ ComplexMatrix Q (a_eig.eigenvectors ()); for (int i = 0; i < nr; i++) - lambda.elem (i) = pow (lambda.elem (i), b); + lambda (i) = pow (lambda (i), b); ComplexDiagMatrix D (lambda); @@ -452,7 +452,7 @@ ComplexMatrix Q (a_eig.eigenvectors ()); for (int i = 0; i < nr; i++) - lambda.elem (i) = pow (lambda.elem (i), b); + lambda (i) = pow (lambda (i), b); ComplexDiagMatrix D (lambda); @@ -494,7 +494,7 @@ ComplexMatrix result (nr, nc); for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) - result.elem (i, j) = pow (atmp, b.elem (i, j)); + result (i, j) = pow (atmp, b (i, j)); retval = result; } @@ -503,7 +503,7 @@ Matrix result (nr, nc); for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) - result.elem (i, j) = pow (a, b.elem (i, j)); + result (i, j) = pow (a, b (i, j)); retval = result; } @@ -521,7 +521,7 @@ ComplexMatrix result (nr, nc); for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) - result.elem (i, j) = pow (a, b.elem (i, j)); + result (i, j) = pow (a, b (i, j)); return result; } @@ -541,8 +541,8 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) { - Complex atmp (a.elem (i, j)); - result.elem (i, j) = pow (atmp, b); + Complex atmp (a (i, j)); + result (i, j) = pow (atmp, b); } retval = result; @@ -552,7 +552,7 @@ Matrix result (nr, nc); for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) - result.elem (i, j) = pow (a.elem (i, j), b); + result (i, j) = pow (a (i, j), b); retval = result; } @@ -575,8 +575,8 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) { - double atmp = a.elem (i, j); - double btmp = b.elem (i, j); + double atmp = a (i, j); + double btmp = b (i, j); if (atmp < 0.0 && (int) btmp != btmp) { convert_to_complex = 1; @@ -593,9 +593,9 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) { - Complex atmp (a.elem (i, j)); - Complex btmp (b.elem (i, j)); - complex_result.elem (i, j) = pow (atmp, btmp); + Complex atmp (a (i, j)); + Complex btmp (b (i, j)); + complex_result (i, j) = pow (atmp, btmp); } retval = complex_result; @@ -606,7 +606,7 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) - result.elem (i, j) = pow (a.elem (i, j), b.elem (i, j)); + result (i, j) = pow (a (i, j), b (i, j)); retval = result; } @@ -624,7 +624,7 @@ ComplexMatrix result (nr, nc); for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) - result.elem (i, j) = pow (a.elem (i, j), b); + result (i, j) = pow (a (i, j), b); return result; } @@ -641,7 +641,7 @@ ComplexMatrix result (nr, nc); for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) - result.elem (i, j) = pow (a.elem (i, j), b.elem (i, j)); + result (i, j) = pow (a (i, j), b (i, j)); return result; } @@ -657,11 +657,11 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) { - double btmp = b.elem (i, j); + double btmp = b (i, j); if (xisint (btmp)) - result.elem (i, j) = pow (a, (int) btmp); + result (i, j) = pow (a, (int) btmp); else - result.elem (i, j) = pow (a, btmp); + result (i, j) = pow (a, btmp); } return result; @@ -677,7 +677,7 @@ ComplexMatrix result (nr, nc); for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) - result.elem (i, j) = pow (a, b.elem (i, j)); + result (i, j) = pow (a, b (i, j)); return result; } @@ -695,13 +695,13 @@ { for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) - result.elem (i, j) = pow (a.elem (i, j), (int) b); + result (i, j) = pow (a (i, j), (int) b); } else { for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) - result.elem (i, j) = pow (a.elem (i, j), b); + result (i, j) = pow (a (i, j), b); } return result; @@ -720,11 +720,11 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) { - double btmp = b.elem (i, j); + double btmp = b (i, j); if (xisint (btmp)) - result.elem (i, j) = pow (a.elem (i, j), (int) btmp); + result (i, j) = pow (a (i, j), (int) btmp); else - result.elem (i, j) = pow (a.elem (i, j), btmp); + result (i, j) = pow (a (i, j), btmp); } return result; @@ -740,7 +740,7 @@ ComplexMatrix result (nr, nc); for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) - result.elem (i, j) = pow (a.elem (i, j), b); + result (i, j) = pow (a (i, j), b); return result; } @@ -756,7 +756,7 @@ for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) - result.elem (i, j) = pow (a.elem (i, j), b.elem (i, j)); + result (i, j) = pow (a (i, j), b (i, j)); return result; }