cristicbz / scid

Scientific library for the D programming language
Boost Software License 1.0
23 stars 8 forks source link

Arrays/Vectors should have a .pretty for consistency #8

Closed dsimcha closed 13 years ago

dsimcha commented 13 years ago

E.g. if I want to see the result from this code:

import scid.matvec, std.stdio;

void main() {
    auto m = Matrix!double([[1.0, 2, 3], [4.0, 5, 6], [7.0, 8, 9]]);
    auto stuff = m * m[][0];
     writeln(eval(stuff).pretty);
 }
dsimcha commented 13 years ago

I just realized that toString() works on these objects. Even so, I think a .pretty for consistency would be nice even if all it does is forward to toString(). If you're thinking of getting rid of .pretty for matrices, feel free to ignore this.

cristicbz commented 13 years ago

I might make .pretty show column vectors on multiple lines later. For now I made it just an alias for toString().