Mercurial > hg > octave-lyh
comparison libinterp/parse-tree/pt-mat.cc @ 16140:797ac81586d1
Modify pt-mat.cc to solve a problem related to vertcat/horzcat overloading.
* pt-mat.cc (tm_row_const::tm_row_const_rep::init): Do not check dimension
consistency when at least one of the elements is an object (this was
preventing horzcat overloading from working properly, see bug #38128).
(tm_const::init): Same thing for vertical concatenation (this was
preventing vertcat overloading from working properly, see bug #38128).
* test/classes/classes.tst: Add tests for the vertical and horizontal
concatenation of objects when neither vertcat() nor horzcat() is
overloaded.
author | Julien Bect <julien.bect@supelec.fr> |
---|---|
date | Tue, 26 Feb 2013 12:06:45 +0100 |
parents | 2fc554ffbc28 |
children | 70f465930546 |
comparison
equal
deleted
inserted
replaced
16114:73a21ade0b6b | 16140:797ac81586d1 |
---|---|
400 if (first_elem) | 400 if (first_elem) |
401 { | 401 { |
402 first_elem = false; | 402 first_elem = false; |
403 dv = this_elt_dv; | 403 dv = this_elt_dv; |
404 } | 404 } |
405 else if (! dv.hvcat (this_elt_dv, 1)) | 405 else if ((! any_class) && (! dv.hvcat (this_elt_dv, 1))) |
406 { | 406 { |
407 eval_error ("horizontal dimensions mismatch", dv, this_elt_dv); | 407 eval_error ("horizontal dimensions mismatch", dv, this_elt_dv); |
408 break; | 408 break; |
409 } | 409 } |
410 } | 410 } |
642 // rows of unequal length. | 642 // rows of unequal length. |
643 if (this_elt_nc > cols ()) | 643 if (this_elt_nc > cols ()) |
644 dv(1) = this_elt_nc; | 644 dv(1) = this_elt_nc; |
645 dv(0) += this_elt_nr; | 645 dv(0) += this_elt_nr; |
646 } | 646 } |
647 else if (! dv.hvcat (this_elt_dv, 0)) | 647 else if ((!any_class) && (!dv.hvcat (this_elt_dv, 0))) |
648 { | 648 { |
649 eval_error ("vertical dimensions mismatch", dv, this_elt_dv); | 649 eval_error ("vertical dimensions mismatch", dv, this_elt_dv); |
650 return; | 650 return; |
651 } | 651 } |
652 } | 652 } |