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

Home » Public Forums » archive » Bug/feature in matrix multiply
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: Bug/feature in matrix multiply [message #14675 is a reply to message #14582] Sat, 13 March 1999 00:00 Go to previous message
steinhh is currently offline  steinhh
Messages: 260
Registered: June 1994
Senior Member
> Mark Fardal (fardal@weka.phast.umass.edu) writes:
>
>> is the following a bug or feature? I don't understand why changing the
>> type of the array changes the dimensions of the result. Then again,
>> it's late on Friday, so my brain might just be mush.
>>
>> IDL> junk=fltarr(3)
>> IDL> junk=reform(junk,3,1)
>> IDL> help,junk
>> JUNK FLOAT = Array[3, 1]
>> IDL> help,[3.,2.,1.]#junk
>> <Expression> FLOAT = Array[1]
>> IDL> help,[3.d0,2.d0,1.d0]#junk
>> <Expression> DOUBLE = Array[3, 3]
>
> I don't know if it is a bug or a feature, but I
> agree that it is strange. But so is this command:
>
> junk = reform(junk, 3, 1)
>
> Do you mean this:
>
> junk = reform(junk, 1, 3)
>
> The latter will make a column vector, which makes more
> sense when multiplied by a row vector. What kind of result
> were you expecting? From my reading of the # operator
> I think the result with the floating array is correct.
> I don't have a clue why the double expression does what
> it does. :-(

Hint:

junk=reform(junk,3,1)
help,junk,double(junk)

8-)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: problems printing labels on graphs
Next Topic: Widget Buttons on Mac

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

Current Time: Thu Oct 09 22:33:15 PDT 2025

Total time taken to generate the page: 0.08452 seconds