Class: Boundy::Domain::Posterior

Inherits:
Object
  • Object
show all
Includes:
Plugin
Defined in:
lib/boundy/domain/posterior.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Plugin

included

Constructor Details

#initialize(datum) ⇒ Posterior

Returns a new instance of Posterior.



20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/boundy/domain/posterior.rb', line 20

def initialize(datum)
  if datum.nil?
    raise
  end

  @from = Boundy::Bound::Infinite::Below.new
  @to = case datum
          when Boundy::Bound
            datum
          else
            Boundy::Bound.new(datum)
          end
end

Class Method Details

.builderObject



8
9
10
11
12
13
14
15
16
# File 'lib/boundy/domain/posterior.rb', line 8

def self.builder
  {
    bounds: {
      from: Boundy::Bound::Infinite::Below, 
      to: Boundy::Bound
    },
    builder: Proc.new {|b,e| self.new(e)}
  }
end

Instance Method Details

#cuteObject



34
35
36
# File 'lib/boundy/domain/posterior.rb', line 34

def cute
  "[-infinity, #{@to.datum}]"
end

#inspectObject



38
39
40
# File 'lib/boundy/domain/posterior.rb', line 38

def inspect
  "#<#{self.class.name} bounded above by #{@to.inspect}>"
end