Skip to content

Add support for matrices #58

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

Merged
merged 34 commits into from
Jun 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c382b04
Fix accuracy issues for `exp`.
ZCG-coder Mar 14, 2025
a0b18cb
Fix build errors
ZCG-coder Mar 15, 2025
e51b23a
Add `#include` for `<cstdint>`
ZCG-coder Mar 15, 2025
8528715
Upgrade Windows version
ZCG-coder Mar 17, 2025
44ad595
Using Python to show GUI
ZCG-coder May 26, 2025
8a534c8
Trying to fix build issue on Windows
ZCG-coder May 26, 2025
16e4e01
Fixed Windows build issues
ZCG-coder May 31, 2025
21965b7
Added support for 2D matrices
ZCG-coder May 31, 2025
bc984f9
Small fixes to improve accuracy of `ref` result.
ZCG-coder May 31, 2025
58c1a5a
Fix rounding issues
ZCG-coder May 31, 2025
99f3711
Allow building on ARM
ZCG-coder May 31, 2025
add9fb2
Improve precision of `Number` operations.
ZCG-coder May 31, 2025
b911b5b
Fixed build issues with Nanobind.
ZCG-coder Jun 1, 2025
51cab94
Cleaned up configuration files
ZCG-coder Jun 1, 2025
e10ea9d
Enable special build hacks to be specified.
ZCG-coder Jun 21, 2025
c368580
Fixed bugs in multiply
ZCG-coder Jun 21, 2025
8b51184
Fixed bugs in multiply
ZCG-coder Jun 22, 2025
2f6fd50
Fixed rounding errors
ZCG-coder Jun 22, 2025
67585f6
Reformat
ZCG-coder Jun 22, 2025
1268e61
Add matrix symbols and pretty-printing using better symbols
ZCG-coder Jun 22, 2025
3d0e74d
Added unary operator support to `Number` and `Fraction`
ZCG-coder Jun 23, 2025
99abcee
Add operators for matrices
ZCG-coder Jun 23, 2025
23eaa6f
Moved out bindings to separate modules
ZCG-coder Jun 23, 2025
fc1e00a
Add determinant for matrices
ZCG-coder Jun 24, 2025
5d02f48
Allow matrix joining laterally.
ZCG-coder Jun 24, 2025
53e0644
Add `rank` method for matrix.
ZCG-coder Jun 24, 2025
f8a826d
Allow matrix powers
ZCG-coder Jun 25, 2025
f516be1
Fix build errors
ZCG-coder Jun 25, 2025
782851d
Add documentation to Python binding stubs
ZCG-coder Jun 26, 2025
5ecea74
Add copyright headers
ZCG-coder Jun 26, 2025
f011e0c
Fixed build errors
ZCG-coder Jun 26, 2025
7769ba9
Update .idea/.name
ZCG-coder Jun 27, 2025
79d31a6
Add Doxygen documentation
ZCG-coder Jun 27, 2025
7505463
Fix `Matrix::_checkDataSanity` errors.
ZCG-coder Jun 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
push:
branches: ["develop"]

pull_request:
branches: ["main"]

workflow_dispatch:

jobs:
Expand Down
39 changes: 17 additions & 22 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ on:
- "**.hpp"
- "**.py"
- "**.yml"

pull_request:
branches: ["main"]
jobs:
build:
runs-on: ${{ matrix.os }}
Expand All @@ -26,22 +23,27 @@ jobs:
#
# To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list.
matrix:
os: [ubuntu-latest, windows-2019, macos-13, macos-14, macos-15]
build_type: [Release]
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, windows-11-arm, macos-13, macos-14, macos-15]
build_type: [Debug, Release]
c_compiler: [clang, cl]
python_version: ['3.11', '3.12', '3.13']
include:
- os: windows-2019
- os: windows-latest
c_compiler: cl
cpp_compiler: cl
cmake_extra_options: ''
- os: windows-11-arm
c_compiler: cl
cpp_compiler: cl
cmake_extra_options: ''
- os: ubuntu-latest
c_compiler: clang
cpp_compiler: clang++
cmake_extra_options: '-GNinja'
# - os: macos-latest
# c_compiler: gcc
# cpp_compiler: g++
- os: ubuntu-24.04-arm
c_compiler: clang
cpp_compiler: clang++
cmake_extra_options: ''
- os: macos-13
c_compiler: clang
cpp_compiler: clang++
Expand All @@ -55,10 +57,14 @@ jobs:
cpp_compiler: clang++
cmake_extra_options: '-GNinja'
exclude:
- os: windows-2019
- os: windows-latest
c_compiler: clang
- os: windows-11-arm
c_compiler: clang
- os: ubuntu-latest
c_compiler: cl
- os: ubuntu-24.04-arm
c_compiler: cl
- os: macos-13
c_compiler: cl
- os: macos-14
Expand All @@ -79,17 +85,6 @@ jobs:
echo "CMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}" >> "$GITHUB_ENV"
echo "CMAKE_OPTIONS=${{ matrix.cmake_extra_options }}" >> "$GITHUB_ENV"

