Skip to content

Instantly share code, notes, and snippets.

@PoslavskySV
Created April 11, 2018 13:20
Show Gist options
  • Save PoslavskySV/bab53af9066a44b44c68f9a658305866 to your computer and use it in GitHub Desktop.
Save PoslavskySV/bab53af9066a44b44c68f9a658305866 to your computer and use it in GitHub Desktop.
factorize from form file
import scala.io.Source
val exprStr = Source.fromFile("expression.txt").mkString
val polyStr = exprStr.replace("L num = ", "").replace("\\","").replace("\n","").replace(";","")
implicit val ring = MultivariateRing(Z, Array("s", "t", "m", "e", "c"))
val poly = ring(polyStr)
val factors = Factor(poly)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment