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
{{ message }}
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.
Once a Polynomial kernel has been created with the default degree of zero, this can never be changed. Trivial example:
public static void Main(string[] args)
{
var polynomial = new Polynomial();
polynomial.Degree = 3;
}
Expected result: polynomial degree is changed to 3 as that is a valid value.
Actual result: System.ArgumentOutOfRangeException 'Degree must be positive'
Fairly obviously being caused by the check at Polynomial.cs:72:
if (degree <= 0)
throw new ArgumentOutOfRangeException("value", "Degree must be positive.");
and the obvious fix would be to make the check be on value (the new value) rather than degree (the old value). I'll make a PR if you want one, but doesn't really seem worth it for such a small change.
The text was updated successfully, but these errors were encountered:
Thanks a lot for opening the issue. Indeed, that was a silly mistake, probably originated by copying and pasting from a previous argument check coming from the class constructor's body.
I will commit a fix soon. If you find any other similar issues, please let me know.
Once a Polynomial kernel has been created with the default degree of zero, this can never be changed. Trivial example:
Expected result: polynomial degree is changed to 3 as that is a valid value.
Actual result: System.ArgumentOutOfRangeException 'Degree must be positive'
Fairly obviously being caused by the check at Polynomial.cs:72:
and the obvious fix would be to make the check be on
value
(the new value) rather thandegree
(the old value). I'll make a PR if you want one, but doesn't really seem worth it for such a small change.The text was updated successfully, but these errors were encountered: