Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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)))
Exemplo n.º 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)))
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 7
0
 def __str__(self):
     return withbrackets(self.lhs) + '/' + withbrackets(self.rhs)
Exemplo n.º 8
0
 def __repr__(self):
     return "<%sx%s identity matrix>" % (withbrackets(
         self.rows), withbrackets(self.cols))
Exemplo n.º 9
0
 def __repr__(self):
     return "<%sx%s vert concat [%s; %s]>" % \
             (withbrackets(rows(self)), withbrackets(cols(self)),
              str(self.lhs), str(self.rhs))
Exemplo n.º 10
0
 def __str__(self):
     return withbrackets(self.lhs) + '/' + withbrackets(self.rhs)
Exemplo n.º 11
0
 def __repr__(self):
     return "<%sx%s identity matrix>" % (withbrackets(self.rows),
        withbrackets(self.cols))
Exemplo n.º 12
0
 def __repr__(self):
     return "<%sx%s vert concat [%s; %s]>" % \
             (withbrackets(rows(self)), withbrackets(cols(self)),
              str(self.lhs), str(self.rhs))