octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #50256] Wrong data type for rand ('twister')


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #50256] Wrong data type for rand ('twister')
Date: Fri, 9 Mar 2018 14:33:41 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

Update of bug #50256 (project octave):

                 Release:                     dev => 4.2.0                  

    _______________________________________________________

Follow-up Comment #8:

To eliminate the OCTAVE_LOCAL_BUFFER copy, how about something like this?


void
octave_rand::set_internal_state (const uint32NDArray& s)
{
  octave_idx_type len = s.numel ();

  const uint32_t *psdata = reinterpret_cast<const uint32_t *> (s.data ());

  if (len == MT_N + 1 && psdata[MT_N] <= MT_N && psdata[MT_N] > 0)
    oct_set_state (psdata);
  else
    oct_init_by_array (psdata, len);
}


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?50256>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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