prettyPrint method

void prettyPrint({
  1. String separator = ' ',
  2. bool isPrettyMatrix = true,
  3. MatrixAlign alignment = MatrixAlign.right,
})

Print a string representation of the matrix with its shape and elements separated by the specified separator.

separator: A string used to separate matrix elements in a row. Default is a space character (' '). alignment: An enum indicating the alignment of the elements in each column. Default is MatrixAlign.right. isPrettyMatrix: A bool indicating the output matrix string should have square around it. Default is true.

Example:

var m = Matrix([[1, 2], [3, 4]]);
print(m.toString(separator: ' ', alignment: 'right'));
// Output:
// Matrix: 2x2
// ┌ 1 2 ┐
// └ 3 4 ┘

Implementation

void prettyPrint(
    {String separator = ' ',
    bool isPrettyMatrix = true,
    MatrixAlign alignment = MatrixAlign.right}) {
  print(_Utils.matString(this,
      separator: separator,
      isPrettyMatrix: isPrettyMatrix,
      alignment: alignment));
}