def __init__(self, columns, rows, oneDimArray=None, rowBased=True, isOneDimArray=True):
        """Initialize the Matrix with the given number of columns and rows.

        :param integer columns:     The number of columns for the Matrix.
        :param integer rows:        The number of rows for the Matrix.
        :param list oneDimArray:    The values for the Matrix in a based
                                    one dimensional list. Depending on the
                                    rowBased parameter, the first n values
                                    (n = the number of rows) represents either
                                    the first row or the first column.
                                    The length of oneDimArray has to be
                                    columns * rows.
                                    If isOneDimArray is False this should be a
                                    two dimensonal list.
        :param boolean rowBased:    Only necessary if the oneDimArray is given.
                                    Indicates whether the oneDimArray combines
                                    rows together (rowBased=True) or columns
                                    (rowBased=False)
        :param boolean isOneDimArray: Indicates whether the parameter
                                    oneDimArray is a one dimensional array or
                                    a two dimensional array.

        :raise: Raises an :py:exc:`ValueError` if:
            - columns < 1 or
            - rows < 1
            - len(oneDimArray) != columns * rows
        """
        if columns < 1 or rows < 1:
            raise ValueError("At least one row and one column is necessary")
        super(Matrix, self).__init__()
        self._columns = columns
        self._rows = rows
        if oneDimArray is None:
            self.matrix = [[0.0 for i in xrange(rows)] for j in xrange(columns)]
        elif isOneDimArray:
            if len(oneDimArray) != columns * rows:
                raise ValueError("""Size of array does not fit in Matrix
                    with %d rows and %d columns""" % (rows, columns))
            if rowBased:
                self.matrix = []
                for j in xrange(columns):
                    self.matrix.append([])
                    for i in xrange(rows):
                        self.matrix[j].append(oneDimArray[i * columns + j])
            else:
                self.matrix = [[oneDimArray[j * rows + i] for i in xrange(rows)] for j in xrange(columns)]
        else:
            self._initialize_with_array(oneDimArray, rowBased)

        self._stringPrecision = Matrix.defaultStringPrecision
def __init__ ( self , columns , rows , oneDimArray = None , rowBased = True , isOneDimArray = True ) : if columns < 1 or rows < 1 : raise ValueError ( "At least one row and one column is necessary" ) super ( Matrix , self ) . __init__ ( ) self . _columns = columns self . _rows = rows if oneDimArray is None : self . matrix = [ [ 0.0 for i in xrange ( rows ) ] for j in xrange ( columns ) ] elif isOneDimArray : if len ( oneDimArray ) != columns * rows : raise ValueError ( """Size of array does not fit in Matrix
                    with %d rows and %d columns""" % ( rows , columns ) ) if rowBased : self . matrix = [ ] for j in xrange ( columns ) : self . matrix . append ( [ ] ) for i in xrange ( rows ) : self . matrix [ j ] . append ( oneDimArray [ i * columns + j ] ) else : self . matrix = [ [ oneDimArray [ j * rows + i ] for i in xrange ( rows ) ] for j in xrange ( columns ) ] else : self . _initialize_with_array ( oneDimArray , rowBased ) self . _stringPrecision = Matrix . defaultStringPrecision
Initialize the Matrix with the given number of columns and rows.

        :param integer columns:     The number of columns for the Matrix.
        :param integer rows:        The number of rows for the Matrix.
        :param list oneDimArray:    The values for the Matrix in a based
                                    one dimensional list. Depending on the
                                    rowBased parameter, the first n values
                                    (n = the number of rows) represents either
                                    the first row or the first column.
                                    The length of oneDimArray has to be
                                    columns * rows.
                                    If isOneDimArray is False this should be a
                                    two dimensonal list.
        :param boolean rowBased:    Only necessary if the oneDimArray is given.
                                    Indicates whether the oneDimArray combines
                                    rows together (rowBased=True) or columns
                                    (rowBased=False)
        :param boolean isOneDimArray: Indicates whether the parameter
                                    oneDimArray is a one dimensional array or
                                    a two dimensional array.

        :raise: Raises an :py:exc:`ValueError` if:
            - columns < 1 or
            - rows < 1
            - len(oneDimArray) != columns * rows