Lines Matching refs:numCols
711 def __init__ (self, numCols, numRows, scalars):
712 assert len(scalars) == numRows*numCols
713 self.numCols = numCols
718 def fromScalar (numCols, numRows, scalar):
720 for col in range(0, numCols):
723 return Mat(numCols, numRows, scalars)
726 def identity (numCols, numRows):
727 return Mat.fromScalar(numCols, numRows, 1.0)
730 assert 0 <= colNdx and colNdx < self.numCols
735 assert 0 <= colNdx and colNdx < self.numCols
739 def toMatrix (self, numCols, numRows):
740 res = Mat.identity(numCols, numRows)
741 for col in range(0, min(self.numCols, numCols)):
757 if self.numRows == self.numCols:
760 return "mat%dx%d" % (self.numCols, self.numRows)
766 return isinstance(other, Mat) and self.numRows == other.numRows and self.numCols == other.numCols
774 return Mat(self.numRows, self.numCols, [self.scalars(i) * val.scalars(i) for i in range(self.numRows*self.numCols)])