You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The package I want to suggest the idea to: AngouriMath
For now, not as an output type. For example, [0, 1]T * [[a, b], [c, d]] * [1, 0] is fine (because it results in a scalar), but [[a, b], [c, d]] * [1, 0] is not
Re-measured on master (7f83a82). The example in the report compiles:
varf="[0, 1]T * [[a, b], [c, d]] * [1, 0]".ToEntity().Compile<double,double,double,double,double>("a","b","c","d");f(1,2,3,4);// 3, which is c
What was wrong. As you say, it is a scalar -- but nothing simplified the expression before compiling it, so the compiler walked into the matrix node and threw. It is simplified first now, which collapses the product to c before compilation ever sees a matrix.
What is deliberately still refused, which is the "not as an output type" in your report: an expression whose value is a matrix. [[a, b], [c, d]] * [1, 0], [a, b] and a bare matrix each raise UncompilableNodeException with "Matrix" in the message, rather than failing obscurely. That is #526, which stays open for it.
Tests in MatrixCompilationTest.cs covering both directions -- the scalar cases compiling and the matrix-valued ones refusing by name -- so the boundary stays where the report puts it. Full suite green.
Activity
Compile expressions whose matrices cancel out, and name what cannot be (
Rafael-SOWNet commentedon Aug 5, 2026
Re-measured on master (7f83a82). The example in the report compiles:
What was wrong. As you say, it is a scalar -- but nothing simplified the expression before compiling it, so the compiler walked into the matrix node and threw. It is simplified first now, which collapses the product to
cbefore compilation ever sees a matrix.What is deliberately still refused, which is the "not as an output type" in your report: an expression whose value is a matrix.
[[a, b], [c, d]] * [1, 0],[a, b]and a bare matrix each raiseUncompilableNodeExceptionwith "Matrix" in the message, rather than failing obscurely. That is #526, which stays open for it.Tests in
MatrixCompilationTest.cscovering both directions -- the scalar cases compiling and the matrix-valued ones refusing by name -- so the boundary stays where the report puts it. Full suite green.A matrix compiles to a GenTensor over its elements' type, and the ari…