Abs #50

Merged
merged 3 commits into from Jun 8, 2016

Projects

None yet

3 participants

@rajithv
Contributor
rajithv commented Jun 7, 2016

Defines the Abs class

@rajithv rajithv Abs
189089a
@isuruf isuruf and 2 others commented on an outdated diff Jun 7, 2016
ext/symengine/symengine.c
@@ -113,6 +113,10 @@ void Init_symengine() {
c_dirichlet_eta = rb_define_class_under(m_symengine, "Dirichlet_eta", c_function);
c_zeta = rb_define_class_under(m_symengine, "Zeta", c_function);
c_gamma = rb_define_class_under(m_symengine, "Gamma", c_function);
+ c_one_arg_function = rb_define_class_under(m_symengine, "OneArgFunction", c_function);
+
+ //Abs Class
+ c_abs = rb_define_class_under(m_symengine, "Abs", c_function);
@isuruf
isuruf Jun 7, 2016 Member

c_function -> c_one_arg_function

Btw, do we want one_arg_function? This was introduced in C++ to avoid code duplication, but I don't think there'll be any practical use.

@rajithv
rajithv Jun 7, 2016 Contributor

I was thinking it's better to keep the same class hierarchy as in C++, maybe it will be useful in the future. Currently there's absolutely no practical use though. What do you think? I can get rid of it if you want.

@abinashmeher999
abinashmeher999 Jun 7, 2016 Contributor

We can add it later when an actual need arises.

It usually doesn't occur to anyone to remove something that is not being
used(as long as that doesn't obstruct anything) but it will occur to us if
we feel something is missing.

On Tue, Jun 7, 2016, 11:11 PM Rajith Vidanaarachchi <
notifications@github.com> wrote:

In ext/symengine/symengine.c
#50 (comment):

@@ -113,6 +113,10 @@ void Init_symengine() {
c_dirichlet_eta = rb_define_class_under(m_symengine, "Dirichlet_eta", c_function);
c_zeta = rb_define_class_under(m_symengine, "Zeta", c_function);
c_gamma = rb_define_class_under(m_symengine, "Gamma", c_function);

  • c_one_arg_function = rb_define_class_under(m_symengine, "OneArgFunction", c_function);
  • //Abs Class
  • c_abs = rb_define_class_under(m_symengine, "Abs", c_function);

I was thinking it's better to keep the same class hierarchy as in C++,
maybe it will be useful in the future. Currently there's absolutely no
practical use though. What do you think? I can get rid of it if you want.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/symengine/symengine.rb/pull/50/files/189089ac7e60c7ce7299f33f62fe63aa8d6bdb30#r66117718,
or mute the thread
https://github.com/notifications/unsubscribe/AGmQ6xP1b6DDIkMiCA8Cypitn0pGdp8oks5qJa0zgaJpZM4IwKla
.

@isuruf
Member
isuruf commented Jun 7, 2016

Can you add some tests like abs(x+y) is a Abs

rajithv added some commits Jun 7, 2016
@rajithv rajithv Minor Fix e4b5b62
@rajithv rajithv Spec for abs
106b052
@isuruf
Member
isuruf commented Jun 8, 2016

Looks good. See comment here.

@abinashmeher999
Contributor

Looks good to me too.

@isuruf isuruf merged commit f23599d into symengine:master Jun 8, 2016

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment