chris_lib 2.0.6 → 2.0.9
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/chris_math.rb +4 -2
- data/lib/chris_lib/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 956710619bb99978d14f19b219f20574d71bc394cbeebbfb6aee967edd187d3a
|
4
|
+
data.tar.gz: 32e53ef0e3cbe473e16f45e235f158d8a3a57694088fece0b59d8c9213e9bb55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c90eadf334c22831c50491ec45d52e3eb98de2305633bb54a25cc24275477e6f337c30ec95564d95efa32c86ad3f458ce0ea6eb181b32641b245ca0bf7bdac2
|
7
|
+
data.tar.gz: 7d4c14a98746fd819bf78597dce9e65ef2000ce9fb306ae755e824b1c1ecc4d8045d240a0a19ad3e015ca0501045cf6383dab87f8f92dfecd5a93d8b45a41993
|
data/lib/chris_lib/chris_math.rb
CHANGED
@@ -80,8 +80,10 @@ Array.class_eval do
|
|
80
80
|
|
81
81
|
# mean of array
|
82
82
|
def mean
|
83
|
-
raise 'Length must be greater than 0.' if length < 1
|
84
|
-
sum.to_f / length
|
83
|
+
raise 'chris_lib - f - Length must be greater than 0.' if length < 1
|
84
|
+
return sum.to_f / length unless all? { |e| e.class == Vector }
|
85
|
+
ary = map { |v| v.to_a }.transpose.map { |a| a.mean }
|
86
|
+
Vector.elements ary
|
85
87
|
end
|
86
88
|
|
87
89
|
# unbiased sample variance of array
|
data/lib/chris_lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chris_lib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dotenv
|
@@ -114,6 +114,20 @@ dependencies:
|
|
114
114
|
- - ">="
|
115
115
|
- !ruby/object:Gem::Version
|
116
116
|
version: '0'
|
117
|
+
- !ruby/object:Gem::Dependency
|
118
|
+
name: colorize
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - ">="
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0'
|
124
|
+
type: :development
|
125
|
+
prerelease: false
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - ">="
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '0'
|
117
131
|
description: It includes maths, datetime, and rspec access test libraries.
|
118
132
|
email:
|
119
133
|
- obromios@gmail.com
|