On Wed, 4 Oct 2017, oleg_komashko(a)ukr.net wrote:
Dear All,
To reproduce
x = {1,1}'
catch eval numhess(x,x'*x)
catch eval fdjac(x,x'*x)
catch eval fdjac(x,(x'*x))
function matrix i(matrix x)
return x
end function
eval numhess(x,i(x'*x))
eval fdjac(x,i(x'*x))
Why it may look trivial, I spent
some time to guess to use
identity function
I can imagine 2 possibilities:
1) to include native identity
function in hansl
2)fdjac and numhess should do
something similar inside
???
Turns out that it's easy enough to support the pattern you gave on
your third "eval" attempt above -- that is, you put the raw
expression into parentheses and we can then treat it as an
"anonymous inline function":
<hansl>
x = {1,1}'
eval numhess(x,(x'x))
eval fdjac(x,(x'x))
</hansl>
That's now in git. In principle we could parse the unparenthesized
case, but it would be a lot more fiddly and error-prone.
Allin