New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
poly file name changes + making symengine mpolys inherit from a base class #1255
Open
srajangarg
wants to merge
3
commits into
symengine:master
Choose a base branch
from
srajangarg:piranha_mpoly
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#ifndef SYMENGINE_MULTIVARIATE | ||
#define SYMENGINE_MULTIVARIATE | ||
|
||
#include <symengine/basic.h> | ||
|
||
namespace SymEngine | ||
{ | ||
|
||
template <typename Container, typename Poly> | ||
class MPolyBase : public Basic | ||
{ | ||
private: | ||
Container poly_; | ||
set_basic vars_; | ||
|
||
public: | ||
typedef Container container_type; | ||
typedef typename Container::coef_type coef_type; | ||
|
||
MPolyBase(const set_basic &vars, Container &&dict) | ||
: poly_{dict}, vars_{vars} | ||
{ | ||
} | ||
|
||
static RCP<const Poly> from_container(const set_basic &vars, Container &&d) | ||
{ | ||
return make_rcp<const Poly>(vars, std::move(d)); | ||
} | ||
|
||
//! \returns `-1`,`0` or `1` after comparing | ||
virtual int compare(const Basic &o) const = 0; | ||
virtual hash_t __hash__() const = 0; | ||
|
||
inline vec_basic get_args() const | ||
{ | ||
return {}; | ||
} | ||
|
||
inline const Container &get_poly() const | ||
{ | ||
return poly_; | ||
} | ||
|
||
inline const set_basic &get_vars() const | ||
{ | ||
return vars_; | ||
} | ||
}; | ||
} | ||
|
||
#endif |
2 changes: 1 addition & 1 deletion
2
symengine/polys/msymenginepoly.cpp → symengine/polys/mpoly_symengine.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include <symengine/polys/msymenginepoly.h> | ||
#include <symengine/polys/mpoly_symengine.h> | ||
|
||
namespace SymEngine | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
symengine/polys/usymenginepoly.h → symengine/polys/upoly_base_symengine.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
symengine/polys/uintpoly_flint.cpp → symengine/polys/upoly_flint.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was moved inside the class, as different classes can have different
get_translated_container
methods, which serve different purposes. Hence theadd/sub/mul/div
functions use that particular class'sget_translated
method, and remain the same for all classes. (just how+, -, x, /
were overloaded for univariate poly classes and implemented commonly for all classes)