cristicbz / scid

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

Illegal operation on inv(matrix.t * matrix) * vector #22

Closed dsimcha closed 13 years ago

dsimcha commented 13 years ago
import scid.matvec, std.stdio;

 void main() {
     auto mat = Matrix!double(
         [[1.0, 4], [4.0, 5], [7.0, 8]]
     );

     auto vec = Vector!double([8, 6]);

     auto stuff = eval(inv(mat.t * mat) * vec);
     writeln(stuff.pretty);
}

This specific example crashes the program with an illegal operation. Some similar examples throw an exception instead, claiming that a non-square matrix can't be inverted.