Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add 2D sym functions and use them. #1235

Open
wants to merge 43 commits into
base: Array_not_Matrix
Choose a base branch
from

Commits on Aug 29, 2022

  1. Use a SymPy Array not a Matrix for non-Expr

    It has mostly the same semantics as Matrix but can contain more general
    things.  There might be some issues about different shapes of empties
    though...  WIP on a fix for gnu-octave#1052.
    cbm755 authored and Alex Vong committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    a7c44c0 View commit details
    Browse the repository at this point in the history
  2. Python header: Add new function 'make_matrix_or_array'.

    Fixes gnu-octave#1211.
    
    * inst/private/python_header.py: Add it.
    * inst/private/python_ipc_native.m: Add it.
    Alex Vong authored and Alex Vong committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    b618e5f View commit details
    Browse the repository at this point in the history
  3. @sym/private/mat_rclist_access.m: Test Array-compatible code.

    See gnu-octave#1194 for more information.
    
    * inst/@sym/private/mat_rclist_access.m: Test it.
    Alex Vong authored and Alex Vong committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    53059ac View commit details
    Browse the repository at this point in the history
  4. @sym/private/mat_rclist_asgn.m: Test Array-compatible code.

    See gnu-octave#1194 for more information.
    
    * inst/@sym/private/mat_rclist_asgn.m: Test it.
    Alex Vong authored and Alex Vong committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    54c8271 View commit details
    Browse the repository at this point in the history

Commits on Aug 30, 2022

  1. Merge branch 'test-array-in-mat_rclist_' into Array_not_Matrix

    Alex Vong authored and Alex Vong committed Aug 30, 2022
    Configuration menu
    Copy the full SHA
    5385713 View commit details
    Browse the repository at this point in the history
  2. @sym/{horzcat,vertcat}: Fix typo.

    * inst/@sym/{horzcat,vertcat}.m: Fix them.
    Alex Vong authored and Alex Vong committed Aug 30, 2022
    Configuration menu
    Copy the full SHA
    f1b210f View commit details
    Browse the repository at this point in the history
  3. @sym/vertcat: Make function Array-compatible.

    * inst/@sym/vertcat.m: Implement it.
    Alex Vong authored and Alex Vong committed Aug 30, 2022
    Configuration menu
    Copy the full SHA
    d3b1547 View commit details
    Browse the repository at this point in the history

Commits on Aug 31, 2022

  1. @sym/transpose: Make function Array-compatible.

    This is a prerequisite for making @sym/horzcat Array-compatible.
    
    Partially fixes <gnu-octave#1215>.
    
    * inst/@sym/transpose.m: Implement it.
    Alex Vong authored and Alex Vong committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    136184d View commit details
    Browse the repository at this point in the history
  2. @sym/horzcat: Make function Array-compatible by simplifying it.

    * inst/@sym/horzcat.m: Simplify it.
    Alex Vong authored and Alex Vong committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    0d93602 View commit details
    Browse the repository at this point in the history
  3. @sym/private/mat_rclist_{access,asgn}: Remove unused variables.

    * inst/@sym/private/mat_rclist_{access,asgn}.m: Remove them.
    Alex Vong authored and Alex Vong committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    fb044e3 View commit details
    Browse the repository at this point in the history
  4. Merge branch 'make-cats-array-compat' into Array_not_Matrix

    Alex Vong authored and Alex Vong committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    9a3b3f0 View commit details
    Browse the repository at this point in the history

Commits on Sep 2, 2022

  1. @sym/repmat: Re-implement function without using 'pycall_sympy__'.

    The function is now compatible with non-Matrix 2D sym (e.g. Array,
    TableForm). Also, it now outputs empty matrices in the same way as
    upstream Octave (fixes gnu-octave#1218).
    
    * inst/@sym/repmat.m: Re-implement it and add tests accordingly.
    Alex Vong authored and Alex Vong committed Sep 2, 2022
    Configuration menu
    Copy the full SHA
    65da8ab View commit details
    Browse the repository at this point in the history
  2. Merge branch 'repmat-without-pycall' into Array_not_Matrix

    Alex Vong authored and Alex Vong committed Sep 2, 2022
    Configuration menu
    Copy the full SHA
    e895cc7 View commit details
    Browse the repository at this point in the history
  3. elementwise_op: use 2d loop for Array

    Array linear indexing is not the same as Matrix linear indexing.
    Fixes gnu-octave#1222.
    cbm755 committed Sep 2, 2022
    Configuration menu
    Copy the full SHA
    56bd719 View commit details
    Browse the repository at this point in the history
  4. uniop_bool_helper: Array support in "bool" case

    This routine is supposed to return a logical Octave array.  Do linear
    indexing on the flattened tolist output which will work on both Array
    and Matrix.  Fixes gnu-octave#1221.
    cbm755 committed Sep 2, 2022
    Configuration menu
    Copy the full SHA
    30af4ef View commit details
    Browse the repository at this point in the history

Commits on Sep 4, 2022

  1. Configuration menu
    Copy the full SHA
    8b10a44 View commit details
    Browse the repository at this point in the history
  2. Minor fix to test: ctranspose of logical is tested elsewhere

    In fact it is failing elsewhere but the point of *this* test is to
    change the orientation of a vector.
    cbm755 committed Sep 4, 2022
    Configuration menu
    Copy the full SHA
    53fbee2 View commit details
    Browse the repository at this point in the history
  3. Oops MatrixBase

    cbm755 committed Sep 4, 2022
    Configuration menu
    Copy the full SHA
    d36285c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1381757 View commit details
    Browse the repository at this point in the history
  5. private/python_ipc_native: Disable 'dbg_no_array' to keep in sync...

    ...with 'inst/private/python_header.py'.
    
    Follow-up to 56bd719.
    
    * inst/private/python_ipc_native.m: Disable it.
    Alex Vong authored and Alex Vong committed Sep 4, 2022
    Configuration menu
    Copy the full SHA
    37724d6 View commit details
    Browse the repository at this point in the history
  6. Merge branch '2dloop' into Array_not_Matrix

    Alex Vong authored and Alex Vong committed Sep 4, 2022
    Configuration menu
    Copy the full SHA
    a82cbd8 View commit details
    Browse the repository at this point in the history

Commits on Sep 6, 2022

  1. Configuration menu
    Copy the full SHA
    a1d3608 View commit details
    Browse the repository at this point in the history
  2. Merge pull request gnu-octave#1224 from cbm755/uniop

    uniop_bool_helper and friends: Array support
    cbm755 authored Sep 6, 2022
    Configuration menu
    Copy the full SHA
    269022d View commit details
    Browse the repository at this point in the history
  3. subs: use make_matrix_or_array and use 2-d indexing

    Fixes Issue gnu-octave#1226.  Related to Issue gnu-octave#1222.
    cbm755 committed Sep 6, 2022
    Configuration menu
    Copy the full SHA
    79d0526 View commit details
    Browse the repository at this point in the history
  4. Use S.Zero not integer 0

    cbm755 committed Sep 6, 2022
    Configuration menu
    Copy the full SHA
    ef9744d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    551081b View commit details
    Browse the repository at this point in the history
  6. Merge branch 'subs' into Array_not_Matrix

    Alex Vong authored and Alex Vong committed Sep 6, 2022
    Configuration menu
    Copy the full SHA
    526fe23 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    b24005e View commit details
    Browse the repository at this point in the history
  8. find: work with Array

    cbm755 committed Sep 6, 2022
    Configuration menu
    Copy the full SHA
    693e055 View commit details
    Browse the repository at this point in the history
  9. Fix some unused code

    This was broken with syntax errors since 2016...  Apply fix for Array
    but leave a comment that this is unused and untested.  It is referred to
    in isprime but commented out.
    cbm755 committed Sep 6, 2022
    Configuration menu
    Copy the full SHA
    9ce0a26 View commit details
    Browse the repository at this point in the history
  10. @sym/vertcat: Use sympy function 'flatten'.

    Follow-up to d3b1547.
    
    * inst/@sym/vertcat.m: Use it.
    Alex Vong authored and Alex Vong committed Sep 6, 2022
    Configuration menu
    Copy the full SHA
    bd795e8 View commit details
    Browse the repository at this point in the history
  11. @sym/private/mat_rclist_asgn: Use sympy function 'flatten'.

    * inst/@sym/private/mat_rclist_asgn.m: Use it.
    Alex Vong authored and Alex Vong committed Sep 6, 2022
    Configuration menu
    Copy the full SHA
    1f8163e View commit details
    Browse the repository at this point in the history
  12. @sym/transpose: Use sympy function 'transpose'.

    Follow-up to 136184d.
    
    * inst/@sym/transpose.m: Use it.
    Alex Vong authored and Alex Vong committed Sep 6, 2022
    Configuration menu
    Copy the full SHA
    c9f6f0f View commit details
    Browse the repository at this point in the history
  13. @sym/private/mat_replace: Make matrix mutable before modifying.

    We did not run into issues in the past because many sympy functions
    return a mutable matrix. However, 'transpose' used in
    c9f6f0f returns an immutable
    matrix. This change should avoid similar problems in the future.
    
    Follow-up to c9f6f0f.
    
    * inst/@sym/private/mat_replace.m: Make it mutable.
    Alex Vong authored and Alex Vong committed Sep 6, 2022
    Configuration menu
    Copy the full SHA
    321ee17 View commit details
    Browse the repository at this point in the history
  14. Merge branch 'use-sympy-funcs' into use-sympy-funcs-and-generalise

    Alex Vong authored and Alex Vong committed Sep 6, 2022
    Configuration menu
    Copy the full SHA
    05fbad6 View commit details
    Browse the repository at this point in the history
  15. make_matrix_or_array: Generalise to accept an iterable of iterables.

    * inst/private/{python_header.py,python_ipc_native.m}: Generalise
    function 'make_matrix_or_array', use sympy function 'flatten' in
    'make_matrix_or_array'.
    Alex Vong authored and Alex Vong committed Sep 6, 2022
    Configuration menu
    Copy the full SHA
    59176a2 View commit details
    Browse the repository at this point in the history
  16. Merge branch 'use-sympy-funcs-and-generalise' into Array_not_Matrix

    Alex Vong authored and Alex Vong committed Sep 6, 2022
    Configuration menu
    Copy the full SHA
    0327827 View commit details
    Browse the repository at this point in the history

Commits on Sep 7, 2022

  1. elementwise_op: call make_array_or_matrix

    Instead of doing it ourselves, prepare a list of lists and call the
    centralized helper function.
    cbm755 committed Sep 7, 2022
    Configuration menu
    Copy the full SHA
    5ea9b30 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3c0e95c View commit details
    Browse the repository at this point in the history

Commits on Sep 13, 2022

  1. Merge pull request gnu-octave#1229 from cbm755/more_ndim

    More Array fixes
    cbm755 authored Sep 13, 2022
    Configuration menu
    Copy the full SHA
    7ee32e5 View commit details
    Browse the repository at this point in the history
  2. Merge pull request gnu-octave#1233 from cbm755/central

    elementwise_op: call make_array_or_matrix
    cbm755 authored Sep 13, 2022
    Configuration menu
    Copy the full SHA
    48ddaaf View commit details
    Browse the repository at this point in the history
  3. Python header: Rename 'make_matrix_or_array' -> 'make_2d_sym'.

    Generalises 'make_matrix_or_array' so that we can choose to represent
    non-Matrix 2D sym to be something other than an Array in the
    future. For example, we could use TableForm.
    
    * inst/private/{python_header.py,python_ipc_native.m}: Rename function
    'make_matrix_or_array' -> 'make_2d_sym', variable 'dbg_no_array' ->
    'dbg_matrix_only' and adjust accordingly.
    * inst/@sym/private/mat_rclist_{access,asgn}.m: Adjust accordingly.
    * inst/@sym/vertcat.m: Adjust accordingly.
    Alex Vong authored and cbm755 committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    e74ce50 View commit details
    Browse the repository at this point in the history
  4. Python header: Add more 2D sym functions.

    Add more 2D sym functions to abstract over the idea of 2D sym so that
    we can choose to represent non-Matrix 2D sym to be something other
    than an Array in the future. For example, we could use TableForm.
    
    WIP: This is incomplete. More functions need to use these 2D sym
    functions. Not sure if this is needed anymore as TableForm was shown
    to be lacking various features such as indexing and taking
    transpose. No other candidates are being considered at the moment.
    
    * inst/private/{python_header.py,python_ipc_native.m}: Add new 2D sym
    functions 'is_2d_sym', 'is_matrix', 'is_non_matrix_2d_sym',
    'list_from_2d_sym' and 'shape_of_2d_sym'.
    * inst/@sym/private/mat_rclist_{access,asgn}.m: Use them.
    * inst/@sym/{transpose.m,vertcat.m}: Use them.
    Alex Vong authored and cbm755 committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    d4f5427 View commit details
    Browse the repository at this point in the history