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
I forked the repo and I'm trying to add min and max functions.
I'm completely new to F# and I'm struggling with a compile error (that was obviously not present before my code).
As a total noob I approached the problem by trying to do the same as it was done for the function atan2 as both min and max are functions that take 2 arguments (at least?).
Is this the correct way to do it?
Can you give me any suggestion on how to fix the issue?
[...]\Workspace\mathnet-symbolics\src\Symbolics\Polynomial.fs(123,69): error FS0001: Type mismatch. Expecting a� 'System.Numerics.BigInteger * (Expression * System.Numerics.BigInteger) list -> System.Numerics.BigInteger * (Expression * System.Numerics.BigInteger) list -> System.Numerics.BigInteger * (Expression * System.Numerics.BigInteger) list' �but given a� 'BigInteger * (Expression * Expression) list -> BigInteger * (Expression * Expression) list -> System.Numerics.BigInteger * (Expression * Expression) list' �The type 'System.Numerics.BigInteger' does not match the type 'Expression'
[<CompiledName("CommonMonomialFactors")>]letcommonMonomialFactors xs =letnormalizePowers= List.map (fun(r,p)-> pow r (fromInteger p))letdenormalizePowers= List.map (function| PosIntPower (r,(Integer n))->(r, n.Numerator)| x ->(x,1I))letmonomialFactors x =letn,xs = Algebraic.factorsInteger x
n, denormalizePowers xs
letintersect((n1:BigInteger),x1)((n2:BigInteger),x2)=letn' = Euclid.GreatestCommonDivisor (n1, n2)letx' = x1 |> List.choose (fun(r1,p1)-> x2 |> List.tryPick (fun(r2,p2)->if r2 = r1 then Some (r1, min p1 p2)else None))
n', x'
let(n,x')= xs |> List.map monomialFactors |> List.reduce intersect ///// <- Compile error on _intersect_(fromInteger n)::(normalizePowers x')|> product
The text was updated successfully, but these errors were encountered:
Hello, is there a way to get the maximum and minimum value of a polynomial in a given range using this library? example "x^2 -5*x +3" max min in the range 0 < x < 4 in c#
Hi!
I forked the repo and I'm trying to add min and max functions.
I'm completely new to F# and I'm struggling with a compile error (that was obviously not present before my code).
As a total noob I approached the problem by trying to do the same as it was done for the function atan2 as both min and max are functions that take 2 arguments (at least?).
Is this the correct way to do it?
Can you give me any suggestion on how to fix the issue?
This is the link to the commit I made:
eb74512
I get the error
The text was updated successfully, but these errors were encountered: