Class: ValueGraphTransformation::Arithmetic::Mul

Inherits:
Function show all
Defined in:
lib/value_graph_transformation/arithmetic.rb

Overview

Multiplication

Instance Attribute Summary

Attributes inherited from Graph::Vertex

#sources, #targets

Instance Method Summary (collapse)

Methods inherited from Graph::Vertex

#initialize, #source_vertices, #target_vertices

Constructor Details

This class inherits a constructor from ValueGraphTransformation::Graph::Vertex

Instance Method Details

- (Class, Array<Vertex>) inverse_to(source)

Returns the inverse function and its parameters

Returns:

  • (Class, Array<Vertex>, Array<Vertex>)

    the inverse function and its parameters



137
138
139
140
141
# File 'lib/value_graph_transformation/arithmetic.rb', line 137

def inverse_to(source)
  fail "Function does not contain given source" unless source_vertices.include?(source)
  other_source = source_vertices - [source]
  [Div, target_vertices + other_source, [source]]
end

- (String) symbol

Returns the symbol that represents this function.

Returns:

  • (String)

    the symbol that represents this function.



132
133
134
# File 'lib/value_graph_transformation/arithmetic.rb', line 132

def symbol
  "&times;"
end