Class: XRVG::GeoFullFilter
Overview
GeoFullFilter, to transform inputs into geometrical sequence converging to 1.0
Instance Method Summary collapse
-
#initialize(factor) ⇒ GeoFullFilter
constructor
:nodoc:.
-
#transforms(inputs, type) ⇒ Object
make sampling by trying to check :mindiff constraint.
Methods inherited from Filter
Methods included from Samplable
#apply_sample, #apply_samples, build, #mean, #sample, #samples
Methods included from FloatFunctor
#addfilter, #alternate, #apply, #applyhash, #compute, #filter, #generate, #geo, #geofull, #modify, #process, #random, #shuffle, #sin, #ssort, #transform, #trigger
Constructor Details
#initialize(factor) ⇒ GeoFullFilter
:nodoc:
432 433 434 |
# File 'lib/samplation.rb', line 432 def initialize(factor) #:nodoc: @factor = factor end |
Instance Method Details
#transforms(inputs, type) ⇒ Object
make sampling by trying to check :mindiff constraint
generate an exception if not possible
440 441 442 443 444 445 446 447 448 449 |
# File 'lib/samplation.rb', line 440 def transforms( inputs, type ) #:nodoc: nsamples = inputs.size result = [1.0] (nsamples-1).times do result << result[-1] / @factor end range = (1.0..result[-1]) result = result.map {|v| range.abscissa( v )} return result end |