Skip to content

Add GNU Octave compatibility layer#7

Open
mfagerlund wants to merge 1 commit intoetcorman:mainfrom
mfagerlund:main
Open

Add GNU Octave compatibility layer#7
mfagerlund wants to merge 1 commit intoetcorman:mainfrom
mfagerlund:main

Conversation

@mfagerlund
Copy link
Copy Markdown

Summary

Adds shims and scripts so the full pipeline runs under GNU Octave (tested with 10.3.0), no MATLAB license required.

octave_compat/ — drop-in replacements for MATLAB-only functions:

  • graph, conncomp, shortestpath, minspantree (BFS, Dijkstra, Prim implementations)
  • quadprog wrapper handling Octave's stricter rank requirements
  • wrapToPi, readOBJ (fast bulk OBJ parser)

Validation scripts:

  • run_octave_validation.m — runs all 3 benchmark meshes (pig, B36, SquareMyles) with reference configs
  • test_octave_*.m — individual test scripts for each mesh

All three benchmark meshes produce 0 flipped triangles and converge successfully.

Note

While porting this codebase to Python (validating against Octave), I noticed a few edge cases where ismember can return 0 (not found) and the result is used for array indexing — this would error on certain mesh topologies where not all expected elements are found in tri_fix_cut. The three benchmark meshes aren't affected. Happy to provide details or a separate PR if useful.

Shims in octave_compat/ replace MATLAB-only features:
- graph/conncomp/shortestpath/minspantree (BFS, Dijkstra, Prim)
- quadprog wrapper handling Octave's stricter rank requirements
- wrapToPi, readOBJ (fast bulk parser)

run_octave_validation.m runs all 3 benchmark meshes (pig, B36,
SquareMyles) with their reference configs and saves numerical outputs.

Individual test scripts (test_octave_*.m) allow running each mesh
separately for debugging.

All meshes produce 0 flipped triangles and converge successfully
under GNU Octave 10.3.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant