Mercurial > octave
comparison libinterp/corefcn/cellfun.cc @ 33395:a258493e726a
Backed out changeset c714266d9f0d
author | Arun Giridhar <arungiridhar@gmail.com> |
---|---|
date | Sat, 13 Apr 2024 14:28:48 -0400 |
parents | c714266d9f0d |
children | 3e446791b7ef |
comparison
equal
deleted
inserted
replaced
33394:ee94862503e2 | 33395:a258493e726a |
---|---|
1989 static Cell | 1989 static Cell |
1990 do_mat2cell_2d (const Array2D& a, const Array<octave_idx_type> *d, int nd) | 1990 do_mat2cell_2d (const Array2D& a, const Array<octave_idx_type> *d, int nd) |
1991 { | 1991 { |
1992 Cell retval; | 1992 Cell retval; |
1993 | 1993 |
1994 if ((nd != 1 && nd != 2) || a.ndims () != 2) | 1994 panic_unless (nd == 1 || nd == 2); |
1995 error ("do_mat2cell_2d: A must be two-dimensional, and ND must be 1 or 2"); | 1995 panic_unless (a.ndims () == 2); |
1996 | 1996 |
1997 if (mat2cell_mismatch (a.dims (), d, nd)) | 1997 if (mat2cell_mismatch (a.dims (), d, nd)) |
1998 return retval; | 1998 return retval; |
1999 | 1999 |
2000 octave_idx_type nridx = d[0].numel (); | 2000 octave_idx_type nridx = d[0].numel (); |
2047 Cell | 2047 Cell |
2048 do_mat2cell_nd (const ArrayND& a, const Array<octave_idx_type> *d, int nd) | 2048 do_mat2cell_nd (const ArrayND& a, const Array<octave_idx_type> *d, int nd) |
2049 { | 2049 { |
2050 Cell retval; | 2050 Cell retval; |
2051 | 2051 |
2052 if (nd < 1) | 2052 panic_unless (nd >= 1); |
2053 error ("do_mat2cell_nd: ND must be at least 1"); | |
2054 | 2053 |
2055 if (mat2cell_mismatch (a.dims (), d, nd)) | 2054 if (mat2cell_mismatch (a.dims (), d, nd)) |
2056 return retval; | 2055 return retval; |
2057 | 2056 |
2058 // For each dimension, count the number of partitions specified. | 2057 // For each dimension, count the number of partitions specified. |
2131 Cell | 2130 Cell |
2132 do_mat2cell (octave_value& a, const Array<octave_idx_type> *d, int nd) | 2131 do_mat2cell (octave_value& a, const Array<octave_idx_type> *d, int nd) |
2133 { | 2132 { |
2134 Cell retval; | 2133 Cell retval; |
2135 | 2134 |
2136 if (nd < 1) | 2135 panic_unless (nd >= 1); |
2137 error ("do_mat2cell: ND must be at least 1"); | |
2138 | 2136 |
2139 if (mat2cell_mismatch (a.dims (), d, nd)) | 2137 if (mat2cell_mismatch (a.dims (), d, nd)) |
2140 return retval; | 2138 return retval; |
2141 | 2139 |
2142 dim_vector rdv = dim_vector::alloc (nd); | 2140 dim_vector rdv = dim_vector::alloc (nd); |