Repository navigation
Commit 00d857b
det, transpose, dot, cross and resultant are functions in an expression (#2180)
Modenov's Problems in Geometry computes areas, collinearity, concurrency and elimination
with determinants, vector products and resultants, and none of them could be written in an
expression: det(M) was refused by name, transpose(x) and cross(a) were read as products, and
dot, a two-vector cross and resultant did not parse.
Each is computed from its arguments when it is parsed, since there is no node for any of
them: det through Matrix.Determinant, transpose through Matrix.T, resultant through
MathS.Polynomials.Resultant, and dot and cross from the components. dot conjugates neither
side, as SymPy's dot and Mathematica's Dot do not. cross of two vectors is the vector product
in three dimensions, and cross of one vector in the plane is that vector turned through a
right angle anticlockwise, as Mathematica's Cross of one vector is, so dot(cross(a), b) is the
book's pseudo-scalar product. An argument has to be a matrix or a vector written out, or one
once its operations are carried out; anything else throws InvalidArgumentParseException
naming the function.
Where the fraction-free elimination cannot read the entries as polynomials,
Matrix.Determinant took GenericTensor's Laplace expansion, which compiles an expression tree:
ILC reports IL3050 on it, and det(M) in the parser made it reachable from every native build,
so the C++ wrapper's and the Trimming & NativeAOT jobs failed to publish. The expansion along
the first row is now written over the entries. It is the same expansion, needs no lock on
GenericTensor's shared scratch matrix, and agrees with GenericTensor's on 60 generated
matrices of roots, sines, logarithms and symbols, compared by value. The native smoke test
parses a det that takes it, and a dot of a cross.
McpUnitTests checks that angourimath://syntax names every function the grammar accepts.
det(x), transpose(x) and cross(x) are now refused with InvalidArgumentParseException, since x
is not a matrix, which that test reads as a function of something else, as it reads a count
refusal. The refusal's example is the function's own: cross([1, 2, 3], [4, 5, 6]) rather than
a matrix.
Closes #2147.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura1 parent 766e34b commit 00d857b
20 files changed
Lines changed: 1431 additions & 992 deletions
File tree
- Sources
- AngouriMath
- Core
- Antlr
- Entity/Omni
- Docs/Usage
- Functions
- MCP/AngouriMath.Mcp
- Tests
- AotSmokeTest
- McpUnitTests
- UnitTests
- Algebra/Polynomials
- Convenience
- Core
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
266 | | - | |
| 266 | + | |
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | | - | |
272 | | - | |
| 271 | + | |
273 | 272 | | |
274 | 273 | | |
275 | 274 | | |
276 | 275 | | |
277 | 276 | | |
278 | 277 | | |
279 | | - | |
280 | 278 | | |
281 | 279 | | |
282 | 280 | | |
| |||
357 | 355 | | |
358 | 356 | | |
359 | 357 | | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
360 | 378 | | |
361 | 379 | | |
362 | 380 | | |
| |||
370 | 388 | | |
371 | 389 | | |
372 | 390 | | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
373 | 404 | | |
374 | 405 | | |
375 | 406 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
243 | 246 | | |
244 | 247 | | |
245 | 248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
626 | 626 | | |
627 | 627 | | |
628 | 628 | | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
629 | 638 | | |
630 | 639 | | |
631 | 640 | | |
| |||
634 | 643 | | |
635 | 644 | | |
636 | 645 | | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
641 | 649 | | |
642 | 650 | | |
643 | | - | |
644 | 651 | | |
645 | 652 | | |
646 | 653 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
197 | 201 | | |
198 | 202 | | |
199 | 203 | | |
| |||
373 | 377 | | |
374 | 378 | | |
375 | 379 | | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
0 commit comments