Mr.CAS 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ ##
4
+ # Overloading operators for Fixnum. Operations that are
5
+ # oveloaded are:
6
+ #
7
+ # * `overloaded_plus` for `+`
8
+ # * `overloaded_minus` for `-`
9
+ # * `overloaded_mul` for `*`
10
+ # * `overloaded_div` for `/`
11
+ # * `overloaded_pow` for `**`
12
+ class Fixnum
13
+ # Setting aliases
14
+ alias :overloaded_plus :+
15
+ alias :overloaded_minus :-
16
+ alias :overloaded_mul :*
17
+ alias :overloaded_div :/
18
+ alias :overloaded_pow :**
19
+ alias :dot_graph :to_s
20
+
21
+ ##
22
+ # If `a` is a `CAS::Op` transform self in a `CAS::Const`
23
+ # and return a symbolic operation.
24
+ # If
25
+ def +(a)
26
+ return (CAS::const(self) + a) if a.is_a? CAS::Op
27
+ self.overloaded_plus a
28
+ end
29
+
30
+ ##
31
+ # If `a` is a `CAS::Op` transform self in a `CAS::Const`
32
+ # and return a symbolic operation
33
+ def -(a)
34
+ return (CAS::const(self) - a) if a.is_a? CAS::Op
35
+ self.overloaded_minus a
36
+ end
37
+
38
+ ##
39
+ # If `a` is a `CAS::Op` transform self in a `CAS::Const`
40
+ # and return a symbolic operation
41
+ def *(a)
42
+ return (CAS::const(self) * a) if a.is_a? CAS::Op
43
+ self.overloaded_mul a
44
+ end
45
+
46
+ ##
47
+ # If `a` is a `CAS::Op` transform self in a `CAS::Const`
48
+ # and return a symbolic operation
49
+ def /(a)
50
+ return (CAS::const(self) / a) if a.is_a? CAS::Op
51
+ self.overloaded_div a
52
+ end
53
+
54
+ ##
55
+ # If `a` is a `CAS::Op` transform self in a `CAS::Const`
56
+ # and return a symbolic operation
57
+ def **(a)
58
+ return (CAS::const(self) ** a) if a.is_a? CAS::Op
59
+ self.overloaded_pow a
60
+ end
61
+ end
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ ##
4
+ # Overloading operators for Float. Operations that are
5
+ # oveloaded are:
6
+ #
7
+ # * `overloaded_plus` for `+`
8
+ # * `overloaded_minus` for `-`
9
+ # * `overloaded_mul` for `*`
10
+ # * `overloaded_div` for `/`
11
+ # * `overloaded_pow` for `**`
12
+ class Float
13
+ # Setting aliases
14
+ alias :overloaded_plus :+
15
+ alias :overloaded_minus :-
16
+ alias :overloaded_mul :*
17
+ alias :overloaded_div :/
18
+ alias :overloaded_pow :**
19
+ alias :dot_graph :to_s
20
+
21
+ ##
22
+ # If `a` is a `CAS::Op` transform self in a `CAS::Const`
23
+ # and return a symbolic operation.
24
+ # If
25
+ def +(a)
26
+ return (CAS::const(self) + a) if a.is_a? CAS::Op
27
+ self.overloaded_plus a
28
+ end
29
+
30
+ ##
31
+ # If `a` is a `CAS::Op` transform self in a `CAS::Const`
32
+ # and return a symbolic operation
33
+ def -(a)
34
+ return (CAS::const(self) - a) if a.is_a? CAS::Op
35
+ self.overloaded_minus a
36
+ end
37
+
38
+ ##
39
+ # If `a` is a `CAS::Op` transform self in a `CAS::Const`
40
+ # and return a symbolic operation
41
+ def *(a)
42
+ return (CAS::const(self) * a) if a.is_a? CAS::Op
43
+ self.overloaded_mul a
44
+ end
45
+
46
+ ##
47
+ # If `a` is a `CAS::Op` transform self in a `CAS::Const`
48
+ # and return a symbolic operation
49
+ def /(a)
50
+ return (CAS::const(self) / a) if a.is_a? CAS::Op
51
+ self.overloaded_div a
52
+ end
53
+
54
+ ##
55
+ # If `a` is a `CAS::Op` transform self in a `CAS::Const`
56
+ # and return a symbolic operation
57
+ def **(a)
58
+ return (CAS::const(self) ** a) if a.is_a? CAS::Op
59
+ self.overloaded_pow a
60
+ end
61
+ end
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ module CAS
4
+ # Version of the library
5
+ # Array of three `Fixnum` values:
6
+ #
7
+ # * Major version
8
+ # * Minor version
9
+ # * Patchlevel
10
+ VERSION = [0, 2, 6]
11
+ end
12
+
metadata ADDED
@@ -0,0 +1,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: Mr.CAS
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.6
5
+ platform: ruby
6
+ authors:
7
+ - Matteo Ragni
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDXDCCAkSgAwIBAgIBATANBgkqhkiG9w0BAQUFADA6MQ0wCwYDVQQDDARpbmZv
14
+ MRUwEwYKCZImiZPyLGQBGRYFcmFnbmkxEjAQBgoJkiaJk/IsZAEZFgJtZTAeFw0x
15
+ NjA3MTkwOTM5NDlaFw0xNzA3MTkwOTM5NDlaMDoxDTALBgNVBAMMBGluZm8xFTAT
16
+ BgoJkiaJk/IsZAEZFgVyYWduaTESMBAGCgmSJomT8ixkARkWAm1lMIIBIjANBgkq
17
+ hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5pUTV/VZWpaYCwB2rr98GHoqv7UfD4Fo
18
+ 3pFi+Ds21h0laaniQ0LrJSj0JVQmYQwcqJ0AZKDuunQvMo23PZyIJAqKXktaGaYX
19
+ 4y0KT0wIiZqlQLlwgRgkdMkVpKOSQGXrfNdXrULnHVTBLpE5f/S6ZQbsgWZudy1x
20
+ vDjgp3KTeLymcCBuIcypPziSFL/M9kUXYz13hxJsPjkEJ/BGmkXE03dG9o9VF202
21
+ gvQ5P5PWfLoSraVySngdVeT961eLvyBSBXAxVwdyRdI7Xm/TndjJNWh87q0Jhy8Q
22
+ WIV5gL/uNj8MXJX+g9h95TUbygg+FkI/dQHyIlAQ2xkVEH5NJ6Y/CQIDAQABo20w
23
+ azAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUHVooQSoXXUXlIT4/
24
+ 9PIoqmGwd/IwGAYDVR0RBBEwD4ENaW5mb0ByYWduaS5tZTAYBgNVHRIEETAPgQ1p
25
+ bmZvQHJhZ25pLm1lMA0GCSqGSIb3DQEBBQUAA4IBAQBcPsPbIm7Oo3qQ3X9niTxZ
26
+ pv6eocyknwGZXZCH9LLgEXRSWXKHKr/MODo+zCUzi7cNV0hDf5v9+VATMNILH1L8
27
+ OXWyvnb80Shs9mCgSVbkgb0QImllwIdLiPJF9ywFs3WJDbUVXPRfGWS8BfSxUbvV
28
+ +fanYc7ZC6ffsjv7+2rEgWhPlZKnWG7cqCxv5gVVldCOSvbot6ai9x6hFHlG7rud
29
+ XorZtzkkLImvKFj35xKLFfVkv0Vd8tGQoiL8vdmQNJjAjtE+C+Y7OI4dpiZPKO4G
30
+ R/8JOvUuk9jPbyLxjQH/sFaFqqYGX2xo1zk2CRy/A0WhJrSaXVw1r5lEi7b0W5gg
31
+ -----END CERTIFICATE-----
32
+ date: 2016-11-28 00:00:00.000000000 Z
33
+ dependencies: []
34
+ description:
35
+ email: info@ragni.me
36
+ executables: []
37
+ extensions: []
38
+ extra_rdoc_files: []
39
+ files:
40
+ - lib/Mr.CAS.rb
41
+ - lib/Mr.CAS/auto-diff.rb
42
+ - lib/Mr.CAS/c-opt.rb
43
+ - lib/Mr.CAS/c.rb
44
+ - lib/Mr.CAS/graphviz.rb
45
+ - lib/Mr.CAS/latex.rb
46
+ - lib/Mr.CAS/matlab.rb
47
+ - lib/functions/fnc-base.rb
48
+ - lib/functions/fnc-box-conditions.rb
49
+ - lib/functions/fnc-conditions.rb
50
+ - lib/functions/fnc-piecewise.rb
51
+ - lib/functions/fnc-prod.rb
52
+ - lib/functions/fnc-sum.rb
53
+ - lib/functions/fnc-trig.rb
54
+ - lib/functions/fnc-trsc.rb
55
+ - lib/numbers/constants.rb
56
+ - lib/numbers/functions.rb
57
+ - lib/numbers/variables.rb
58
+ - lib/operators/bary-op.rb
59
+ - lib/operators/nary-op.rb
60
+ - lib/operators/op.rb
61
+ - lib/overloading/fixnum.rb
62
+ - lib/overloading/float.rb
63
+ - lib/version.rb
64
+ homepage: https://github.com/MatteoRagni/cas-rb
65
+ licenses:
66
+ - MIT
67
+ metadata: {}
68
+ post_install_message:
69
+ rdoc_options: []
70
+ require_paths:
71
+ - lib
72
+ required_ruby_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '2.0'
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ requirements: []
83
+ rubyforge_project:
84
+ rubygems_version: 2.5.2
85
+ signing_key:
86
+ specification_version: 4
87
+ summary: A Minimalistic Ruby CAS, for rapid prototyping and meta-programming
88
+ test_files: []
@@ -0,0 +1,2 @@
1
+ �vQ8���c #�[ �K-e���SuJ�)�Y���b�������h�e�(��i��Ư����}~(��R�{,�~�-f��N�]ٳ{�^p:�M�z}����b�;�"b��TJ��,߶'O�p|�~��s|��� ���`+����@=ns7~ C:�5YȈ;��"�������3�<
2
+ ,��O����������iL�$�Ia��M&�n�t=L8+F|�}�&A�axi��A����u���].��v�"7uZu՚.F5