octave-maintainers
[Top][All Lists]
Advanced

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

Re: [Patch] fem-fenics patches


From: Daniel Kraft
Subject: Re: [Patch] fem-fenics patches
Date: Wed, 5 Mar 2014 14:21:55 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

Hi!

On 2014-03-05 13:45, c. wrote:
> I expect
> 
>    feval (@sin, pi/2)
> 
> to work the same as
> 
>    feval (@sin, linspace (0, 2*pi, 100))
> 
> even though I'm passing a list of points rather than one single point.
> note that multiple points are specified as one single argument to the 
> function "sin".

The fundamental difference here is that sin takes *a single* argument,
while func takes *two or three* (at least if one thinks of the naive
form "func(x, y)" and not as [x, y] being necessarily a single argument
as a vector).

A better comparison would be atan2, IMHO, which is called as

  feval (@atan2, 1, 0)
  feval (@atan2, [1, 0], [0, 1])

and not

  feval (@atan2, [1, 0])
  feval (@atan2, [1, 0; 0, 1]).

It also works with

  A = rand (2, 2);
  B = rand (2, 2);
  feval (@atan2, A, B),

where it is not possible to use your proposed syntax without reshaping
the arguments.

That's my point.

> so I expect 
> 
>   feval (func, [0; 1])
> 
> to work the same as
> 
>   feval (func, [0, 0; 0, 1])
> 
> why is that so strange?

I have nothing to oppose to allowing this extension also, but believe
that it makes sense to also allow the form described above.

Yours,
Daniel

-- 
http://www.domob.eu/
OpenPGP: 901C 5216 0537 1D2A F071  5A0E 4D94 6EED 04F7 CF52
Namecoin: id/domob -> https://nameid.org/?name=domob
--
Done:  Arc-Bar-Cav-Hea-Kni-Ran-Rog-Sam-Tou-Val-Wiz
To go: Mon-Pri

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


reply via email to

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