Class: CAS::Min

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

Overview

Min class represent a piecewise in which the condition is ‘f(x) ≤ g(x)`. Derivate a `CAS::Min` will return a `CAS::Piecewise` (since condition will not depend anymore on object functions)

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, #to_code, #to_latex, #to_s

Methods inherited from BinaryOp

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

Methods inherited from Op

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

Constructor Details

#initialize(x, y) ⇒ Min

To initialize ‘CAS::Min` only the two functions are necessary. The condition is automatically generated

* **argument**: `CAS::Op` first function
* **argument**: `CAS::Op` second function


186
187
188
189
# File 'lib/functions/fnc-piecewise.rb', line 186

def initialize(x, y)
  super(x, y, CAS::smaller_equal(x, y))
  @type = "min"
end