Exemple #1
0
    def getColumn(self, index):
        """Get a copy of a column of the matrix, as a Vector."""
        if (index < 0) or (index >= self.mNCols):
            raise IndexError('Index out of bounds : %s' % index)

        return Vector.fromSequence([self.mV[i][index] 
                                    for i in range(0, self.mNRows)])
Exemple #2
0
    def getRow(self, index):
        """Get a copy of a row of the matrix, as a Vector."""
        if (index < 0) or (index >= self.mNRows):
            raise IndexError('Index out of bounds : %s' % index)

        return Vector.fromSequence(self.mV[index])