protected function returnOriginalMatrixType(Matrix $original, Matrix $result)
    {
        $oClass = get_class($original);
        if ($oClass == 'Chippyash\Matrix\Matrix') {
            return $result;
        }

        return new $oClass($result->toArray());
    }
protected function returnOriginalMatrixType(Matrix $original, Matrix $result)
    {
        $oClass = get_class($original);
        if ($oClass == 'Chippyash\Matrix\Matrix') {
            return $result;
        }

        return new $oClass($result->toArray());
    }
protected function returnOriginalMatrixType ( Matrix $ original , Matrix $ result ) { $ oClass = get_class ( $ original ) ; if ( $ oClass == 'Chippyash\Matrix\Matrix' ) { return $ result ; } return new $ oClass ( $ result -> toArray ( ) ) ; }
Required so that upstream matrices can use the transformations and be returned
in a matrix type they understand

@param Matrix $original
@param Matrix $result

@return Matrix
Required so that upstream matrices can use the transformations and be returned in a matrix type they understand