[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
- Re: 2.9.15 --> 3.0, (continued)
Re: 2.9.15 --> 3.0, John Swensen, 2007/10/07
Re: 2.9.15 --> 3.0, David Bateman, 2007/10/08
2.9.15 --> 3.0, John W. Eaton, 2007/10/12