These are chat archives for symengine/symengine

17th
May 2016
Srajan Garg
@srajangarg
May 17 2016 04:32
@isuruf What does codecov/changes measure? and what does codecov/project?
Isuru Fernando
@isuruf
May 17 2016 04:32
codecov/changes is supposed to measure the changes in the PR. codecov is not working properly right no
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
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
Didn't understand you
What's the problem with just UnivariateExprPolynomial &operator+(const UnivariateExprPolynomial &other)?
Isuru Fernando
@isuruf
May 17 2016 07:12
Let b be a polynomial. What is the function that gives 1 + b?
Srajan Garg
@srajangarg
May 17 2016 07:13
Oh! Ok thanks!
One more question, how will b + 1 be handled?
Isuru Fernando
@isuruf
May 17 2016 07:15
Both b + 1 and 1 + b are handled in friend UnivariateExprPolynomial operator+(a, b)
Srajan Garg
@srajangarg
May 17 2016 07:17
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
yes
Srajan Garg
@srajangarg
May 17 2016 07:18
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)?
See the order described in section, "Call to an overloaded operator"
Srajan Garg
@srajangarg
May 17 2016 11:23
@isuruf Should I start with implementing overloads for UnivariateIntPolynomial?
Srajan Garg
@srajangarg
May 17 2016 14:51
Should I?
Srajan Garg
@srajangarg
May 17 2016 16:25
@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
@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