These are chat archives for symengine/symengine

13th
May 2016
Srajan Garg
@srajangarg
May 13 2016 04:37
@isuruf Can you please fetch my branch basic_wrapper from my fork at git@github.com:srajangarg/symengine.git. I have tried to implement the UnivariateIntBase and UnivariateInt class. I have removed the other tests for now (and added a new folder to test the new class tests/polynomial/univariate_int_generic.cpp) I am not able to figure out what's going wrong. If you run that test executable, the variable P has the right value in it's container! But the print function isn't responding correctly! I have put may print statements in the constructors and other places to help debug, but I still can't figure it out.
Isuru Fernando
@isuruf
May 13 2016 04:38
Do you have travis configured for your fork?
Srajan Garg
@srajangarg
May 13 2016 04:38
Yes
Isuru Fernando
@isuruf
May 13 2016 04:39
Looking into it nw
Charles Chen
@chenchfort
May 13 2016 05:53
Should we just use UnivariatePolynomial in UnivariateSeries?
Isuru Fernando
@isuruf
May 13 2016 05:54
@chenchfort, you can use UnivariateExprPolynomial which has overloaded operators
Charles Chen
@chenchfort
May 13 2016 05:54
So what’s the purpose of UnivariatePolynomial now?
Isuru Fernando
@isuruf
May 13 2016 05:54
It's going to be used in other parts of symbolic expressions
Charles Chen
@chenchfort
May 13 2016 05:55
Also for getting something like degree, it would be inconvenient to not have get_degree(). Should those be implemented into UnivariateExprPolynomial?
Isuru Fernando
@isuruf
May 13 2016 05:55
Yes
Srajan Garg
@srajangarg
May 13 2016 06:05
Yes, but RCP<const UnivariateInt> P has the right container_ stored in it right?
Because the copy of the dict it returned, was as expected
Srajan Garg
@srajangarg
May 13 2016 06:06
Oh, so it's messing up in the print function, where it calls get_container? How was this handled in UnivariateIntPolynomial then?/
It is the same for UnivariateIntPolynomial right
Isuru Fernando
@isuruf
May 13 2016 06:07
No, there's a subtle difference
Srajan Garg
@srajangarg
May 13 2016 06:09
What is it?
Isuru Fernando
@isuruf
May 13 2016 06:09
UnivariateIntPolynomials container is map_int_Expr but the method signature is inline const map_int_Expr &get_dict() const
When it is not a reference to the internal container, each time you are calling get_container will give a new copy of the container.
Srajan Garg
@srajangarg
May 13 2016 06:15
Right, makes sense
What does the above method signify?
const Container &get_container() const
Isuru Fernando
@isuruf
May 13 2016 06:15
So, in the for loop get_container().rbegin() and get_container().rend() are pointers to different containers
Yes
Srajan Garg
@srajangarg
May 13 2016 06:16
Ohhh
Got it, but the new method, can you tell me what each keyword is doing
More specifically, the first const and the &
Isuru Fernando
@isuruf
May 13 2016 06:17
First const means that the returned Container is a constant value and the caller can't change the value returned
& means a reference to the object, so that we are not returning a copy of the container, but only a pointer to a container
Last const means the polynomial object is not changed when this method is called
Srajan Garg
@srajangarg
May 13 2016 06:20
So, this is sort of like passing a const &x as an argument to a function. But here, it's just a return value of the function.
Isuru Fernando
@isuruf
May 13 2016 06:20
yes
Srajan Garg
@srajangarg
May 13 2016 06:21
Thanks!
Charles Chen
@chenchfort
May 13 2016 07:18
What happened to map_int_Expr_eq?
Isuru Fernando
@isuruf
May 13 2016 07:19
You don't need it. Just use ==
Srajan Garg
@srajangarg
May 13 2016 07:32
If the == is defined on the values (and the keys) in a map, == will work on the map too.
Charles Chen
@chenchfort
May 13 2016 07:45
@isuruf In addition, what do we do with var that now doesn’t exist in UnivariateExprPolynomial?
Isuru Fernando
@isuruf
May 13 2016 07:49
I don't understand. Can you explain?
Charles Chen
@chenchfort
May 13 2016 07:50
Variable of a polynomial
Or I guess we don’t need variable for UnivariateExprPolynomial? That works.
Isuru Fernando
@isuruf
May 13 2016 08:00
That's interesting. We actually don't need the variable. This is what FLINT does
Sorry flint
Charles Chen
@chenchfort
May 13 2016 08:05
Yes. Are you also open to using vector instead of map to store coefficients?
Isuru Fernando
@isuruf
May 13 2016 08:05
You mean a dense representation?
Srajan Garg
@srajangarg
May 13 2016 08:05
I think that can be done as an optional core?
Having both dense and sparse representations
Charles Chen
@chenchfort
May 13 2016 08:09
Yes a dense rep. Flint just uses an array in C with realloc. In C++ we would use vector. Unless there’s a way to control the capacity of map, it would be constantly allocating memory which is why it’s bogging down speed?
Isuru Fernando
@isuruf
May 13 2016 08:09
In C++, it's easier to use a vector.
And resize
Charles Chen
@chenchfort
May 13 2016 08:10
Yes.
Isuru Fernando
@isuruf
May 13 2016 08:11
@srajangarg, will add a common interface for polynomials. Then we can have both dense and sparse implementations
Charles Chen
@chenchfort
May 13 2016 08:13
What PR is this?
Isuru Fernando
@isuruf
May 13 2016 08:14
He's going to work on this through out the summer
Do you have a deadline for your project?
Charles Chen
@chenchfort
May 13 2016 08:16
In 3 weeks.
Isuru Fernando
@isuruf
May 13 2016 08:16
Okay, then you should concentrate on just the sparse polynomial
Charles Chen
@chenchfort
May 13 2016 08:18
So for now if I do FFT I’ll have to convert from map to vector, and then back.
Isuru Fernando
@isuruf
May 13 2016 08:19
Ah, okay. I think it'll be more work to get a dense representation working, so that'll have to do for now
Is it now working with symbolic coefficients?
Charles Chen
@chenchfort
May 13 2016 08:20
Not tested yet. Right now I
am having issue with rationals
Isuru Fernando
@isuruf
May 13 2016 08:20
Let me know if I can help