Class: Plurimath::Math::Function::Table::Bmatrix

Inherits:
Plurimath::Math::Function::Table show all
Defined in:
lib/plurimath/math/function/table/bmatrix.rb

Instance Attribute Summary

Attributes inherited from Plurimath::Math::Function::TernaryFunction

#parameter_one, #parameter_three, #parameter_two

Instance Method Summary collapse

Methods inherited from Plurimath::Math::Function::Table

#latex_environment, #to_asciimath, #to_html, #to_mathml_without_math_tag

Methods inherited from Plurimath::Math::Function::TernaryFunction

#==, #class_name, #to_asciimath, #to_html, #to_mathml_without_math_tag

Constructor Details

#initialize(parameter_one, parameter_two = "[", parameter_three = "]") ⇒ Bmatrix

Returns a new instance of Bmatrix.



10
11
12
13
14
# File 'lib/plurimath/math/function/table/bmatrix.rb', line 10

def initialize(parameter_one,
               parameter_two = "[",
               parameter_three = "]")
  super
end

Instance Method Details

#to_latexObject



16
17
18
19
20
21
# File 'lib/plurimath/math/function/table/bmatrix.rb', line 16

def to_latex
  first_value = parameter_one&.map(&:to_latex)&.join("\\\\")
  matrices    = Latex::Constants::MATRICES.invert
  environment = matrices[parameter_two].to_s
  "\\begin{#{environment}}#{first_value}\\end{#{environment}}"
end