- name: Set up Homebrew
if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-14' || matrix.os == 'macos-15' || matrix.os == 'ubuntu-latest'}}
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master

- name: Install LLVM
if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-14' || matrix.os == 'macos-15' || matrix.os == 'ubuntu-latest' }}
run: |
brew install llvm ninja
echo "PATH=$(brew --prefix llvm)/bin:$PATH" >> "$GITHUB_ENV"

- name: Set up Python
uses: actions/setup-python@v5
with:
Expand All @@ -108,6 +103,6 @@ jobs:
uses: actions/[email protected]
with:
# Artifact name
name: PyBuild ${{ matrix.os }}-cp${{ matrix.python_version }}
name: steppable-${{ matrix.os }}-cp${{ matrix.python_version }}-${{ matrix.build_type }}
# A file, directory or wildcard pattern that describes what to upload
path: ${{ steps.strings.outputs.py-build-output-dir }}
2 changes: 1 addition & 1 deletion .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions .idea/Steppable.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/dictionaries/project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 32 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,35 @@
{
"configurations": [
{
"name": "Matrix::rref",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/src/matrix_ref",
"args": [],
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "lldb",
"internalConsoleOptions": "openOnSessionStart",
"preLaunchTask": "CMake: build",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
]
},
{
"name": "Division",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/src/division",
"program": "${workspaceFolder}/build/src/calc_division",
"args": [
"1",
"2"
Expand All @@ -14,6 +39,7 @@
"environment": [],
"externalConsole": false,
"MIMode": "lldb",
"internalConsoleOptions": "openOnSessionStart",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
Expand All @@ -31,13 +57,14 @@
"name": "Add",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/src/add",
"program": "${workspaceFolder}/build/src/calc_add",
"args": [
"-5",
"6"
],
"cwd": "${workspaceFolder}/build",
"preLaunchTask": "CMake: build",
"internalConsoleOptions": "openOnSessionStart",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
Expand All @@ -50,14 +77,15 @@
"type": "cppdbg",
"request": "launch",
"name": "Multiply",
"program": "${workspaceFolder}/build/src/multiply",
"program": "${workspaceFolder}/build/src/calc_multiply",
"args": [
"56",
"76",
"+profile"
],
"cwd": "${workspaceFolder}",
"preLaunchTask": "CMake: build"
"preLaunchTask": "CMake: build",
"internalConsoleOptions": "openOnSessionStart",
}
]
}
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
# SOFTWARE. #
#####################################################################################################

INCLUDE(cmake/build_special_hacks.cmake)

CMAKE_MINIMUM_REQUIRED(VERSION 3.20)
PROJECT(Steppable)

Expand Down Expand Up @@ -109,11 +111,11 @@ SET(COMPONENTS
calc::root
calc::subtract
calc::trig
)
matrix::ref)
# NEW_COMPONENT: PATCH Do NOT remove the previous comment.

SET(TARGETS ${COMPONENTS} util)
SET(TEST_TARGETS_TEMP util fraction number factors format ${COMPONENTS})
SET(TEST_TARGETS_TEMP util fraction number mat2d factors format ${COMPONENTS})

FOREACH(TEST_TARGET IN LISTS TEST_TARGETS_TEMP)
SET(TARGET_NAME "test")
Expand All @@ -131,7 +133,6 @@ ENDFOREACH()
ADD_SUBDIRECTORY(src/)
ADD_SUBDIRECTORY(lib/)
ADD_SUBDIRECTORY(tests/)
ADD_SUBDIRECTORY(gui/)
ADD_SUBDIRECTORY(include/) # The CMakeLists file there adds the include/ directory to everything

FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
Expand Down
93 changes: 0 additions & 93 deletions azure-pipelines.yml

This file was deleted.

11 changes: 11 additions & 0 deletions cmake/build_special_hacks.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
IF(STP_DEB_CALC_DIVISION_RESULT_INSPECT)
ADD_COMPILE_DEFINITIONS(STP_DEB_CALC_DIVISION_RESULT_INSPECT)
ENDIF()

IF(STP_DEB_CALC_MULTIPLY_RESULT_INSPECT)
ADD_COMPILE_DEFINITIONS(STP_DEB_CALC_MULTIPLY_RESULT_INSPECT)
ENDIF()

IF(STP_DEB_MATRIX_REF_RESULT_INSPECT)
ADD_COMPILE_DEFINITIONS(STP_DEB_MATRIX_REF_RESULT_INSPECT)
ENDIF()
2 changes: 1 addition & 1 deletion doxygen-awesome-css
35 changes: 0 additions & 35 deletions gui/CMakeLists.txt

This file was deleted.

Loading
Loading