simit
simit copied to clipboard
The `\` operator is broken for dense matrices
LU should also be exposed as a set of intrinsics:
-
lu(A : matrix) -> solver : opaque
-
lusolve(solver : opaque, b : vector) -> x :vector
-
lumatsolve(solver : opaque, B : matrix) -> x :vector
-
lufree(solver : opaqie)
The backslash solver crashes for even minimal exampels. By using the following C-code
#include "program.h"
int main(int argc, char **argv) {
simit::init("cpu", sizeof(double));
simit::Program program;
program.loadFile(argv[1]);
simit::Function func = program.compile("main");
func.runSafe();
}
and the following sim-program
func main()
var A : matrix[3,3](float) = [1.0, 0.0, 0.0;
0.0, 1.0, 0.0;
0.0, 0.0, 1.0];
var b : vector[3](float) = [1.0, 2.0, 3.0]';
var c : vector[3](float) ;
c = A \ b;
end
I get segmentation fault at .../simit/src/runtime.h:24
Yes, it only works for sparse (system) matrices at the moment. That's definitely a bug.
The \
operator now calls LU. Still need to add support for the LU builtin's and fix the bugs @VikingScientist reported.
Added the intrinsic. Now it's just the bug left.