These are chat archives for symengine/symengine

26th
Jun 2015
Sumith Kulal
@Sumith1896
Jun 26 2015 15:49
@certik Could I know my next works?
Sumith Kulal
@Sumith1896
Jun 26 2015 17:12
@certik seems to be on GitHub but not here :smile:
Ondřej Čertík
@certik
Jun 26 2015 17:27
@Sumith1896 after the #484 is in, I think the next step is to wrap up your Piranha work
Sumith Kulal
@Sumith1896
Jun 26 2015 17:31
Okay, any specifics there?
Can it look like UnivariatePolynomial?
We can build on same lines, then maybe remove UnivariatePolynomial if needed.
Ondřej Čertík
@certik
Jun 26 2015 17:32
I think so. I would use the building blocks from Piranha
like piranha::integer
Sumith Kulal
@Sumith1896
Jun 26 2015 17:32
Yes we have the container ready we just have to wrap it up.
What functionality are you expecting, add, mul, sub, neg are there in UnivariatePolynomial?
Ondřej Čertík
@certik
Jun 26 2015 17:34
Yes.
Since it will use packed exponents, you can call the class differently.
then we need some functionality to convert a symengine expression into one of these polynomial representations.
Sumith Kulal
@Sumith1896
Jun 26 2015 17:35
A part of that is in rings
But we need a more direct option
Now I convert basic to poly then to hashset
which is not necessary I think
Ondřej Čertík
@certik
Jun 26 2015 17:45
I think there should be a function, and you tell it which polynomial representation it should return. There could also be an automatic mode, which figures out the fastest representation for the given expression, at the price of a little slower conversion, as it needs to traverse the expression to figure out what representation fits.
Sumith Kulal
@Sumith1896
Jun 26 2015 17:47
Can't it be hashset always?
unless the exponents don't fit, then we use tuple
Ondřej Čertík
@certik
Jun 26 2015 18:21
Yes, it should be hashset always.
Sumith Kulal
@Sumith1896
Jun 26 2015 18:21
Okay, anything else I should be thinking about next week?
Ondřej Čertík
@certik
Jun 26 2015 18:22
I would implement negative exponents
can they also be packed?
Sumith Kulal
@Sumith1896
Jun 26 2015 18:22
encode already supports negative
Ondřej Čertík
@certik
Jun 26 2015 18:22
excellent.
Sumith Kulal
@Sumith1896
Jun 26 2015 18:22
so nothing extra needed I suppose
Ondřej Čertík
@certik
Jun 26 2015 18:22
How do we represent rational exponents?
Sumith Kulal
@Sumith1896
Jun 26 2015 18:23
Can't be packed by encode
Even piranha doesn't do that
Ondřej Čertík
@certik
Jun 26 2015 18:23
@shivamvats is implementing that in sympy.
not as packed integers, but as a vector of rationals.
Piranha supports rational exponents.
Sumith Kulal
@Sumith1896
Jun 26 2015 18:23
Can't we have it in the tuple?
Yes
Ondřej Čertík
@certik
Jun 26 2015 18:24
And finally, the EX domain, when the coefficients are expressions.
@bluescarni wrote the expression class, that wraps symengine expressions.
Sumith Kulal
@Sumith1896
Jun 26 2015 18:25
Does all of this need the usage of templates?
for the coefficients
Ondřej Čertík
@certik
Jun 26 2015 18:25
Once we have these, then the next step is series expansion that would use these. @shivamvats has lots of experience with that.
Sumith Kulal
@Sumith1896
Jun 26 2015 18:25
Yes @shivamvats said he'll port it to SymEngine
I'll need the Polynomial module ready by then
So next week will be important
Ondřej Čertík
@certik
Jun 26 2015 18:26
You can have it as a template if it simplifies the code.
Sumith Kulal
@Sumith1896
Jun 26 2015 18:26
How is the expression class different from basic?
Is it the same as basic
You can take it and port it to the latest symengine (with @bluescarni as the author of the commit)
Sumith Kulal
@Sumith1896
Jun 26 2015 18:30
Cool
So this allows for Basic coefficient types?
Ondřej Čertík
@certik
Jun 26 2015 18:30
Yes.
Sumith Kulal
@Sumith1896
Jun 26 2015 18:31
Okay, now I get what you meant by choosing a representation
Either the author can say that the coefficients are all integer then we use an integer domain else we have to decide that
Am I right on this?
Ondřej Čertík
@certik
Jun 26 2015 18:32
Right.
Sumith Kulal
@Sumith1896
Jun 26 2015 18:32
Okay, the SymPy counterparts of ZZ and QQ etc
Ondřej Čertík
@certik
Jun 26 2015 18:32
Also some computatio might require let's say rationals, even if you start with integers, so the user might choose rationals from the beginning, so that things do not need to be converted later. Etc.
Sumith Kulal
@Sumith1896
Jun 26 2015 18:33
Cool
The domains are there in SymPy I guess, I'll have to poke into that
So, ZZ, QQ and EX
Ondřej Čertík
@certik
Jun 26 2015 18:34
Yes, these 3.
Sumith Kulal
@Sumith1896
Jun 26 2015 18:34
Okay, I'll think about the API, try to look into SymPy to get some idea
Having EX ready is good
Exponents are positive or negative rationals(or integers)?
Ondřej Čertík
@certik
Jun 26 2015 18:37
Yes
Sumith Kulal
@Sumith1896
Jun 26 2015 18:37
Cool
Ondřej Čertík
@certik
Jun 26 2015 18:37
You can also look into how Sage handles polynomials, via @isuruf. We should provide similar functionality.
Sumith Kulal
@Sumith1896
Jun 26 2015 18:37
We'll think about integrating it with other areas in SymEngine later
Like expand etc.
Cool, I'll try Sage too
Isuru Fernando
@isuruf
Jun 26 2015 18:39
@certik, have you had the time to check CMake building with Sage on OSX?
Sumith Kulal
@Sumith1896
Jun 26 2015 18:39
In what order should I start work on this?
Ondřej Čertík
@certik
Jun 26 2015 18:39
@Sumith1896 I would start wrapping up the fastest version, i.e. packing and ZZ, and provide a nice polynomial class, that is as fast as piranha.
Sumith Kulal
@Sumith1896
Jun 26 2015 18:40
Will do
Ondřej Čertík
@certik
Jun 26 2015 18:40
@isuruf I didn't yet, sorry about that. I'll try this afternoon.
Isuru Fernando
@isuruf
Jun 26 2015 18:40
Thanks
Sumith Kulal
@Sumith1896
Jun 26 2015 18:41
Also I could not find the reasons for slowdown I mentioned
I have not made any changes to code pertaining to expand2 and expand2b
Still they are slower
Ondřej Čertík
@certik
Jun 26 2015 18:42
Did you use git bisect?
That's the best way to nail this.
Isuru Fernando
@isuruf
Jun 26 2015 18:43
Maybe, CMake configuration you are using changed
Sumith Kulal
@Sumith1896
Jun 26 2015 18:43
Does that affect the benchmarks?
Isuru Fernando
@isuruf
Jun 26 2015 18:44
Yes, can you post the output of cmake?
serialization Boost is not in master
But added here because Piranha does it
I don't see why it should affect benchmarks
Isuru Fernando
@isuruf
Jun 26 2015 18:48
Looks good. I don't see anything that would slow down the benchmarks
git bisect is a good way to find the reason for the slow down
Sumith Kulal
@Sumith1896
Jun 26 2015 18:49
What exactly should I be doing?
Does it allow me to build different commits?
Isuru Fernando
@isuruf
Jun 26 2015 18:51
You can give a good commit and a bad commit and then it will help you bisect the range. You can build different commits and tell which one is bad and which one is good to arrive at the commit that caused the slowdown
Sumith Kulal
@Sumith1896
Jun 26 2015 18:52
Cool
So I think all before the PR range is the one
I'll get to it
Before that we have to stop using assert in SymEngine
Any thoughts on that?
What do other libs do?
Sumith Kulal
@Sumith1896
Jun 26 2015 19:06
I think it should be a part of figuring out next week
If we have Piranha as dependence then that issue needs to be closed
Cool, that's all I needed now :smile:
Thanks @isuruf @certik
Ondřej Čertík
@certik
Jun 26 2015 19:13
We should change our SYMENGINE_ASSERT macro to raise an exception or just abort the program, but not use assert.
Teuchos raises an exception on a dangling or null pointer, so I would do the same.
Sumith Kulal
@Sumith1896
Jun 26 2015 19:14
I does that now right?
This is the bit
#if !defined(SYMENGINE_ASSERT)
#if defined(WITH_SYMENGINE_ASSERT)
#define SYMENGINE_ASSERT(cond) assert(cond);
#else
#define SYMENGINE_ASSERT(cond)
#endif
#endif
that needs modification from symengine_assert.h
Ondřej Čertík
@certik
Jun 26 2015 19:16
Yes, right now it uses assert, we need to raise an exception instead.
So that we are not affected by the NDEBUG define.
Sumith Kulal
@Sumith1896
Jun 26 2015 19:17
I have no much idea of this, I'll look into it
SYMENGINE_ERROR raises exception
Something like that?
#define SYMENGINE_ERROR(description) std::cerr << description; std::cerr << "\n"; abort();
Ondřej Čertík
@certik
Jun 26 2015 19:18
Yes
Sumith Kulal
@Sumith1896
Jun 26 2015 19:19
Cool. I'll do that too.
Ondřej Čertík
@certik
Jun 26 2015 19:19
Thanks.
Sumith Kulal
@Sumith1896
Jun 26 2015 19:19
Thanks
I think I need to put up the post. I was waiting to get the work finalized.
Ondřej Čertík
@certik
Jun 26 2015 19:35
Thanks, yes, put up the post.