def printm(fo, printline, mat, LineLen=5):
    """ This is obsolete - kept as source material only.
printm(fo, A matrix, [Line length]) -> Neatly file-prints matrix 
mat of size (m x n). Line length variable, default is 5. """
    m, n = mat.m, mat.n
    tmp = (
        'A matrix of dimensions (m x n), where m, n, LineLen =  %i %i %i ' %
        (m, n, LineLen))
    fo.write(tmp + '\n')
    printline(tmp)
    for i in range(m):
        fo.write('\n')
        line = ''
        for j in range(n):
            fo.write(' %12.5E ' % mat[i][j])
            line += ' %12.5E ' % mat[i][j]
            if (j + 1) % LineLen == 0 or j + 1 == n:
                fo.write('\n')
                printline(line)
                if j < n - 1:
                    line = ''
            if j == n - 1 and j + 1 > LineLen:
                fo.write('\n')
                printline(' ')
    fo.write('\n')
