Mercurial > hg > octave-lojdl
changeset 1906:fb2b7ebf77e4
[project @ 1996-02-10 01:08:28 by jwe]
author | jwe |
---|---|
date | Sat, 10 Feb 1996 01:08:28 +0000 |
parents | 39717752e3a2 |
children | 8c6cea97eb80 |
files | liboctave/Array-idx.h |
diffstat | 1 files changed, 29 insertions(+), 32 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/Array-idx.h +++ b/liboctave/Array-idx.h @@ -21,22 +21,10 @@ */ -#include "error.h" +#include "Array-flags.h" #include "idx-vector.h" #include "lo-error.h" -#if defined (OCTAVE_SOURCE) -extern int& dfi_flag; -extern int& pcv_flag; -extern int& pzo_flag; -extern int& rre_flag; -#else -extern int dfi_flag; -extern int pcv_flag; -extern int pzo_flag; -extern int rre_flag; -#endif - template <class T> void Array<T>::clear_index (void) @@ -77,7 +65,7 @@ int len = length (); - int n = idx.freeze (len, "vector", pzo_flag); + int n = idx.freeze (len, "vector", liboctave_pzo_flag); if (idx) { @@ -178,11 +166,12 @@ int lhs_len = lhs.length (); int rhs_len = rhs.length (); - int n = idx.freeze (lhs_len, "vector", pzo_flag, rre_flag); + int n = idx.freeze (lhs_len, "vector", liboctave_pzo_flag, + liboctave_rre_flag); if (n != 0) { - if (rre_flag) + if (liboctave_rre_flag) { int max_idx = idx.max () + 1; if (max_idx > lhs_len) @@ -245,8 +234,8 @@ idx_vector idx_i = tmp[0]; idx_vector idx_j = tmp[1]; - int n = idx_i.freeze (nr, "row", pzo_flag); - int m = idx_j.freeze (nc, "column", pzo_flag); + int n = idx_i.freeze (nr, "row", liboctave_pzo_flag); + int m = idx_j.freeze (nc, "column", liboctave_pzo_flag); if (idx_i && idx_j) { @@ -299,7 +288,7 @@ retval = Array2<T> (0, 0); else { - if (pcv_flag) + if (liboctave_pcv_flag) retval = Array2<T> (tmp, len, 1); else retval = Array2<T> (tmp, 1, len); @@ -309,7 +298,7 @@ { int result_is_column_vector = (nc == 1); - if (dfi_flag) + if (liboctave_dfi_flag) { idx_vector *tmp = get_idx (); idx_vector idx = tmp[0]; @@ -332,7 +321,7 @@ retval = Array2<T> (tmp, 1, len); } } - else if (dfi_flag) + else if (liboctave_dfi_flag) { // This code is only for indexing matrices. The vector // cases are handled above. @@ -340,7 +329,7 @@ idx_vector *tmp = get_idx (); idx_vector idx = tmp[0]; - idx.freeze (nr * nc, "matrix", pzo_flag); + idx.freeze (nr * nc, "matrix", liboctave_pzo_flag); if (idx) { @@ -518,8 +507,11 @@ idx_vector idx_i = tmp[0]; idx_vector idx_j = tmp[1]; - int n = idx_i.freeze (lhs_nr, "row", pzo_flag, rre_flag); - int m = idx_j.freeze (lhs_nc, "column", pzo_flag, rre_flag); + int n = idx_i.freeze (lhs_nr, "row", liboctave_pzo_flag, + liboctave_rre_flag); + + int m = idx_j.freeze (lhs_nc, "column", liboctave_pzo_flag, + liboctave_rre_flag); int idx_i_is_colon = idx_i.is_colon (); int idx_j_is_colon = idx_j.is_colon (); @@ -538,7 +530,7 @@ } else { - if (rre_flag) + if (liboctave_rre_flag) { int max_row_idx = idx_i_is_colon ? rhs_nr : idx_i.max () + 1; int max_col_idx = idx_j_is_colon ? rhs_nc : idx_j.max () + 1; @@ -601,7 +593,8 @@ int lhs_len = lhs.length (); - int n = idx.freeze (lhs_len, 0, pzo_flag, rre_flag); + int n = idx.freeze (lhs_len, 0, liboctave_pzo_flag, + liboctave_rre_flag); if (idx) { @@ -624,9 +617,10 @@ int idx_nr = idx.orig_rows (); int idx_nc = idx.orig_columns (); - if (dfi_flag || (idx_nr == 1 && idx_nc == 1)) + if (liboctave_dfi_flag + || (idx_nr == 1 && idx_nc == 1)) { - if (pcv_flag) + if (liboctave_pcv_flag) { lhs.d1 = lhs.length (); lhs.d2 = 1; @@ -669,7 +663,8 @@ idx_vector idx = tmp[0]; - idx.freeze (lhs_nc, "vector", pzo_flag, rre_flag); + idx.freeze (lhs_nc, "vector", liboctave_pzo_flag, + liboctave_rre_flag); if (idx) { @@ -694,7 +689,8 @@ idx_vector idx = tmp[0]; - idx.freeze (lhs_nr, "vector", pzo_flag, rre_flag); + idx.freeze (lhs_nr, "vector", liboctave_pzo_flag, + liboctave_rre_flag); if (idx) { @@ -713,12 +709,13 @@ } // idx_vector::freeze() printed an error message for us. } - else if (dfi_flag) + else if (liboctave_dfi_flag) { idx_vector *tmp = lhs.get_idx (); idx_vector idx = tmp[0]; - int len = idx.freeze (lhs_nr * lhs_nc, "matrix", pzo_flag); + int len = idx.freeze (lhs_nr * lhs_nc, "matrix", + liboctave_pzo_flag); if (idx) {