Unless the vectors in question are small, the allocation of a one-element array 
is unlikely to be significant. If the vectors are small, writing out the dot 
product yourself is likely to be faster; In fact, it may be faster anyway.

> On Jan 2, 2014, at 7:38 AM, Ivar Nesje <[email protected]> wrote:
> 
> Thanks for correcting me. I should have checked better before answering, 
> especially because it is so simple in Julia to follow the functions and see 
> what actually gets calculated.
> 
> kl. 13:29:49 UTC+1 torsdag 2. januar 2014 skrev Andreas Noack Jensen følgende:
>> 
>> The problem here is that the method in operators.jl is 
>> At_mul_B(a,b)=transport(a)*b and therefore there is a transposed copy in the 
>> calculation.
>> 
>> 
>> 2014/1/2 Ivar Nesje <[email protected]>
>>> Julia does part of transformation automatically for you.
>>> 
>>> If you look at
>>> 
>>> julia> @which a.'*b
>>> At_mul_B(a,b) at operators.jl:122
>>> 
>>> You can see that the call is automatically rewritten to At_mul_B(a,b) 
>>> without making a transposed copy.
>>> 
>>> I am not sure what you can do about the result being a 1 element 
>>> Array{Complex{Float64},1} instead of just a Complex{Float64}.
>>> 
>>> Ivar
>>> 
>>> kl. 13:02:39 UTC+1 torsdag 2. januar 2014 skrev Sheehan Olver følgende:
>>>> 
>>>> I want to do
>>>> 
>>>>   a.'*b
>>>> 
>>>> where a and b are Vector{Complex}, but this returns an Array, not a 
>>>> constant, and probably does unneccesary memory allocation for when 
>>>> constructing  a.'
>>>> 
>>>> If it was 
>>>> 
>>>>   a'*b 
>>>> 
>>>> I can just replace it with dot(a,b).  Is there an equivalent that doesn't 
>>>> conjugate the first argument?
>> 
>> 
>> 
>> -- 
>> Med venlig hilsen
>> 
>> Andreas Noack Jensen

Reply via email to