parameters: (matrixList, sparcityList, expected=True, bytesPerVar=4)
return_statement: return numNonZero, totalSize, hasSparse
docstring: expected: Expected size according to the parameters set. The number of
          zeros could actually be more than that is required to satisfy the
          sparsity constraint.
docstring_summary: expected: Expected size according to the parameters set. The number of
          zeros could actually be more than that is required to satisfy the
          sparsity constraint.
docstring_tokens: expected : Expected size according to the parameters set . The number of zeros could actually be more than that is required to satisfy the sparsity constraint .
function: def getModelSize(matrixList, sparcityList, expected=True, bytesPerVar=4):
      '''
      expected: Expected size according to the parameters set. The number of
          zeros could actually be more than that is required to satisfy the
          sparsity constraint.
      '''
      nnzList, sizeList, isSparseList = [], [], []
      hasSparse = False
      for i in range(len(matrixList)):
          A, s = matrixList[i], sparcityList[i]
          assert A.ndim == 2
          assert s >= 0
          assert s <= 1
          nnz, size, sparse = utils.estimateNNZ(A, s, bytesPerVar=bytesPerVar)
          nnzList.append(nnz)
          sizeList.append(size)
          hasSparse = (hasSparse or sparse)
  
      totalnnZ = np.sum(nnzList)
      totalSize = np.sum(sizeList)
      if expected:
          return totalnnZ, totalSize, hasSparse
      numNonZero = 0
      totalSize = 0
      hasSparse = False
      for i in range(len(matrixList)):
          A, s = matrixList[i], sparcityList[i]
          numNonZero_ = np.count_nonzero(A)
          numNonZero += numNonZero_
          hasSparse = (hasSparse or (s < 0.5))
          if s <= 0.5:
              totalSize += numNonZero_ * 2 * bytesPerVar
          else:
              totalSize += A.size * bytesPerVar
      return numNonZero, totalSize, hasSparse
function_tokens: def getModelSize ( matrixList , sparcityList , expected = True , bytesPerVar = 4 ) : nnzList , sizeList , isSparseList = [ ] , [ ] , [ ] hasSparse = False for i in range ( len ( matrixList ) ) : A , s = matrixList [ i ] , sparcityList [ i ] assert A . ndim == 2 assert s >= 0 assert s <= 1 nnz , size , sparse = utils . estimateNNZ ( A , s , bytesPerVar = bytesPerVar ) nnzList . append ( nnz ) sizeList . append ( size ) hasSparse = ( hasSparse or sparse ) totalnnZ = np . sum ( nnzList ) totalSize = np . sum ( sizeList ) if expected : return totalnnZ , totalSize , hasSparse numNonZero = 0 totalSize = 0 hasSparse = False for i in range ( len ( matrixList ) ) : A , s = matrixList [ i ] , sparcityList [ i ] numNonZero_ = np . count_nonzero ( A ) numNonZero += numNonZero_ hasSparse = ( hasSparse or ( s < 0.5 ) ) if s <= 0.5 : totalSize += numNonZero_ * 2 * bytesPerVar else : totalSize += A . size * bytesPerVar return numNonZero , totalSize , hasSparse