Exemple #1
0
 def _new(cls, *args, **kwargs):
     if len(args)==1 and isinstance(args[0], ImmutableMatrix):
         return args[0]
     rows, cols, mat = MatrixBase._handle_creation_inputs(*args, **kwargs)
     shape = Tuple(rows, cols)
     mat = Tuple(*mat)
     return Basic.__new__(cls, shape, mat)
Exemple #2
0
 def _new(cls, *args, **kwargs):
     if len(args) == 1 and isinstance(args[0], ImmutableMatrix):
         return args[0]
     rows, cols, flat_list = MatrixBase._handle_creation_inputs(*args, **kwargs)
     rows = Integer(rows)
     cols = Integer(cols)
     mat = Tuple(*flat_list)
     return Basic.__new__(cls, rows, cols, mat)
Exemple #3
0
 def _new(cls, *args, **kwargs):
     if len(args) == 1 and isinstance(args[0], ImmutableMatrix):
         return args[0]
     rows, cols, flat_list = MatrixBase._handle_creation_inputs(
         *args, **kwargs)
     rows = Integer(rows)
     cols = Integer(cols)
     mat = Tuple(*flat_list)
     return Basic.__new__(cls, rows, cols, mat)