org.clojars.punit-naik.clj-ml.utils.linear-algebra
eval-fn
(eval-fn eq x)
Evaluates a function ax^n+bx^n-1+...+z represented by a collection of it's coefficients [a b ... z]
at the value `x`
factors
(factors num)
(factors num decimal?)
Finds all the factors of a number
find-all-possible-solutions
(find-all-possible-solutions coefficients)
Given the a to z terms of the equation ax ^n+....+z=0 as a collection
This function finds all the possible roots of this equation
isa-solution?
(isa-solution? coefficients root)
Given the a to z terms of the quadratic equation ax^n+....+z=0 as a collection
And the root, this function checks if the same root is a solution for the equation or not
And returns the new reduced equation for finding the remaining roots using Synthetic Division
newtons-method
(newtons-method eq eq-deriv precision x-0)
Uses Newton's method to find the root of an equation ax^n+bx^n-1+...+z
Represented as a collection of it's coefficients [a b ... z]
It selects a root for precision upto the number set by the arg `precision`
x1 = x0 - ( f(x0) / f'(x0) )
solve-equation
multimethod
Given the a to z terms of the equation ax^n+....+z=0
This returns all the roots for the equation
solve-equation-newtons-method
(solve-equation-newtons-method coefficients)
solve-equation-synthetic-division
(solve-equation-synthetic-division coefficients)