Mercurial > octave-nkf
comparison liboctave/Array.cc @ 4711:5101dffb4178
[project @ 2004-01-22 19:30:54 by jwe]
author | jwe |
---|---|
date | Thu, 22 Jan 2004 19:30:54 +0000 |
parents | cf141edca935 |
children | fe25e290fafb |
comparison
equal
deleted
inserted
replaced
4710:48191fcee04d | 4711:5101dffb4178 |
---|---|
2731 | 2731 |
2732 int n = Array<LT>::get_size (frozen_len); | 2732 int n = Array<LT>::get_size (frozen_len); |
2733 | 2733 |
2734 Array<int> result_idx (lhs_dims.length (), 0); | 2734 Array<int> result_idx (lhs_dims.length (), 0); |
2735 | 2735 |
2736 Array<int> elt_idx; | |
2737 | |
2738 RT scalar = rhs.elem (0); | 2736 RT scalar = rhs.elem (0); |
2739 | 2737 |
2740 for (int i = 0; i < n; i++) | 2738 for (int i = 0; i < n; i++) |
2741 { | 2739 { |
2742 elt_idx = get_elt_idx (idx, result_idx); | 2740 Array<int> elt_idx = get_elt_idx (idx, result_idx); |
2743 | 2741 |
2744 dim_vector lhs_inc; | 2742 lhs.checkelem (elt_idx) = scalar; |
2745 lhs_inc.resize (lhs_dims.length ()); | |
2746 | |
2747 for (int j = 0; j < lhs_dims.length (); j++) | |
2748 lhs_inc(j) = lhs_dims(j) + 1; | |
2749 | |
2750 if (index_in_bounds(elt_idx, lhs_inc)) | |
2751 lhs.checkelem (elt_idx) = scalar; | |
2752 else | |
2753 lhs.checkelem (elt_idx) = rfv; | |
2754 | 2743 |
2755 increment_index (result_idx, frozen_len); | 2744 increment_index (result_idx, frozen_len); |
2756 } | 2745 } |
2757 } | 2746 } |
2758 else if (rhs_dims.length () > 1) | 2747 else if (rhs_dims.length () > 1) |