Hi,
as long as I understand docs, qform() is not an option if A is identity.
But what if it is diagonal:
<hansl>
set verbose off
r = 20
c = 20
N = 10^6
x = mnormal(r, c)
A = I(c)
A[diag] = mnormal(c, 1)
set stopwatch
loop N
r1 = x'*A*x
endloop
printf "Total time: %f\n", $stopwatch
loop N
r2 = qform(x', A)
endloop
printf "Total time: %f\n", $stopwatch
</hansl>
On my no-so-new i7 8th gen (Haswell) I'm getting:
###########
gretl version 2024d-git
Current session: 2024-11-06 12:33
Total time: 6.207188
Total time: 6.925140
###########
Is that expected?
Marcin