class KXI::Exceptions::DimensionMismatchException

Raised when matrices or vectors are of incompatible dimensions during operation

Public Class Methods

new(act, ex) click to toggle source

Instantiates the {KXI::Exceptions::DimensionMismatchException} class @param [integer] act Actual dimension @param [integer] ex Expected dimension

Calls superclass method
# 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

Public Instance Methods

actual() click to toggle source

Gets the actual dimension @return [integer] Actual dimension

# File lib/kxi/exceptions/dimension_mismatch_exception.rb, line 15
def actual
        @act
end
expected() click to toggle source

Gets the expected dimension @return [integer] Expected dimension

# File lib/kxi/exceptions/dimension_mismatch_exception.rb, line 9
def expected
        @ex
end