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: David Bateman
Subject: Re: [CHANGESET]: First attempt at a single precision type.
Date: Wed, 30 Apr 2008 19:04:38 +0200
User-agent: Thunderbird 2.0.0.12 (X11/20080306)

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?

D


reply via email to

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