octave-maintainers
[Top][All Lists]
Advanced

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

Re: [CHANGESET]: First attempt at a single precision type.


From: John W. Eaton
Subject: Re: [CHANGESET]: First attempt at a single precision type.
Date: Wed, 30 Apr 2008 13:14:40 -0400

On 30-Apr-2008, David Bateman wrote:

| John W. Eaton wrote:
| > I would expect we could handle those with simple inline wrappers
| > defined in .h files.  For example, see the attached patch.  It would
| > not be difficult to extend this to mixed types (complex/float/double),
| > and to also handle the return type automatically by using a traits
| > class.  It will take a little more work to handle stacking matrices
| > and row/column vectors and diag matrices.
| >
| >   
| I have a problem with this for methods like
| 
| ComplexMatrix ComplexMatrix::stack (const Matrix&) const;
| 
| I'd like to use a template in MArray2 like
| 
| template <class U>
| MArray<T> MArray<T>::stack const (const MArray<U>&) const;
| 
| and final hand this off to a similar template method in  the Array class
| that does the type coercing, and then define
| 
| ComplexMatrix ComplexMatrix::stack (const Matrix&) const
| {
|   return MArray2<T>::stack (a);
| }
| 
| however the MArray2 template method doesn't appear to be found for this
| case. Any ideas how such things should be written?

Did you mean to write this as

  ComplexMatrix ComplexMatrix::stack (const Matrix&) const
  {
    return MArray2<ComplexMatrix>::stack (a);
  }

in the ComplexMatrix class?

jwe


reply via email to

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