These are chat archives for symengine/symengine

30th
May 2016
Charles Chen
@chenchfort
May 30 2016 10:19
@isuruf Do you think we should start having the option of dense polynomial representation? Specifically before the polynomial’s instantiation we check which is more optimal.
Isuru Fernando
@isuruf
May 30 2016 10:20
That should be decided by the user
Charles Chen
@chenchfort
May 30 2016 10:21
So, a separate class for this type of polynomial?
Srajan Garg
@srajangarg
May 30 2016 10:23
@chenchfort it will only require a separate type of `container`, like `UExprDict` you'll need `UExprVec` or something along those lines.
Isuru Fernando
@isuruf
May 30 2016 10:23
Yes, but I'm not sure now is the right time for a new type of polynomial
We should make sure the ones we have are working nicely
Charles Chen
@chenchfort
May 30 2016 10:24
Any ideas for optimizing the current sparse rep?
Srajan Garg
@srajangarg
May 30 2016 10:35
@chenchfort how did the FFT implementation pan out?
Charles Chen
@chenchfort
May 30 2016 10:37
@srajangarg Well the first issue is that I had to convert sparse representation to a dense one before the FFT operation, and convert it back.
Isuru Fernando
@isuruf
May 30 2016 10:39
Problem with FFT is that it creates large expression
Charles Chen
@chenchfort
May 30 2016 10:40
Yes, for test cases with symbols and fractions it will have to evaluate large expression. Calling expand() is costly.
Isuru Fernando
@isuruf
May 30 2016 10:41
No, `expand()` is not the problem, problem is that it will introduce expressions like `sin(pi/N)` which are not simplified
If `pi` was replaced with a numeric value, then everything will become floating point values, losing precision
Charles Chen
@chenchfort
May 30 2016 10:44
Actually, that problem is resolved in the PR. I specifically only needed to implement the trig half angle formula so it can evaluate it to the precise value instead of decimal point numbers.
Isuru Fernando
@isuruf
May 30 2016 10:45
how? Assume `N=100`
Charles Chen
@chenchfort
May 30 2016 10:45
It only goes power of 2
Correct me if I’m wrong though
Isuru Fernando
@isuruf
May 30 2016 10:46
But then it will be very complicated.
Charles Chen
@chenchfort
May 30 2016 10:46
Yes, and a lot of time is consumed in expand() I believe.
However it’s very fast if inputs are all integers. Maybe should test to see if it’s faster than UIntPoly?
Isuru Fernando
@isuruf
May 30 2016 10:51
You should benchmark with flint for integer coefficients
Srajan Garg
@srajangarg
May 30 2016 10:52
@isuruf can you merge in #965
@chenchfort where is the FFT you've implemented? I want to have a look
Charles Chen
@chenchfort
May 30 2016 10:56
#931
Isuru Fernando
@isuruf
May 30 2016 10:58
@srajangarg, why do we have the constructor from a vector of coefficients? Shouldn't the conversion from vector to dictionary be done in `from_vec` ?
Srajan Garg
@srajangarg
May 30 2016 11:00
It was like this before. I was confused too about it. It should not be needed.
But this change will cause us to shift `from_vec` to the derived class, which is fine too
Isuru Fernando
@isuruf
May 30 2016 11:02
Yes, that is good
Srajan Garg
@srajangarg
May 30 2016 11:03
Can I do that along with the flint wrapper PR? in the first commit?
Isuru Fernando
@isuruf
May 30 2016 11:03
You can have it in the base class as well
Srajan Garg
@srajangarg
May 30 2016 11:03
How in the base class?
Each container will have different implementation to be constructed from vector right?
You mean to declare it like a pure virtual function?
Isuru Fernando
@isuruf
May 30 2016 11:04
Yes, but you can add it to `ODictWrapper`
Srajan Garg
@srajangarg
May 30 2016 11:05
Oh, I thought you meant `UPolyBase` by base
Ok
Isuru Fernando
@isuruf
May 30 2016 11:05
And then you can use it in the derived class
Srajan Garg
@srajangarg
May 30 2016 11:08
Can it be a constructor for `ODictWrapper`?
from the vector
Isuru Fernando
@isuruf
May 30 2016 11:11
That would introduce ambiguities for initializer lists
Charles Chen
@chenchfort
May 30 2016 11:16
@isuruf What kind of benchmark? Right now it can work with the one in benchmark/series.cpp, which is pure multiplication. For that it reduces time from 700ms in master to about 100ms when evaluate FFT numerically. For the same task, if I remember correctly FLINT uses less than 1ms.
Currently FFT is not viable when we do series expansion.
However if we just have integers and don’t do series expansion it’s viable.
Srajan Garg
@srajangarg
May 30 2016 11:18
I'll do the same for `from_dict`?
Isuru Fernando
@isuruf
May 30 2016 11:25
You can have the constructor from a dictionary
Srajan Garg
@srajangarg
May 30 2016 13:35
How am I supposed to use the `from_vec` method defined in `ODictWrapper`?
``````RCP<const UIntPoly> from_vec(const RCP<const Symbol> &var,
const std::vector<integer_class> &v)
{
UIntDict a;
return make_rcp<const UIntPoly>(var, a.from_vec(v));
}``````
Srajan Garg
@srajangarg
May 30 2016 13:48
Nvm this^
@isuruf Do you think we'll have to wrap `flint::fmpz_polxx`? Maybe a `FlintWrapper` which has methods used by SymEngine wrappers like `from_vec` etc, could maybe save a lot of common code. I'm not sure.
Isuru Fernando
@isuruf
May 30 2016 16:44
I don't think so. You can always add it to `UIntPoly_flint`
Iris Lui
@irislq
May 30 2016 18:36
@certik @isuruf I have made a documentation page for `UExprPoly`, `UnivariateSeries`, `MultivariatePolynomial`s and `MultivariateSeries` on the github wiki. It's part of an assignment for our course (meaning Charles, James, Matthew and I) that we need to have a list of functionalities for the polynomials and series expansion, but it's available to everyone to read.