octave-maintainers
[Top][All Lists]
Advanced

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

Re: 2.9.15 --> 3.0


From: John W. Eaton
Subject: Re: 2.9.15 --> 3.0
Date: Mon, 08 Oct 2007 17:44:31 -0400

On  8-Oct-2007, David Bateman wrote:

| John W. Eaton wrote:
| > BTW, I don't see that the dim_vector args for Array2-based classes are
| > checked to ensure that they are only 2D.  Should they be?  Hmm.
| > Something else to look at later.
| 
| Humm, yes I suppose that should be checked.. They all go through either
| 
| Array2<T>::Array2 (const dim_vector&)
| 
| or
| 
| Array2<T>::Array2 (const dim_vectore&, const T&)
| 
| and so the test for a 2-D matrix could be isolated to just these
| constructors. Something like
| 
| Array2<T>::Array2 (const dim_vector& dv)
|   : Array<T> (dv)
| {
|   if (dv.length () != 0)
|     (*current_liboctave_error_handler) ("too many dimensions");
| }
| 
| Array2<T>::Array2 (const dim_vector& dv, const T& val)
|   : Array<T> (dv)
| {
|   if (dv.length () != 0)
|     (*current_liboctave_error_handler) ("too many dimensions");
|   else
|     Array<T>::fill (val);
| }
| 
| should be all that is needed. Want to add that too?


I guess that would be OK as these cases should never happen inside
Octave itself (file under: famous last words).

jwe


reply via email to

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