def get_capacity(self,m,n=-1): ''' Ensures that the matrix has enough capacity for m rows when there are exactly n columns. Returns an ndarray (a view) into the first m rows of the memory. ''' # Ensure columns match n exactly, and rows are at least m if n < 0: n = self._A.shape[1] if m > self._A.shape[0] or n != self._A.shape[1]: self._A = empty((m,n)) self._m = m # Return view to the first m rows return self._A[:m,:]
def get_capacity(self, m, n=-1): ''' Ensures that the matrix has enough capacity for m rows when there are exactly n columns. Returns an ndarray (a view) into the first m rows of the memory. ''' # Ensure columns match n exactly, and rows are at least m if n < 0: n = self._A.shape[1] if m > self._A.shape[0] or n != self._A.shape[1]: self._A = empty((m, n)) self._m = m # Return view to the first m rows return self._A[:m, :]
def __init__(self,m=1,n=1): self._A = empty((m,n)) self._m = m
def __init__(self, m=1, n=1): self._A = empty((m, n)) self._m = m