String implements the fmt.Stringer interface for Matrix.
()
| 4 | |
| 5 | // String implements the fmt.Stringer interface for Matrix. |
| 6 | func (m Matrix[T]) String() string { |
| 7 | var result string |
| 8 | for i := range m.elements { |
| 9 | for j := range m.elements[i] { |
| 10 | result += fmt.Sprintf("%v ", m.elements[i][j]) |
| 11 | } |
| 12 | result += "\n" |
| 13 | } |
| 14 | return result |
| 15 | } |
no outgoing calls