Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Discussion] Implementing apart for symengine #1613

Open
jmig5776 opened this issue Sep 11, 2019 · 2 comments
Open

[Discussion] Implementing apart for symengine #1613

jmig5776 opened this issue Sep 11, 2019 · 2 comments

Comments

@jmig5776
Copy link
Contributor

I was looking up the code and algorithm for apart function in SymPy to be implemented in Symengine. I have some doubts to discuss because I am a beginner in development in c++, I read about RCP to get a better understanding. These are the points to discuss:

  • What should be the input and output APIs for this apart function
    In Sympy it had these kind of APIs
def apart(f, x=None, full=False, **options):
    Compute partial fraction decomposition of a rational function.

what f should be defined in symengine (uratpoly or uintpoly or Mexprpoly) it is confusing as things are not clear due to lack of documentation.

  • What it should named and the class name and rest other things.
  • And somewhere in apart function of SymPy there is a check for multivariate like this
if P.is_multivariate:
        fc = f.cancel()
        if fc != f:
            return apart(fc, x=x, full=full, **_options)

        raise NotImplementedError(
            "multivariate partial fraction decomposition")

As far as I know, currently symengine has only focussed with univariate. Am I right?

  • Please let me know what other things i should keep in mind if you have a suggestion for me.

References
#1324

CC @certik @isuruf

@certik
Copy link
Contributor

certik commented Sep 11, 2019

Thanks for starting to look at things. The input at the highest level should be const RCP<const Basic> &f. Then it should convert it to polynomials (if needed) internally, do the "apart" algorithm, and then return the object back as RCP<const Basic>.

@isuruf which polynomial class should this use for univariate polynomials?

@jmig5776 I would suggest you get some prototype that only works for a small subset of expressions, and then we'll iteratively improve it. Thank you again for working on this, this will be a very useful addition to SymEngine.

@jmig5776
Copy link
Contributor Author

Sure @certik My exams just got over today I will soon be sending PR regarding that. I am sorry for the delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants