(ctx, A, b)
return A
Extend matrix A with column b and return result.
Extend matrix A with column b and return result.
Extend matrix A with column b and return result .
def extend(ctx, A, b):
        """
        Extend matrix A with column b and return result.
        """
        if not isinstance(A, ctx.matrix):
            raise TypeError("A should be a type of ctx.matrix")
        if A.rows != len(b):
            raise ValueError("Value should be equal to len(b)")
        A = A.copy()
        A.cols += 1
        for i in xrange(A.rows):
            A[i, A.cols-1] = b[i]
        return A
def extend ( ctx , A , b ) : if not isinstance ( A , ctx . matrix ) : raise TypeError ( "A should be a type of ctx.matrix" ) if A . rows != len ( b ) : raise ValueError ( "Value should be equal to len(b)" ) A = A . copy ( ) A . cols += 1 for i in xrange ( A . rows ) : A [ i , A . cols - 1 ] = b [ i ] return A