Menu

#11 some operator* tweaking

open
GMTL (16)
5
2009-02-13
2005-02-25
trigras
No

there is a bunch of operator*
maybe they can be replaced with somethink like:

template <typename T, typename DATA_TYPE, unsigned
ROWS, unsigned COLS>
inline T operator*( const Matrix<DATA_TYPE, ROWS,
COLS>& matrix, const T& in)
{
T temporary;
return xform( temporary, matrix, in);
}

or even:

template <typename T, typename M>
inline T operator*( const M& matrix, const T& in )
{
T temporary;
return xform( temporary, matrix, in );
}

Discussion

  • Patrick Fewell-Hartling

    I think that this is worth pursuing, but it will not be as simple as what you have proposed. The issue is that there are overloads of operator* where a fundamental type is passed as an argument (such as scalar multiplication of a vector). Perhaps the solution is to make gmtl::xform() more general first so that all operator* uses end up getting handed off to an overload of gmtl::xform(). That is the first thing that comes to mind anyway.

     
  • Patrick Fewell-Hartling

    • assigned_to: nobody --> patrickh
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.