Class: Matrix::Scalar
    Do not use.  This class is for internal use only.
  
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
| 
         Class Chain: 
        
          self,
          Numeric
         
       | 
    |
| 
         Instance Chain: 
        
          self,
           
      CoercionHelper,
          ::ExceptionForMatrix,
          Numeric
         | 
    |
| Inherits: | 
        Numeric
        
  | 
    
| Defined in: | lib/matrix.rb | 
Overview
Private CLASS
Class Method Summary
- .new(value) ⇒ Scalar constructor
 
Instance Method Summary
- #*(other)
 - #**(other)
 - 
    
      #+(other)  
    
    
ARITHMETIC.
 - #-(other)
 - #/(other)
 
CoercionHelper - Included
| #apply_through_coercion | Applies the operator   | 
    
Constructor Details
    .new(value)  ⇒ Scalar 
  
# File 'lib/matrix.rb', line 1837
def initialize(value) @value = value end
Instance Method Details
#*(other)
[ GitHub ]#**(other)
[ GitHub ]# File 'lib/matrix.rb', line 1888
def **(other) case other when Numeric Scalar.new(@value ** other) when Vector raise ErrOperationNotDefined, ["**", @value.class, other.class] when Matrix #other.powered_by(self) raise ErrOperationNotImplemented, ["**", @value.class, other.class] else apply_through_coercion(other, __method__) end end
#+(other)
ARITHMETIC
# File 'lib/matrix.rb', line 1842
def +(other) case other when Numeric Scalar.new(@value + other) when Vector, Matrix raise ErrOperationNotDefined, ["+", @value.class, other.class] else apply_through_coercion(other, __method__) end end
#-(other)
[ GitHub ]# File 'lib/matrix.rb', line 1853
def -(other) case other when Numeric Scalar.new(@value - other) when Vector, Matrix raise ErrOperationNotDefined, ["-", @value.class, other.class] else apply_through_coercion(other, __method__) end end
#/(other)
[ GitHub ]# File 'lib/matrix.rb', line 1875
def /(other) case other when Numeric Scalar.new(@value / other) when Vector raise ErrOperationNotDefined, ["/", @value.class, other.class] when Matrix self * other.inverse else apply_through_coercion(other, __method__) end end