chris_lib 1.1.7 → 1.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chris_lib.rb +1 -0
- data/lib/chris_lib/chris_math.rb +23 -0
- data/lib/chris_lib/version.rb +1 -1
- metadata +19 -109
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79c4ea547446df8d0379c747cdfc49c2d75a6dbca69c030fbb184addc55a35f8
|
4
|
+
data.tar.gz: 964c3612a94592578ca8c5620e235f32990616fac42d26f6e5c030983b6dbd98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7fa67040270e0404053b52235d126e308429ab264a7d87cae17e594f80953419e971cb30443384f88ebee3d8193fd39d83ec47dca36aa883d6c86fe46162b07
|
7
|
+
data.tar.gz: c2efb641ba2af31d692f3ebdef4ae6cc19c308f99ac7abc0d870d3e25365225ce4b7c7934d4a45ec550bf955beb84a8ec5a16b15a7c9d82677a54ccf3d7bed15
|
data/lib/chris_lib.rb
CHANGED
data/lib/chris_lib/chris_math.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'matrix'
|
1
2
|
Integer.class_eval do
|
2
3
|
def factorial
|
3
4
|
n = self
|
@@ -8,6 +9,28 @@ Integer.class_eval do
|
|
8
9
|
end
|
9
10
|
end
|
10
11
|
end
|
12
|
+
|
13
|
+
Matrix.class_eval do
|
14
|
+
# right pseudo-inverse for linearly independent rows
|
15
|
+
def pinv
|
16
|
+
full_rank = (rank == [row_count, column_count].min)
|
17
|
+
raise ExceptionForMatrix::ErrNotRegular unless full_rank
|
18
|
+
transpose * (self * transpose).inv
|
19
|
+
end
|
20
|
+
|
21
|
+
# for linearly independent rows
|
22
|
+
def pinv_right
|
23
|
+
full_rank = (rank == [row_count, column_count].min)
|
24
|
+
raise ExceptionForMatrix::ErrNotRegular unless full_rank
|
25
|
+
transpose * (self * transpose).inv
|
26
|
+
end
|
27
|
+
|
28
|
+
# for linearly independent columns
|
29
|
+
def pinv_left
|
30
|
+
(transpose * self).inv * transpose
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
11
34
|
Array.class_eval do
|
12
35
|
# mean of array
|
13
36
|
def mean
|
data/lib/chris_lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,175 +1,85 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chris_lib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dotenv
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '2.2'
|
20
17
|
- - ">="
|
21
18
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
19
|
+
version: '0'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
|
-
- - "~>"
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '2.2'
|
30
|
-
- - ">="
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: 2.2.1
|
33
|
-
- !ruby/object:Gem::Dependency
|
34
|
-
name: actionview
|
35
|
-
requirement: !ruby/object:Gem::Requirement
|
36
|
-
requirements:
|
37
|
-
- - "~>"
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
version: '5.1'
|
40
|
-
- - ">="
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version: 5.1.6.2
|
43
|
-
type: :development
|
44
|
-
prerelease: false
|
45
|
-
version_requirements: !ruby/object:Gem::Requirement
|
46
|
-
requirements:
|
47
|
-
- - "~>"
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
version: '5.1'
|
50
24
|
- - ">="
|
51
25
|
- !ruby/object:Gem::Version
|
52
|
-
version:
|
53
|
-
- !ruby/object:Gem::Dependency
|
54
|
-
name: loofah
|
55
|
-
requirement: !ruby/object:Gem::Requirement
|
56
|
-
requirements:
|
57
|
-
- - "~>"
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
version: '2.3'
|
60
|
-
- - ">="
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: 2.3.1
|
63
|
-
type: :development
|
64
|
-
prerelease: false
|
65
|
-
version_requirements: !ruby/object:Gem::Requirement
|
66
|
-
requirements:
|
67
|
-
- - "~>"
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '2.3'
|
70
|
-
- - ">="
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
version: 2.3.1
|
26
|
+
version: '0'
|
73
27
|
- !ruby/object:Gem::Dependency
|
74
28
|
name: rails
|
75
29
|
requirement: !ruby/object:Gem::Requirement
|
76
30
|
requirements:
|
77
|
-
- - "~>"
|
78
|
-
- !ruby/object:Gem::Version
|
79
|
-
version: '5.1'
|
80
31
|
- - ">="
|
81
32
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
83
|
-
type: :
|
84
|
-
prerelease: false
|
85
|
-
version_requirements: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "~>"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '5.1'
|
90
|
-
- - ">="
|
91
|
-
- !ruby/object:Gem::Version
|
92
|
-
version: 5.1.6.2
|
93
|
-
- !ruby/object:Gem::Dependency
|
94
|
-
name: rspec-rails
|
95
|
-
requirement: !ruby/object:Gem::Requirement
|
96
|
-
requirements:
|
97
|
-
- - "~>"
|
98
|
-
- !ruby/object:Gem::Version
|
99
|
-
version: '3.7'
|
100
|
-
- - ">="
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
version: 3.7.2
|
103
|
-
type: :development
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
104
35
|
prerelease: false
|
105
36
|
version_requirements: !ruby/object:Gem::Requirement
|
106
37
|
requirements:
|
107
|
-
- - "~>"
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: '3.7'
|
110
38
|
- - ">="
|
111
39
|
- !ruby/object:Gem::Version
|
112
|
-
version:
|
40
|
+
version: '0'
|
113
41
|
- !ruby/object:Gem::Dependency
|
114
|
-
name:
|
42
|
+
name: rspec
|
115
43
|
requirement: !ruby/object:Gem::Requirement
|
116
44
|
requirements:
|
117
|
-
- - "~>"
|
118
|
-
- !ruby/object:Gem::Version
|
119
|
-
version: '1.3'
|
120
45
|
- - ">="
|
121
46
|
- !ruby/object:Gem::Version
|
122
|
-
version:
|
47
|
+
version: '0'
|
123
48
|
type: :development
|
124
49
|
prerelease: false
|
125
50
|
version_requirements: !ruby/object:Gem::Requirement
|
126
51
|
requirements:
|
127
|
-
- - "~>"
|
128
|
-
- !ruby/object:Gem::Version
|
129
|
-
version: '1.3'
|
130
52
|
- - ">="
|
131
53
|
- !ruby/object:Gem::Version
|
132
|
-
version:
|
54
|
+
version: '0'
|
133
55
|
- !ruby/object:Gem::Dependency
|
134
56
|
name: nokogiri
|
135
57
|
requirement: !ruby/object:Gem::Requirement
|
136
58
|
requirements:
|
137
|
-
- - "~>"
|
138
|
-
- !ruby/object:Gem::Version
|
139
|
-
version: '1.10'
|
140
59
|
- - ">="
|
141
60
|
- !ruby/object:Gem::Version
|
142
|
-
version:
|
61
|
+
version: '0'
|
143
62
|
type: :development
|
144
63
|
prerelease: false
|
145
64
|
version_requirements: !ruby/object:Gem::Requirement
|
146
65
|
requirements:
|
147
|
-
- - "~>"
|
148
|
-
- !ruby/object:Gem::Version
|
149
|
-
version: '1.10'
|
150
66
|
- - ">="
|
151
67
|
- !ruby/object:Gem::Version
|
152
|
-
version:
|
68
|
+
version: '0'
|
153
69
|
- !ruby/object:Gem::Dependency
|
154
|
-
name:
|
70
|
+
name: pry
|
155
71
|
requirement: !ruby/object:Gem::Requirement
|
156
72
|
requirements:
|
157
|
-
- - "~>"
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: '2.0'
|
160
73
|
- - ">="
|
161
74
|
- !ruby/object:Gem::Version
|
162
|
-
version:
|
75
|
+
version: '0'
|
163
76
|
type: :development
|
164
77
|
prerelease: false
|
165
78
|
version_requirements: !ruby/object:Gem::Requirement
|
166
79
|
requirements:
|
167
|
-
- - "~>"
|
168
|
-
- !ruby/object:Gem::Version
|
169
|
-
version: '2.0'
|
170
80
|
- - ">="
|
171
81
|
- !ruby/object:Gem::Version
|
172
|
-
version:
|
82
|
+
version: '0'
|
173
83
|
description: It includes maths, datetime, and rspec access test libraries.
|
174
84
|
email:
|
175
85
|
- obromios@gmail.com
|
@@ -192,7 +102,7 @@ licenses:
|
|
192
102
|
metadata:
|
193
103
|
source_code_uri: https://github.com/obromios/chris_lib
|
194
104
|
changelog_uri: https://github.com/obromios/chris_lib/blob/master/CHANGELOG.md
|
195
|
-
post_install_message:
|
105
|
+
post_install_message:
|
196
106
|
rdoc_options: []
|
197
107
|
require_paths:
|
198
108
|
- lib
|
@@ -207,8 +117,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
207
117
|
- !ruby/object:Gem::Version
|
208
118
|
version: '0'
|
209
119
|
requirements: []
|
210
|
-
rubygems_version: 3.
|
211
|
-
signing_key:
|
120
|
+
rubygems_version: 3.1.6
|
121
|
+
signing_key:
|
212
122
|
specification_version: 4
|
213
123
|
summary: This an eclectic collection of methods. It include maths, datetime, and rspec
|
214
124
|
access test libraries.
|