comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » regress
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: regress [message #65785 is a reply to message #65671] Thu, 19 March 2009 07:37 Go to previous messageGo to previous message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
On Mar 17, 6:47 pm, Jeremy Bailin <astroco...@gmail.com> wrote:
> On Mar 17, 5:51 pm, David Fanning <n...@dfanning.com> wrote:
>
>
>
>> anniebry...@gmail.com writes:
>>> I have two 2D arrays I would like to regress. Both were created with
>>> the variance command and are intarr(673,274). Does one of these need
>>> to be a vector? Both need to be a vector? If so, is there a way to
>>> convert them from an array to a vector? I watched someone do this
>>> very quickly yesterday, but can not remember how.
>
>> Whoops, forgot the DIMENSIONS keyword:
>
>> s = Size(array, /Dimensions)
>> vector = Reform(array, s[0]*s[1])
>
>> Cheers,
>
>> David
>> --
>> David Fanning, Ph.D.
>> Coyote's Guide to IDL Programming (www.dfanning.com)
>> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
>
> Incidentally, I've often wondered if that was any more or less
> efficient than
>
> vector = (s)[*]
>
> Anyone have any thoughts?
>
> -Jeremy.

A simple test seems to suggest that there's no speed difference:

IDL> n1=512l & n2=256l
IDL> bigarray = fltarr(n1,n2)
IDL> s1=systime(/sec) & for i=1,10000 do vector=reform(bigarray,n1*n2)
& s2=systime(/sec)
IDL> print, s2-s1
2.8659091
IDL> s3=systime(/sec) & for i=1,10000 do vector=(bigarray)[*] &
s4=systime(/sec)
IDL> print, s4-s3
2.8190870

Not sure about internal memory usage...

-Jeremy.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Writing BIG RGB GEOTIFF
Next Topic: IDL version

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:29:54 PDT 2025

Total time taken to generate the page: 0.00374 seconds