These are chat archives for symengine/symengine

17th
May 2016
Srajan Garg
@srajangarg
May 17 2016 04:32 UTC
@isuruf What does codecov/changes measure? and what does codecov/project?
Isuru Fernando
@isuruf
May 17 2016 04:32 UTC
codecov/changes is supposed to measure the changes in the PR. codecov is not working properly right no
Srajan Garg
@srajangarg
May 17 2016 07:01 UTC
Why has the operator+ been declared as an external friend function, friend UnivariateExprPolynomial operator+(a, b) instead of UnivariateExprPolynomial &operator+(a) ?
Like we usually do?
Isuru Fernando
@isuruf
May 17 2016 07:09 UTC
For a + b to work where a is of a type implicitly converted to a UnivariateExprPolynomial and b is a UnivariateExprPolynomial
Srajan Garg
@srajangarg
May 17 2016 07:11 UTC
Didn't understand you
What's the problem with just UnivariateExprPolynomial &operator+(const UnivariateExprPolynomial &other)?
Isuru Fernando
@isuruf
May 17 2016 07:12 UTC
Let b be a polynomial. What is the function that gives 1 + b?
Srajan Garg
@srajangarg
May 17 2016 07:13 UTC
Oh! Ok thanks!
One more question, how will b + 1 be handled?
Isuru Fernando
@isuruf
May 17 2016 07:15 UTC
Both b + 1 and 1 + b are handled in friend UnivariateExprPolynomial operator+(a, b)
Srajan Garg
@srajangarg
May 17 2016 07:17 UTC
So, if any of the arguments can be automatically 'casted' (or are already of) typeA, then operator+(typeA a, typeA b)will be called?
Isuru Fernando
@isuruf
May 17 2016 07:17 UTC
yes
Srajan Garg
@srajangarg
May 17 2016 07:18 UTC
And this is possible, because UnivariateExprPolynomial a = 1 works and has been defined by us, right?
Also, how does the compiler decide which function to call on say 1+1. There's both operator+(typeA a, typeA b) and operator+(int a, int b)?
Isuru Fernando
@isuruf
May 17 2016 07:25 UTC
See the order described in section, "Call to an overloaded operator"
Srajan Garg
@srajangarg
May 17 2016 11:23 UTC
@isuruf Should I start with implementing overloads for UnivariateIntPolynomial?
Srajan Garg
@srajangarg
May 17 2016 14:51 UTC
Should I?
Srajan Garg
@srajangarg
May 17 2016 16:25 UTC
@irislq Why wasn't operator overloading done at the (current) UnivariatePolynomial level, and instead done at UnivariateExprPolynomial level?
In theory, we could have just written the same (overloading) functions in the outer class, right?
Iris Lui
@irislq
May 17 2016 17:43 UTC
@srajangarg I think it's because UnivariateExprPolynomial is also used in UnivariateSeries, and UnivariateSeries already has some of the information that's in UnivariatePolynomial.
In theory, I also think (high level wise), it can be done, but just having overloaded operators for the dictionary things faster/lighter