Currently, all functions related to Factor creation take keys_to_func and keys_to_optimize, down to the very last constructor.
However, many intermediate functions really don’t care about these two vectors.
All they care about is how to do the dispatch given the input type to a callable.
So I refactored some of these functions and let them return the function to the Factor constructor rather than directly return a Factor.
This would make future refactoring much easier to do.
Currently, all functions related to Factor creation take
keys_to_func
andkeys_to_optimize
, down to the very last constructor.However, many intermediate functions really don’t care about these two vectors. All they care about is how to do the dispatch given the input type to a callable.
So I refactored some of these functions and let them return the function to the Factor constructor rather than directly return a Factor. This would make future refactoring much easier to do.