This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: random numbers in bulk


On Sat, Aug 25, 2012 at 8:29 PM, Paolo Carlini <paolo.carlini@oracle.com> wrote:
> Understood, but you do *not* loose performance by having those fill functions templates,

Let's see.  The prototypes will then be something like this:

  template<typename _RealType = double>
    class normal_distribution
    {

      template<typename _UniformRandomNumberGenerator,
	       typename _OutputIterator>
	void
	fill(_OutputIterator __f, _OutputIterator __t,
	     _UniformRandomNumberGenerator& __urng,
	     const param_type& __p);
    };

Now I want to define a specialized function which works for a double
iterator and all RNGs.  That's not possible because it means partial
specialization.

Therefore I'd have to add another member function to the class.  If
this is what is wanted I can do this (in fact, I have the code ready).
 It just looks worse because the special functions are in some cases
architecture-specific.  This means the code will be littered with
arch-specific code.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]