NetAnalyzer 0.1.1 → 0.1.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 727af54e55b813b7fa85e05009bcb96d448f0c53
4
- data.tar.gz: de44f4108459832c9f4fa833d1b9145fc84d352c
3
+ metadata.gz: 412854b58d2f6a2dbb1844cb943a90c9b96f7fd6
4
+ data.tar.gz: df275072cb0d1bb9b9d15099b089897471566eb8
5
5
  SHA512:
6
- metadata.gz: 23a875e1483ddda5f2ae1c5ad4c7e0b29bdde9b59255de09fd0f93fe2183263a3e5f197af50bad84e1164d669778439a17e40ead514d67e34312ed683c6fd2a3
7
- data.tar.gz: 8a26685f7232671499994564613d6cb6171819905be75cd4501986deca6ce82812dc38802ae7b0ff62002209d775ec775394b8d2f9ca0ee5d52e59d081d8a7d2
6
+ metadata.gz: a6d3be799d9def07f7addef75dfad5a8d1c6b9d14c684d3dcb227b6be68ef22912ab069beb2e439d07a08b7dc2a6d7d0f38e873a1303a099c3c110c9cf6b075b
7
+ data.tar.gz: 561ad012584a397023897047b0e401a96246d39a67082f0c7cfd3ee6dc3cb8075d77d08bb75ae34a8174cbc13e5a8439f0348175f38133162f54ef9e6b55c07c
@@ -2,7 +2,6 @@
2
2
 
3
3
  ROOT_PATH = File.dirname(__FILE__)
4
4
  $: << File.expand_path(File.join(ROOT_PATH, '..', 'lib', 'NetAnalyzer'))
5
- $: << File.expand_path(File.join(ROOT_PATH, '..', 'lib', 'NetAnalyzer', 'methods'))
6
5
 
7
6
  require 'network'
8
7
  require 'optparse'
@@ -206,9 +206,10 @@ class Network
206
206
  end
207
207
 
208
208
  def get_geometric_associations(layers, base_layer)
209
+ #wang 2016 method
209
210
  relations = get_associations(layers, base_layer) do |associatedIDs_node1, associatedIDs_node2, intersectedIDs, node1, node2|
210
211
  intersectedIDs = intersectedIDs.length**2
211
- productLength = associatedIDs_node1.length * associatedIDs_node2.length
212
+ productLength = Math.sqrt(associatedIDs_node1.length * associatedIDs_node2.length)
212
213
  geometricValue = intersectedIDs.to_f/productLength
213
214
  end
214
215
  @association_values[:geometric] = relations
@@ -250,14 +251,15 @@ class Network
250
251
  #Using index from A layer proyected to B
251
252
  (intersection_lengths..minLength).each do |i|
252
253
  binom_product = binom(nA, i) * binom(ny - nA, nB - i)
253
- binom_product_float = binom_product.to_f
254
- to_f = false
255
- if binom_product_float.infinite? # Handle bignum coercition to bigdecimal to avoid infinity values on float class.
256
- binom_product_float = BigDecimal.new(binom_product)
257
- to_f = true
258
- end
259
- sum += binom_product_float / binom(ny, nB)
260
- sum = sum.to_f if to_f # once the operation has finished, sum is corced from bigdecimal to float
254
+ sum += binom_product.fdiv(binom(ny, nB))
255
+ # binom_product_float = binom_product.to_f
256
+ # to_f = false
257
+ # if binom_product_float.infinite? # Handle bignum coercition to bigdecimal to avoid infinity values on float class.
258
+ # binom_product_float = BigDecimal.new(binom_product)
259
+ # to_f = true
260
+ # end
261
+ # sum += binom_product_float / binom(ny, nB)
262
+ # sum = sum.to_f if to_f # once the operation has finished, sum is corced from bigdecimal to float
261
263
  end
262
264
  if sum == 0
263
265
  hypergeometricValue = 0
@@ -1,3 +1,3 @@
1
1
  module NetAnalyzer
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: NetAnalyzer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elena Rojano, Pedro Seoane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-31 00:00:00.000000000 Z
11
+ date: 2017-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler