Mercurial > hg > octave-terminal
changeset 7642:9a4541c622b5
refactor Array::assignN dimensioning code for empty initial matrices
author | David Bateman <dbateman@free.fr> |
---|---|
date | Tue, 25 Mar 2008 23:06:45 -0400 |
parents | 115563ecbdc9 |
children | 0220da981c2a |
files | liboctave/Array-util.cc liboctave/Array-util.h liboctave/Array.cc liboctave/ChangeLog test/ChangeLog test/test_index-wfi-f.m test/test_index-wfi-t.m |
diffstat | 7 files changed, 226 insertions(+), 103 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/Array-util.cc +++ b/liboctave/Array-util.cc @@ -135,6 +135,26 @@ } bool +is_vector (const dim_vector& dim) +{ + int m = 0; + int n = dim.length (); + bool retval = true; + + if (n == 0) + m = 2; + else + { + for (int i = 0; i < n; i ++) + if (dim (i) > 1) + m++; + else if (dim(i) < 1) + m += 2; + } + return (m < 2); +} + +bool any_ones (const Array<octave_idx_type>& arr) { bool retval = false;
--- a/liboctave/Array-util.h +++ b/liboctave/Array-util.h @@ -43,6 +43,8 @@ extern OCTAVE_API bool is_scalar (const dim_vector& dim); +extern OCTAVE_API bool is_vector (const dim_vector& dim); + extern OCTAVE_API bool any_ones (const Array<octave_idx_type>& arr); extern OCTAVE_API octave_idx_type compute_index (const Array<octave_idx_type>& ra_idx, const dim_vector& dims);
--- a/liboctave/Array.cc +++ b/liboctave/Array.cc @@ -3351,35 +3351,94 @@ if (orig_empty) { - int k = 0; - for (int i = 0; i < n_idx; i++) + if (rhs_is_scalar) + { + for (int i = 0; i < n_idx; i++) + { + if (idx(i).is_colon ()) + new_dims(i) = 1; + else + new_dims(i) = idx(i).orig_empty () ? 0 : idx(i).max () + 1; + } + } + else if (is_vector (rhs_dims)) { - // If index is a colon, resizing to RHS dimensions is - // allowed because we started out empty. - - if (idx(i).is_colon ()) + int ncolon = 0; + int fcolon = 0; + int lcolon = 0; + for (int i = 0; i < n_idx; i++) + if (idx(i).is_colon ()) + { + ncolon ++; + if (ncolon == 1) + fcolon = i; + lcolon = i; + new_dims (i) = 1; + } + else + new_dims (i) = idx(i).capacity (); + + if (ncolon == n_idx) { - if (k < rhs_dims.length ()) - new_dims(i) = rhs_dims(k++); - else - new_dims(i) = 1; + new_dims = rhs_dims; + new_dims.resize (n_idx); + for (int i = rhs_dims_len; i < n_idx; i++) + new_dims (i) = 1; } else { - octave_idx_type nelem = idx(i).capacity (); - - if (nelem >= 1 - && ((k < rhs_dims.length () && nelem == rhs_dims(k)) - || rhs_is_scalar) || ! idx(i).is_colon()) - k++; - else if (! (nelem == 1 || rhs_is_scalar)) + octave_idx_type new_dims_numel = new_dims.numel (); + octave_idx_type rhs_dims_numel = rhs_dims.numel (); + bool is_vec = is_vector (new_dims); + + for (int i = 0; i < n_idx; i++) + new_dims(i) = idx(i).orig_empty () ? 0 : idx(i).max () + 1; + + if (new_dims_numel != rhs_dims_numel && + ncolon > 0 && new_dims_numel == 1) + { + if (ncolon == 2 && rhs_dims_len == 2 && + rhs_dims(0) == 1) + new_dims (lcolon) = rhs_dims_numel; + else + new_dims (fcolon) = rhs_dims_numel; + } + else if (new_dims_numel != rhs_dims_numel || !is_vec) { (*current_liboctave_error_handler) ("A(IDX-LIST) = RHS: mismatched index and RHS dimension"); return retval; } - - new_dims(i) = idx(i).orig_empty () ? 0 : idx(i).max () + 1; + } + } + else + { + int k = 0; + for (int i = 0; i < n_idx; i++) + { + if (idx(i).is_colon ()) + { + if (k < rhs_dims_len) + new_dims(i) = rhs_dims(k++); + else + new_dims(i) = 1; + } + else + { + octave_idx_type nelem = idx(i).capacity (); + + if (nelem >= 1 + && (k < rhs_dims_len && nelem == rhs_dims(k))) + k++; + else if (nelem != 1) + { + (*current_liboctave_error_handler) + ("A(IDX-LIST) = RHS: mismatched index and RHS dimension"); + return retval; + } + new_dims(i) = idx(i).orig_empty () ? 0 : + idx(i).max () + 1; + } } } }
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,11 @@ +2008-03-25 David Bateman <dbateman@feee.fr> + + * Array.cc (assignN): refactor calculation of new dimensions when + original matrix is empty. + * Array-util.cc (bool is_vector (const dim_vector&)): New + function. + * Array-util.h (bool is_vector (const dim_vector&)): declare it. + 2008-03-25 David Bateman <dbateman@free.fr> * sparse-base-chol.h (sparse_base_chol_rep::~sparse_base_chol_rep
--- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2008-03-25 John W. Eaton <jwe@octave.org> + + * test_index-wfi-f.m: New tests. + 2008-03-25 Jaroslav Hajek <highegg@gmail.com> * test_io.m: Add test for save with -struct modifier.
--- a/test/test_index-wfi-f.m +++ b/test/test_index-wfi-f.m @@ -24,7 +24,7 @@ %! warning ("off", "Octave:fortran-indexing"); %! a = []; %! assert(isempty (a)); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/s-2.m %!test @@ -32,7 +32,7 @@ %! warning ("off", "Octave:fortran-indexing"); %! a = 1; %! assert(a(1),1); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/s-3.m %!test @@ -40,7 +40,7 @@ %! warning ("off", "Octave:fortran-indexing"); %! a = 1; %! assert(a(:),1); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/s-4.m %!test @@ -48,7 +48,7 @@ %! warning ("off", "Octave:fortran-indexing"); %! a = 1; %! assert(a(:,:),1); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/s-5.m %!test @@ -56,7 +56,7 @@ %! warning ("off", "Octave:fortran-indexing"); %! a = 1; %! assert(a(1,:),1); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/s-6.m %!test @@ -64,7 +64,7 @@ %! warning ("off", "Octave:fortran-indexing"); %! a = 1; %! assert(a(:,1),1); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/s-7.m %!test @@ -72,7 +72,7 @@ %! warning ("off", "Octave:fortran-indexing"); %! a = 1; %! assert(isempty (a(logical (0)))); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/s-8.m %!test @@ -80,7 +80,7 @@ %! warning ("off", "Octave:fortran-indexing"); %! a = 1; %! fail("a(-1)"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/s-9.m %!test @@ -88,7 +88,7 @@ %! warning ("off", "Octave:fortran-indexing"); %! a = 1; %! fail("a(2);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/s-10.m %!test @@ -96,7 +96,7 @@ %! warning ("off", "Octave:fortran-indexing"); %! a = 1; %! fail("a(2,:);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/s-11.m %!test @@ -104,7 +104,7 @@ %! warning ("off", "Octave:fortran-indexing"); %! a = 1; %! fail("a(:,2);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/s-12.m %!test @@ -112,7 +112,7 @@ %! warning ("off", "Octave:fortran-indexing"); %! a = 1; %! fail("a(-1,:);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/s-13.m %!test @@ -120,7 +120,7 @@ %! warning ("off", "Octave:fortran-indexing"); %! a = 1; %! fail("a(:,-1);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/s-14.m %!test @@ -128,7 +128,7 @@ %! warning ("off", "Octave:fortran-indexing"); %! a = 1; %! fail("a([1,2,3]);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/s-15.m %!test @@ -136,7 +136,7 @@ %! warning ("off", "Octave:fortran-indexing"); %! a = 1; %! fail("a([1;2;3]);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/s-16.m %!test @@ -144,7 +144,7 @@ %! warning ("off", "Octave:fortran-indexing"); %! a = 1; %! fail("a([1,2;3,4]);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/s-17.m %!test @@ -152,7 +152,7 @@ %! warning ("off", "Octave:fortran-indexing"); %! a = 1; %! fail("a([0,1]);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/s-18.m %!test @@ -160,7 +160,7 @@ %! warning ("off", "Octave:fortran-indexing"); %! a = 1; %! fail("a([0;1]);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/s-19.m %!test @@ -168,7 +168,7 @@ %! warning ("off", "Octave:fortran-indexing"); %! a = 1; %! fail("a([-1,0]);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/s-20.m %!test @@ -176,7 +176,7 @@ %! warning ("off", "Octave:fortran-indexing"); %! a = 1; %! fail("a([-1;0]);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/v-1.m %!test @@ -186,7 +186,7 @@ %! a_prime = [4;3;2;1]; %! mid_a = [3,2]; %! assert(a(1),4); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/v-2.m %!test @@ -196,7 +196,7 @@ %! a_prime = [4;3;2;1]; %! mid_a = [3,2]; %! assert(a(2),3); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/v-3.m %!test @@ -206,7 +206,7 @@ %! a_prime = [4;3;2;1]; %! mid_a = [3,2]; %! assert(all (a(:) == a_prime)); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/v-4.m %!test @@ -216,7 +216,7 @@ %! a_prime = [4;3;2;1]; %! mid_a = [3,2]; %! assert(all (a(1,:) == a)); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/v-5.m %!test @@ -226,7 +226,7 @@ %! a_prime = [4;3;2;1]; %! mid_a = [3,2]; %! assert(a(:,3),2); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/v-6.m %!test @@ -236,7 +236,7 @@ %! a_prime = [4;3;2;1]; %! mid_a = [3,2]; %! assert(all (a(:,:) == a)); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/v-7.m %!test @@ -246,7 +246,7 @@ %! a_prime = [4;3;2;1]; %! mid_a = [3,2]; %! assert(all (a(logical ([0,1,1,0])) == mid_a)); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/v-8.m %!test @@ -256,7 +256,7 @@ %! a_prime = [4;3;2;1]; %! mid_a = [3,2]; %! fail("a(0);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/v-9.m %!test @@ -266,7 +266,7 @@ %! a_prime = [4;3;2;1]; %! mid_a = [3,2]; %! fail("a(5);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/v-10.m %!test @@ -276,7 +276,7 @@ %! a_prime = [4;3;2;1]; %! mid_a = [3,2]; %! fail("a(0,1);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/v-11.m %!test @@ -286,7 +286,7 @@ %! a_prime = [4;3;2;1]; %! mid_a = [3,2]; %! assert(isempty (a(logical (0),:))); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/v-12.m %!test @@ -296,7 +296,7 @@ %! a_prime = [4;3;2;1]; %! mid_a = [3,2]; %! fail("a(:,0);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/v-13.m %!test @@ -306,7 +306,7 @@ %! a_prime = [4;3;2;1]; %! mid_a = [3,2]; %! assert(isempty (a([]))); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/v-14.m %!test @@ -316,7 +316,7 @@ %! a_prime = [4;3;2;1]; %! mid_a = [3,2]; %! assert(isempty (a([],:))); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/v-15.m %!test @@ -326,7 +326,7 @@ %! a_prime = [4;3;2;1]; %! mid_a = [3,2]; %! assert(isempty (a(:,[]))); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/m-1.m %!test @@ -339,7 +339,7 @@ %! a_row_1 = [1,2]; %! a_row_2 = [3,4]; %! assert(all (all (a(:,:) == a))); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/m-2.m %!test @@ -352,7 +352,7 @@ %! a_row_1 = [1,2]; %! a_row_2 = [3,4]; %! assert(all (a(:) == a_fvec)); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/m-3.m %!test @@ -365,7 +365,7 @@ %! a_row_1 = [1,2]; %! a_row_2 = [3,4]; %! fail("a(0);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/m-4.m %!test @@ -378,7 +378,7 @@ %! a_row_1 = [1,2]; %! a_row_2 = [3,4]; %! assert(a(2),3); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-f/misc.m %!test @@ -406,6 +406,22 @@ %! a12 = zeros (1, 0, 2); %! a13 = zeros (1, 1, 0); %! clear a14; a14(1:10,1) = 1:10; +%! clear a15; a15(1,:) = a2; +%! clear a16; a16(1,:) = a4; +%! clear a17; a17(:,1) = a4; +%! clear a18; a18(1,:,:) = a; +%! a19 = reshape (a, [1,2,2]); +%! clear a20; a20(1,1:4,2) = reshape (1:4, [1,1,4]); +%! clear a21; a21(:,:,2) = 1:4; +%! clear a22; a22(:,:,:) = 1:4; +%! clear a23; a23(1,:,:) = 1:4; +%! clear a24; a24(:,1,:) = 1:4; +%! clear a25; a25(:,:,1) = 1:4; +%! clear a26; a26(:,:,1) = [1:4]'; +%! clear a27; a27(:,:,1) = reshape(1:4,[1,1,4]); +%! clear a28; a28(1,:,:) = 1:4; +%! clear a29; a29(1,:,:) = [1:4]'; +%! clear a30; a30(1,:,:) = reshape (1:4,[1,1,4]); %! b1 = [1; 3; 2; 4; 5; 7; 6; 8]; %! b2 = [1, 2, 5, 6; 3, 4, 7, 8]; %! b3 = [1; 3]; @@ -447,9 +463,23 @@ %! assert(b(1,1:4), b9); %! assert(b(1,[],:), b10); %! assert(b(1,[]), b11); -%! assert (b(:,3), b12); -%! assert (b([1,2],3), b12); -%! assert (b(true(2,1),3), b12); -%! assert (b(false(2,1),3), b13) -%! assert (b([],3), b13) -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! assert(b(:,3), b12); +%! assert(b([1,2],3), b12); +%! assert(b(true(2,1),3), b12); +%! assert(b(false(2,1),3), b13) +%! assert(b([],3), b13) +%! assert(a15, a2); +%! assert(a16, a2); +%! assert(a17, a4); +%! assert(a18, a19); +%! assert(a20, a21); +%! assert(a22, [1:4]); +%! assert(a23, reshape (1:4, [1,1,4])); +%! assert(a24, reshape (1:4, [1,1,4])); +%! assert(a25, [1,2,3,4]); +%! assert(a26, [1;2;3;4]); +%! assert(a27, [1;2;3;4]); +%! assert(a28, reshape (1:4, [1,1,4])); +%! assert(a29, [1,2,3,4]); +%! assert(a30, [1,2,3,4]); +%! warning (wfi.state, "Octave:fortran-indexing");
--- a/test/test_index-wfi-t.m +++ b/test/test_index-wfi-t.m @@ -24,7 +24,7 @@ %! warn_fortran_indexing = 1; %! a = []; %! assert(isempty (a)); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/s-2.m %!test @@ -32,7 +32,7 @@ %! warning ("on", "Octave:fortran-indexing"); %! a = 1; %! assert(a(1),1); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/s-3.m %!test @@ -40,7 +40,7 @@ %! warning ("on", "Octave:fortran-indexing"); %! a = 1; %! assert(a(:),1); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/s-4.m %!test @@ -48,7 +48,7 @@ %! warning ("on", "Octave:fortran-indexing"); %! a = 1; %! assert(a(:,:),1); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/s-5.m %!test @@ -56,7 +56,7 @@ %! warning ("on", "Octave:fortran-indexing"); %! a = 1; %! assert(a(1,:),1); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/s-6.m %!test @@ -64,7 +64,7 @@ %! warning ("on", "Octave:fortran-indexing"); %! a = 1; %! assert(a(:,1),1); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/s-7.m %!test @@ -72,7 +72,7 @@ %! warning ("on", "Octave:fortran-indexing"); %! a = 1; %! assert(isempty (a(logical (0)))); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/s-8.m %!test @@ -80,7 +80,7 @@ %! warning ("on", "Octave:fortran-indexing"); %! a = 1; %! fail("a(-1);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/s-9.m %!test @@ -88,7 +88,7 @@ %! warning ("on", "Octave:fortran-indexing"); %! a = 1; %! fail("a(2);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/s-10.m %!test @@ -96,7 +96,7 @@ %! warning ("on", "Octave:fortran-indexing"); %! a = 1; %! fail("a(2,:);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/s-11.m %!test @@ -104,7 +104,7 @@ %! warning ("on", "Octave:fortran-indexing"); %! a = 1; %! fail("a(:,2);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/s-12.m %!test @@ -112,7 +112,7 @@ %! warning ("on", "Octave:fortran-indexing"); %! a = 1; %! fail("a(-1,:);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/s-13.m %!test @@ -120,7 +120,7 @@ %! warning ("on", "Octave:fortran-indexing"); %! a = 1; %! fail("a(:,-1);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/s-14.m %!test @@ -128,7 +128,7 @@ %! warning ("on", "Octave:fortran-indexing"); %! a = 1; %! fail("a([1,2,3]);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/s-15.m %!test @@ -136,7 +136,7 @@ %! warning ("on", "Octave:fortran-indexing"); %! a = 1; %! fail("a([1;2;3]);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/s-16.m %!test @@ -144,7 +144,7 @@ %! warning ("on", "Octave:fortran-indexing"); %! a = 1; %! fail("a([1,2;3,4]);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/s-17.m %!test @@ -152,7 +152,7 @@ %! warning ("on", "Octave:fortran-indexing"); %! a = 1; %! fail("a([0,1]);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/s-18.m %!test @@ -160,7 +160,7 @@ %! warning ("on", "Octave:fortran-indexing"); %! a = 1; %! fail("a([0;1]);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/s-19.m %!test @@ -168,7 +168,7 @@ %! warning ("on", "Octave:fortran-indexing"); %! a = 1; %! fail("a([-1,0]);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/s-20.m %!test @@ -176,7 +176,7 @@ %! warning ("on", "Octave:fortran-indexing"); %! a = 1; %! fail("a([-1;0]);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/v-1.m %!test @@ -186,7 +186,7 @@ %! a_prime = [4;3;2;1]; %! mid_a = [3,2]; %! assert(a(1),4); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/v-2.m %!test @@ -196,7 +196,7 @@ %! a_prime = [4;3;2;1]; %! mid_a = [3,2]; %! assert(a(2),3); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/v-3.m %!test @@ -206,7 +206,7 @@ %! a_prime = [4;3;2;1]; %! mid_a = [3,2]; %! assert(all (a(:) == a_prime)); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/v-4.m %!test @@ -216,7 +216,7 @@ %! a_prime = [4;3;2;1]; %! mid_a = [3,2]; %! assert(all (a(1,:) == a)); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/v-5.m %!test @@ -226,7 +226,7 @@ %! a_prime = [4;3;2;1]; %! mid_a = [3,2]; %! assert(a(:,3),2); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/v-6.m %!test @@ -236,7 +236,7 @@ %! a_prime = [4;3;2;1]; %! mid_a = [3,2]; %! assert(all (a(:,:) == a)); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/v-7.m %!test @@ -246,7 +246,7 @@ %! a_prime = [4;3;2;1]; %! mid_a = [3,2]; %! assert(all (a(logical ([0,1,1,0])) == mid_a)); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/v-8.m %!test @@ -256,7 +256,7 @@ %! a_prime = [4;3;2;1]; %! mid_a = [3,2]; %! fail("a(0);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/v-9.m %!test @@ -266,7 +266,7 @@ %! a_prime = [4;3;2;1]; %! mid_a = [3,2]; %! fail("a(5);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/v-10.m %!test @@ -276,7 +276,7 @@ %! a_prime = [4;3;2;1]; %! mid_a = [3,2]; %! fail("a(0,1);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/v-11.m %!test @@ -286,7 +286,7 @@ %! a_prime = [4;3;2;1]; %! mid_a = [3,2]; %! assert(isempty (a(logical (0),:))); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/v-12.m %!test @@ -296,7 +296,7 @@ %! a_prime = [4;3;2;1]; %! mid_a = [3,2]; %! fail("a(:,0);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/v-13.m %!test @@ -306,7 +306,7 @@ %! a_prime = [4;3;2;1]; %! mid_a = [3,2]; %! assert(isempty (a([]))); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/v-14.m %!test @@ -316,7 +316,7 @@ %! a_prime = [4;3;2;1]; %! mid_a = [3,2]; %! assert(isempty (a([],:))); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/v-15.m %!test @@ -326,7 +326,7 @@ %! a_prime = [4;3;2;1]; %! mid_a = [3,2]; %! assert(isempty (a(:,[]))); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/m-1.m %!test @@ -339,7 +339,7 @@ %! a_row_1 = [1,2]; %! a_row_2 = [3,4]; %! assert(all (all (a(:,:) == a))); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/m-2.m %!test @@ -352,7 +352,7 @@ %! a_row_1 = [1,2]; %! a_row_2 = [3,4]; %! assert(all (a(:) == a_fvec)); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/m-3.m %!test @@ -365,7 +365,7 @@ %! a_row_1 = [1,2]; %! a_row_2 = [3,4]; %! fail("a(0);"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing"); %% test/octave.test/index-wfi-t/m-4.m %!test @@ -378,4 +378,4 @@ %! a_row_1 = [1,2]; %! a_row_2 = [3,4]; %! fail("a(2);","warning"); -%! warning ("wfi.state", "Octave:fortran-indexing"); +%! warning (wfi.state, "Octave:fortran-indexing");