Exception: KXI::Exceptions::DimensionMismatchException
- Inherits:
-
Exception
- Object
- Exception
- KXI::Exceptions::DimensionMismatchException
- Defined in:
- lib/kxi/exceptions/dimension_mismatch_exception.rb
Overview
Raised when matrices or vectors are of incompatible dimensions during operation
Instance Method Summary collapse
-
#actual ⇒ integer
Gets the actual dimension.
-
#expected ⇒ integer
Gets the expected dimension.
-
#initialize(act, ex) ⇒ DimensionMismatchException
constructor
Instantiates the DimensionMismatchException class.
Constructor Details
#initialize(act, ex) ⇒ DimensionMismatchException
Instantiates the KXI::Exceptions::DimensionMismatchException class
22 23 24 25 26 |
# File 'lib/kxi/exceptions/dimension_mismatch_exception.rb', line 22 def initialize(act, ex) @act = act @ex = ex super("Expected dimension #{ex} got #{act}!") end |
Instance Method Details
#actual ⇒ integer
Gets the actual dimension
15 16 17 |
# File 'lib/kxi/exceptions/dimension_mismatch_exception.rb', line 15 def actual @act end |
#expected ⇒ integer
Gets the expected dimension
9 10 11 |
# File 'lib/kxi/exceptions/dimension_mismatch_exception.rb', line 9 def expected @ex end |