示例#1
0
def strsymbmatrix(A, name):
    s = ''
    s += 'rows: %s.\n' % withbrackets(rows(A))
    s += 'cols: %s.\n' % withbrackets(cols(A))
    s += '%s =\n' % name
    s += str(A).replace(';', ';\n') + '\n'
    return s
示例#2
0
def strsymbmatrix(A, name):
    s = ''
    s += 'rows: %s.\n' % withbrackets(rows(A))
    s += 'cols: %s.\n' % withbrackets(cols(A))
    s += '%s =\n' % name
    s += str(A).replace(';', ';\n') + '\n'
    return s
示例#3
0
    def __str__(self):
        if self.constval == 1:
            descr = "ones"
        else:
            descr = "zeros"

        return "%s(%s, %s)" % (descr, str(withbrackets(
            self.rows)), str(withbrackets(self.cols)))
示例#4
0
    def __str__(self):
        if self.constval == 1:
            descr = "ones"
        else:
            descr = "zeros"

        return "%s(%s, %s)" % (descr, str(withbrackets(self.rows)),
                               str(withbrackets(self.cols)))
示例#5
0
    def __repr__(self):
        if self.constval == 1:
            descr = "ones"
        else:
            descr = "zeros"
        descr += " "

        if equiv(self.cols, 1):
            descr += "vector"
        else:
            descr += "matrix"
        return "<%sx%s all %s>" % (withbrackets(
            self.rows), withbrackets(self.cols), descr)
示例#6
0
    def __repr__(self):
        if self.constval == 1:
            descr = "ones"
        else:
            descr = "zeros"
        descr += " "

        if equiv(self.cols, 1):
            descr += "vector"
        else:
            descr += "matrix"
        return "<%sx%s all %s>" % (withbrackets(self.rows),
           withbrackets(self.cols), descr)
示例#7
0
 def __str__(self):
     return withbrackets(self.lhs) + '/' + withbrackets(self.rhs)
示例#8
0
 def __repr__(self):
     return "<%sx%s identity matrix>" % (withbrackets(
         self.rows), withbrackets(self.cols))
示例#9
0
 def __repr__(self):
     return "<%sx%s vert concat [%s; %s]>" % \
             (withbrackets(rows(self)), withbrackets(cols(self)),
              str(self.lhs), str(self.rhs))
示例#10
0
 def __str__(self):
     return withbrackets(self.lhs) + '/' + withbrackets(self.rhs)
示例#11
0
 def __repr__(self):
     return "<%sx%s identity matrix>" % (withbrackets(self.rows),
        withbrackets(self.cols))
示例#12
0
 def __repr__(self):
     return "<%sx%s vert concat [%s; %s]>" % \
             (withbrackets(rows(self)), withbrackets(cols(self)),
              str(self.lhs), str(self.rhs))