Mercurial > octave
comparison libinterp/corefcn/cellfun.cc @ 21751:b571fc85953f
maint: Use two spaces after period to indicate sentence break.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 19 May 2016 18:48:52 -0700 |
parents | f4d7d0eb5b0c |
children | 112b20240c87 |
comparison
equal
deleted
inserted
replaced
21750:6720e5a220ba | 21751:b571fc85953f |
---|---|
1905 else if (a.rows () == 1 && nridx == 1 && nd == 2) | 1905 else if (a.rows () == 1 && nridx == 1 && nd == 2) |
1906 ivec = 1; | 1906 ivec = 1; |
1907 | 1907 |
1908 if (ivec >= 0) | 1908 if (ivec >= 0) |
1909 { | 1909 { |
1910 // Vector split. Use 1D indexing. | 1910 // Vector split. Use 1D indexing. |
1911 octave_idx_type l = 0; | 1911 octave_idx_type l = 0; |
1912 octave_idx_type nidx = (ivec == 0 ? nridx : ncidx); | 1912 octave_idx_type nidx = (ivec == 0 ? nridx : ncidx); |
1913 for (octave_idx_type i = 0; i < nidx; i++) | 1913 for (octave_idx_type i = 0; i < nidx; i++) |
1914 { | 1914 { |
1915 octave_idx_type u = l + d[ivec](i); | 1915 octave_idx_type u = l + d[ivec](i); |
1917 l = u; | 1917 l = u; |
1918 } | 1918 } |
1919 } | 1919 } |
1920 else | 1920 else |
1921 { | 1921 { |
1922 // General 2D case. Use 2D indexing. | 1922 // General 2D case. Use 2D indexing. |
1923 OCTAVE_LOCAL_BUFFER (idx_vector, ridx, nridx); | 1923 OCTAVE_LOCAL_BUFFER (idx_vector, ridx, nridx); |
1924 prepare_idx (ridx, 0, nd, d); | 1924 prepare_idx (ridx, 0, nd, d); |
1925 | 1925 |
1926 OCTAVE_LOCAL_BUFFER (idx_vector, cidx, ncidx); | 1926 OCTAVE_LOCAL_BUFFER (idx_vector, cidx, ncidx); |
1927 prepare_idx (cidx, 1, nd, d); | 1927 prepare_idx (cidx, 1, nd, d); |
1936 } | 1936 } |
1937 | 1937 |
1938 return retval; | 1938 return retval; |
1939 } | 1939 } |
1940 | 1940 |
1941 // Nd case. Works for Arrays and octave_map. | 1941 // Nd case. Works for Arrays and octave_map. |
1942 // Uses Nd indexing. | 1942 // Uses Nd indexing. |
1943 | 1943 |
1944 template <typename ArrayND> | 1944 template <typename ArrayND> |
1945 Cell | 1945 Cell |
1946 do_mat2cell_nd (const ArrayND& a, const Array<octave_idx_type> *d, int nd) | 1946 do_mat2cell_nd (const ArrayND& a, const Array<octave_idx_type> *d, int nd) |
2001 return do_mat2cell_2d (a, d, nd); | 2001 return do_mat2cell_2d (a, d, nd); |
2002 else | 2002 else |
2003 return do_mat2cell_nd (a, d, nd); | 2003 return do_mat2cell_nd (a, d, nd); |
2004 } | 2004 } |
2005 | 2005 |
2006 // General case. Works for any class supporting do_index_op. | 2006 // General case. Works for any class supporting do_index_op. |
2007 // Uses Nd indexing. | 2007 // Uses Nd indexing. |
2008 | 2008 |
2009 Cell | 2009 Cell |
2010 do_mat2cell (octave_value& a, const Array<octave_idx_type> *d, int nd) | 2010 do_mat2cell (octave_value& a, const Array<octave_idx_type> *d, int nd) |
2011 { | 2011 { |