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

David Bateman adb014 at gmail.com
Wed Apr 30 12:04:38 CDT 2008


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


More information about the Octave-maintainers mailing list