You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using “least_squares_solver” I get a compilation error.
Here is an example:
import arraymancer
var a = [[1.0, 2.0], [1.0, 7.0]].toTensor
var b = [2.0, 4.0].toTensor
echoleastSquaresSolver(a, b)
And here is the error:
/...../.nimble/pkgs/arraymancer-0.6.2/arraymancer/linear_algebra/least_squares.nim(16, 8) template/generic instantiation of `gelsd` from here
/....../.nimble/pkgs/arraymancer-0.6.2/arraymancer/linear_algebra/helpers/least_squares_lapack.nim(75, 85) Error: type mismatch: got<int32, intliteral(2)>butexpected one of:
template`^`(x: int): BackwardsIndexfirsttypemismatchat position: 2extraargument given
2othermismatchingsymbolshavebeen suppressed; compilewith--showAllMismatches:ontosee them
expression: 26'i32^2
Looking into “arraymancer/linear_algebra/helpers/least_squares_lapack.nim” it appears that the error occurs in this line:
lwork =max(1, 12* m +2* m * smlsiz +8* m * nlvl + m * nrhs + (smlsiz +1) ^2)
and especially with (smlsiz + 1) ^ 2.
It looks like the operator ^ for integers is not available at this point.
I have been able to solve the issue either by replacing (smlsiz + 1) ^ 2 with (smlsiz + 1) * (smlsiz + 1) or by adding somewhere from math import `^` .
Of course, we can import math before importing arraymancer which solves the problem.
The text was updated successfully, but these errors were encountered:
Hi,
When using “least_squares_solver” I get a compilation error.
Here is an example:
And here is the error:
Looking into “arraymancer/linear_algebra/helpers/least_squares_lapack.nim” it appears that the error occurs in this line:
and especially with
(smlsiz + 1) ^ 2
.It looks like the operator
^
for integers is not available at this point.I have been able to solve the issue either by replacing
(smlsiz + 1) ^ 2
with(smlsiz + 1) * (smlsiz + 1)
or by adding somewherefrom math import `^`
.Of course, we can import math before importing arraymancer which solves the problem.
The text was updated successfully, but these errors were encountered: