octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Tracking bug #38128 / Overloaded vertcat() not called in some cases


From: Julien Bect
Subject: Tracking bug #38128 / Overloaded vertcat() not called in some cases
Date: Mon, 28 Jan 2013 05:42:27 -0800 (PST)

Julien Bect wrote
> I have recently posted a bug report concerning an unexpected behaviour of
> the "old" class system (http://savannah.gnu.org/bugs/?38128).
> [snip]

I have tracked the problem down to tm_const::init() in pt-mat.cc.

If x is a (scalar) object of class A and y a 3x3 matrix, then [x; y] causes
an error in tm_const::init(), more precisely in dim_vector::hvcat(), because
elements of size 1x1 and 3x3 cannot be concatenated vertically.

My overloaded vertcat() function for class A therefore never has a chance to
be called, even though it knows how to handle this case. (Note: overloading
size() for class A doesn't fix the problem.)

Anybody has an idea about what a proper fix should be ? There is a special
case in tm_const::init() to handle the vertical concatenation of strings
(which are allowed to have differing lengths). Perhaps should there be
another special case for the situation where at least one element is an
object (any_class flag) ?



--
View this message in context: 
http://octave.1599824.n4.nabble.com/Tracking-bug-38128-Overloaded-vertcat-not-called-in-some-cases-tp4649193.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]