Class: CAS::MinMax

Inherits:
Piecewise show all
Defined in:
lib/functions/fnc-piecewise.rb

Overview

Class MinMax is an intermediate class for Min and Max functions. It contains shared code and methods

Instance Attribute Summary

Attributes inherited from Piecewise

#condition

Attributes inherited from BinaryOp

#x, #y

Attributes inherited from Op

#x

Instance Method Summary collapse

Methods inherited from Piecewise

#==, #call, #diff, #dot_graph, #initialize, #to_code

Methods inherited from BinaryOp

#==, #args, #call, #depend?, #diff, #dot_graph, #initialize, #inspect, #simplify, #subs, #subs_lhs, #subs_rhs, #to_code

Methods inherited from Op

#!=, #*, #**, #+, #-, #-@, #/, #==, #args, #as_proc, #call, #depend?, #diff, #dot_graph, #equal, #greater, #greater_equal, init_simplify_dict, #initialize, #inspect, #limit, numeric_to_const, #simplify, simplify_dict, #simplify_dictionary, #smaller, #smaller_equal, #subs, #to_c_lib, #to_code

Constructor Details

This class inherits a constructor from CAS::Piecewise

Instance Method Details

#to_latexObject

Convert MinMax function into LaTeX representation

* **returns**: `String` of LaTeX code


142
143
144
# File 'lib/functions/fnc-piecewise.rb', line 142

def to_latex
  "\\mathrm{#{@type}}\\left( \\begin{array}{c} #{@x.to_latex} \\\\ #{@y.to_latex} \\end{array} \\right)"
end

#to_sObject

Returns a string representation for the current operation

* **returns**: `String`


149
150
151
# File 'lib/functions/fnc-piecewise.rb', line 149

def to_s
  "#{@type}(#{@x}, #{@y})"
end