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
The function linAlg::dot needs to have its return type changed to include float and possible int and/or other scalar types. It is possible to multiply two vectors and get a scalar result. E.g., this code in matlab/octave returns a scalar, and blas returns a float:
octave:25>m1= [123]
m1 =12 3octave:26>m2= [1;2;3]
m2 =123octave:27>m1*m2
ans =14
but due to the narrow return type restriction in linAlgb::dot, it throws this error:
PHP Fatal error: Uncaught TypeError: Np\vector::dot(): Return value must be of type Np\matrix|Np\vector, float returned in /Users/sneakyimp/Desktop/biz/machine-learning/np/vendor/ghostjat/np/src/linAlgb/linAlg.php:34
Simply modifying the linAlg::dot function as follows should fix this particular error:
The text was updated successfully, but these errors were encountered:
sneakyimp
changed the title
linAlb::dot() method has return type too narrowly declared
linAlg::dot() method has return type too narrowly declared
Dec 27, 2022
The function linAlg::dot needs to have its return type changed to include float and possible int and/or other scalar types. It is possible to multiply two vectors and get a scalar result. E.g., this code in matlab/octave returns a scalar, and blas returns a float:
This code should return 14:
but due to the narrow return type restriction in linAlgb::dot, it throws this error:
Simply modifying the linAlg::dot function as follows should fix this particular error:
The text was updated successfully, but these errors were encountered: