Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jun 18, 2025. It is now read-only.

Conversation

sritchie
Copy link
Member

@sritchie sritchie commented Jan 22, 2022

  • solve-linear and missing generic implementations for Matrix #469:

    • sicmutils.matrix gains:

      • literal-column-matrix, literal-row-matrix for generating slightly
        tidier matrices of literal entries. (See literal-matrix for the prior
        option.)

      • structure->matrix converts 2 tensors into explicit matrices.

      • s:solve-linear-left, s:solve-linear-right, s:divide-by-structure act
        on 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 element
        along the diagonal.

      • s->m, s:transpose and s:inverse all gain new 2-arities
        that provides a sane default for ls.

      • More efficient matrix invert and determinant routines, plus functions
        to generate type specific custom matrix inversion and determinant routines
        via classical-adjoint-formula, general-determinant.

      • Linear equation solving via solve, rsolve and cramers-rule.

    • Implements new generics for matrices and structures:

      • diagonal matrices respond true to v/= with a scalar if all entries along
        the diagonal are equal to that scalar.

      • square matrices can now g/+ and g/- with scalars; the scalar c is
        converted (* c I), where I is an identity matrix of the same dimension
        as the square matrix.

      • (g/acot M) now expands the matrix M into a nice power series, more
        efficient than the previous default.

      • Thanks to solve and cramers-rule, the following g/div combinations
        now 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 and up
        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-> to two-tensor->, and
      square-structure-operation to two-tensor-operation. These functions now
      work with rectangular 2 tensors, not just square.

    • sicmutils.structure gains down-of-ups?, up-of-downs?, two-up?,
      two-down?, two-tensor? and two-tensor-info for working with "2
      tensors", ie, structures that contain structural entries of matching
      orientation and size.

    • New g/acot generic method installed for Operator instances.

Sam Ritchie added 2 commits January 22, 2022 09:25
@sritchie sritchie self-assigned this Jan 22, 2022
@sritchie sritchie added the kernel Remaining items from scmutils kernel. label Jan 22, 2022
@sritchie sritchie added this to the 0.21.0 milestone Jan 22, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jan 22, 2022

Codecov Report

Merging #469 (c90256a) into main (ed9be83) will increase coverage by 0.11%.
The diff coverage is 93.23%.

❗ Current head c90256a differs from pull request most recent head c914a9d. Consider uploading reports for the commit c914a9d to get more accurate results
Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
src/sicmutils/matrix.cljc 87.86% <92.88%> (+3.04%) ⬆️
src/sicmutils/structure.cljc 87.50% <93.54%> (+0.72%) ⬆️
src/sicmutils/mechanics/hamilton.cljc 95.77% <100.00%> (ø)
src/sicmutils/mechanics/lagrange.cljc 99.26% <100.00%> (+<0.01%) ⬆️
src/sicmutils/operator.cljc 77.73% <100.00%> (+0.09%) ⬆️
src/sicmutils/series/impl.cljc 94.77% <100.00%> (ø)
src/sicmutils/util/permute.cljc 98.48% <100.00%> (ø)
src/sicmutils/util/stopwatch.cljc 84.12% <0.00%> (-1.59%) ⬇️
src/sicmutils/rational_function.cljc 80.33% <0.00%> (-0.85%) ⬇️
src/sicmutils/numsymb.cljc 92.46% <0.00%> (-0.23%) ⬇️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ed9be83...c914a9d. Read the comment docs.

@sritchie sritchie force-pushed the sritchie/matrix_fun branch from 0984146 to f9df716 Compare January 23, 2022 01:34
@sritchie
Copy link
Member Author

@ozimos this will solve, finally, the issues you found with matrices not matching the refman!

@sritchie sritchie merged commit 7632117 into main Jan 24, 2022
@sritchie sritchie deleted the sritchie/matrix_fun branch January 24, 2022 07:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

kernel Remaining items from scmutils kernel.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants