Mercurial > hg > octave-lyh
comparison src/ov-flt-cx-mat.cc @ 8290:7cbe01c21986
improve dense array indexing
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Mon, 20 Oct 2008 16:54:28 +0200 |
parents | a41df65f3f00 |
children | 8b1a2555c4e2 |
comparison
equal
deleted
inserted
replaced
8289:ac7f334d9652 | 8290:7cbe01c21986 |
---|---|
106 octave_base_matrix<FloatComplexNDArray>::assign (idx, rhs); | 106 octave_base_matrix<FloatComplexNDArray>::assign (idx, rhs); |
107 } | 107 } |
108 | 108 |
109 void | 109 void |
110 octave_float_complex_matrix::assign (const octave_value_list& idx, | 110 octave_float_complex_matrix::assign (const octave_value_list& idx, |
111 const FloatNDArray& rhs) | 111 const FloatNDArray& rhs) |
112 { | 112 { |
113 octave_idx_type len = idx.length (); | 113 octave_idx_type len = idx.length (); |
114 | 114 |
115 Array<idx_vector> ra_idx (len); | |
116 | |
115 for (octave_idx_type i = 0; i < len; i++) | 117 for (octave_idx_type i = 0; i < len; i++) |
116 matrix.set_index (idx(i).index_vector ()); | 118 ra_idx(i) = idx(i).index_vector (); |
117 | 119 |
118 ::assign (matrix, rhs); | 120 matrix.assign (ra_idx, rhs); |
119 } | 121 } |
120 | 122 |
121 bool | 123 bool |
122 octave_float_complex_matrix::valid_as_scalar_index (void) const | 124 octave_float_complex_matrix::valid_as_scalar_index (void) const |
123 { | 125 { |