This repository was archived by the owner on Jun 18, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 69
solve-linear and missing generic implementations for Matrix #469
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## main #469 +/- ##
==========================================
+ Coverage 86.08% 86.19% +0.11%
==========================================
Files 100 100
Lines 14217 14372 +155
Branches 745 753 +8
==========================================
+ Hits 12238 12388 +150
+ Misses 1234 1231 -3
- Partials 745 753 +8
Continue to review full report at Codecov.
|
0984146
to
f9df716
Compare
@ozimos this will solve, finally, the issues you found with matrices not matching the refman! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
solve-linear and missing generic implementations for Matrix #469:
sicmutils.matrix
gains:literal-column-matrix
,literal-row-matrix
for generating slightlytidier matrices of literal entries. (See
literal-matrix
for the prioroption.)
structure->matrix
converts 2 tensors into explicit matrices.s:solve-linear-left
,s:solve-linear-right
,s:divide-by-structure
acton 2 tensors. These live in the matrix namespace since they depend on
conversions to and from tensors and matrices.
make-diagonal
for generating diagonal matrices with a constant elementalong the diagonal.
s->m
,s:transpose
ands:inverse
all gain new 2-aritiesthat provides a sane default for
ls
.More efficient matrix
invert
anddeterminant
routines, plus functionsto generate type specific custom matrix inversion and determinant routines
via
classical-adjoint-formula
,general-determinant
.Linear equation solving via
solve
,rsolve
andcramers-rule
.Implements new generics for matrices and structures:
diagonal matrices respond true to
v/=
with a scalar if all entries alongthe diagonal are equal to that scalar.
square matrices can now
g/+
andg/-
with scalars; the scalarc
isconverted
(* c I)
, whereI
is an identity matrix of the same dimensionas the square matrix.
(g/acot M)
now expands the matrixM
into a nice power series, moreefficient than the previous default.
Thanks to
solve
andcramers-rule
, the followingg/div
combinationsnow work:
matrix/scalar
,scalar/square-matrix
,column-matrix/square-matrix
,row-matrix/square-matrix
,up/square-matrix
,down/square-matrix
,matrix/square-matrix
.new
solve-linear
implementations between square matrices andup
down
, row and column matrices, and between structures and scalars.new
solve-linear-right
between row-matrix+square-matrix,down+square-matrix and scalar+structure.
Fixes an infinite loop with
sicmutils.matrix/some
.Renames
square-structure->
totwo-tensor->
, andsquare-structure-operation
totwo-tensor-operation
. These functions nowwork with rectangular 2 tensors, not just square.
sicmutils.structure
gainsdown-of-ups?
,up-of-downs?
,two-up?
,two-down?
,two-tensor?
andtwo-tensor-info
for working with "2tensors", ie, structures that contain structural entries of matching
orientation and size.
New
g/acot
generic method installed for Operator instances.