octave-maintainers
[Top][All Lists]
Advanced

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

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


From: Julien Bect
Subject: Re: Tracking bug #38128 / Overloaded vertcat() not called in some cases
Date: Wed, 30 Jan 2013 06:19:37 -0800 (PST)

Julien Bect wrote
> 
> 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) ?

I have uploaded a patch, which implements this idea (i.e., removes dimension
consistency checking when any_class is true) :

https://savannah.gnu.org/patch/?7935

This seems to fix the vertcat/horzcat problem. Note that I haven't been able
to run a full "make check", though (it segfaults when I reach the tests for
dblquad.m, but this is not related to my patch).

Julien



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


reply via email to

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