Class: Kumi::Core::Analyzer::Plans::Reduce

Inherits:
Struct
  • Object
show all
Defined in:
lib/kumi/core/analyzer/plans.rb

Overview

Reduce plan: defines how to reduce dimensions in array operations

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(function:, axis: [], source_scope: [], result_scope: [], flatten_args: []) ⇒ Reduce



36
37
38
39
# File 'lib/kumi/core/analyzer/plans.rb', line 36

def initialize(function:, axis: [], source_scope: [], result_scope: [], flatten_args: [])
  super
  freeze
end

Instance Attribute Details

#axisObject

Returns the value of attribute axis



35
36
37
# File 'lib/kumi/core/analyzer/plans.rb', line 35

def axis
  @axis
end

#flatten_argsObject

Returns the value of attribute flatten_args



35
36
37
# File 'lib/kumi/core/analyzer/plans.rb', line 35

def flatten_args
  @flatten_args
end

#functionObject

Returns the value of attribute function



35
36
37
# File 'lib/kumi/core/analyzer/plans.rb', line 35

def function
  @function
end

#result_scopeObject

Returns the value of attribute result_scope



35
36
37
# File 'lib/kumi/core/analyzer/plans.rb', line 35

def result_scope
  @result_scope
end

#source_scopeObject

Returns the value of attribute source_scope



35
36
37
# File 'lib/kumi/core/analyzer/plans.rb', line 35

def source_scope
  @source_scope
end

Instance Method Details

#partial_reduction?Boolean



45
46
47
# File 'lib/kumi/core/analyzer/plans.rb', line 45

def partial_reduction?
  !total_reduction?
end

#total_reduction?Boolean



41
42
43
# File 'lib/kumi/core/analyzer/plans.rb', line 41

def total_reduction?
  axis == :all || result_scope.empty?
end