[macstl-dev] macstl wrapper

Simon P psimonp at yahoo.com
Fri Jun 3 00:04:18 WST 2005

  • Previous message: [macstl-dev] Re: Question
  • Next message: [macstl-dev] macstl wrapper
  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]


Hi,

I have a wrapper for macstl valarray for 2D and 3D
arrays:

template<class T>
class NumericArray2
{


private:

   stdext::valarray<float> _data;

}

I also define some operators that are just wrappers
around valarray's operators:

template<class T>
NumericArray2<T>
operator*( const NumericArray2<T>& op1, const
NumericArray2& op2 )
{
return NumericArray2<T>( op1 * op2 );
}

When I run this code, raw macstl runs about 8 times
faster than
when I run it with NumericArray2. It seems that
there's an extra copy that occurs with the wrapper
that doesn't happen with macstl valarray.

Any thoughts or ideas as to how to improve this such
that there's no or little overhead?

Thanks,

Simon



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



  • Previous message: [macstl-dev] Re: Question
  • Next message: [macstl-dev] macstl wrapper
  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

More information about the macstl-dev mailing list