Class: CAS::Max

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

Overview

Max class represent a piecewise in which the condition is ‘f(x) ≥ g(x)`. Derivate a `CAS::Max` 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) ⇒ Max

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

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


167
168
169
170
# File 'lib/functions/fnc-piecewise.rb', line 167

def initialize(x, y)
  super(x, y, CAS::greater_equal(x, y))
  @type = "max"
end