# FactoredFunctionUtilities RΒΆ

FactoredFunctionUtilities implements some utility functions for manipulating factored objects.

- mergeFactors: (Factored R, Factored R) -> Factored R
`mergeFactors(u, v)`

is used when the factorizations of spadvar{`u`

} and spadvar{`v`

} are known to be disjoint, e.g. resulting from a content/primitive part split. Essentially, it creates a new factored object by multiplying the units together and appending the lists of factors.

- refine: (Factored R, R -> Factored R) -> Factored R
`refine(u, fn)`

is used to apply the function userfun{`fn`

} to each factor of spadvar{`u`

} and then build a new factored object from the results. For example, if spadvar{`u`

} were created by calling`nilFactor(10, 2)`

then`refine(u, factor)`

would create a factored object equal to that created by`factor(100)`

or`primeFactor(2, 2) * primeFactor(5, 2)`

.