Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 36c9af01 authored by hhakim's avatar hhakim
Browse files

Update pyfaust LazyLinearOp ctor: verify that the starting object has two...

Update pyfaust LazyLinearOp ctor: verify that the starting object has two dimensions (only one is forbidden).
parent 004e9a6f
Branches
Tags
No related merge requests found
......@@ -30,6 +30,14 @@ class LazyLinearOp(LinearOperator):
<b>See also:</b> LazyLinearOp.create, pyfaust.lazylinop.asLazyLinearOp.
"""
if not hasattr(root_obj, 'ndim'):
raise TypeError('The starting object to initialize a'
' LazyLinearOperator must possess a ndim'
' attribute.')
if root_obj.ndim != 2:
raise ValueError('The starting object to initialize a LazyLinearOp '
'must have two dimensions, not: '+str(root_obj.ndim))
self._lambda_stack = init_lambda
self.shape = shape
self._root_obj = root_obj
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment