8000 Added functions to print jacobian matrix in COO to matrix market by shakedregev · Pull Request #92 · ORNL/GridKit · GitHub
[go: up one dir, main page]

Skip to content

Added functions to print jacobian matrix in COO to matrix market #92

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 10 commits into from
Jun 27, 2025

Conversation

shakedregev
Copy link
Collaborator
@shakedregev shakedregev commented Apr 29, 2025

Description

This is a new feature that enables exporting ScaleMicrogrid examples of arbitrary size for testing.

Proposed changes

The functions work as intended and the rest of the code is intact. This is a broad fix that can work for other Jacobians or COO matrices.
After running make, in your build directory, run

./examples/ScaleMicrogrid/scalemicrogridarbitrary <N>

For example

./examples/ScaleMicrogrid/scalemicrogridarbitrary 1000

This will generate a linear system with $36N-2$ variables and constraints.

Checklist

Put an x in the boxes that apply. You can also fill these out after creating
the PR. If you're unsure about any of them, don't hesitate to ask. We're here
to help! This is simply a reminder of what we are going to look for before
merging your code.

  • All tests pass.
  • Code compiles cleanly with flags -Wall -Wpedantic -Wconversion -Wextra.
  • The new code follows GridKit™ style guidelines.
  • There are unit tests for the new code.
  • The new code is documented.
  • The feature branch is rebased with respect to the target branch.

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining
why you chose the solution you did and what alternatives you considered, etc...

@shakedregev shakedregev requested review from pelesh and reid-g April 29, 2025 13:51
@pelesh pelesh added the enhancement New feature or request label Apr 29, 2025
@shakedregev shakedregev force-pushed the shaked/print_jacobian branch 2 times, most recently from 50b60fd to a159e3e Compare May 1, 2025 20:29
pelesh
pelesh previously requested changes May 2, 2025
Copy link
Collaborator
@pelesh pelesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. A few minor changes are recommended for consistency.

@shakedregev shakedregev force-pushed the shaked/print_jacobian branch from 19f2075 to 97bc6ea Compare May 2, 2025 13:25
@shakedregev shakedregev requested a review from pelesh May 2, 2025 13:27
@shakedregev shakedregev force-pushed the shaked/print_jacobian branch from 999f661 to 9c13907 Compare May 2, 2025 14:13
@shakedregev
Copy link
Collaborator Author
shakedregev commented May 2, 2025

After running make, in your build directory, run

./examples/ScaleMicrogrid/scalemicrogridarbitrary <N>

For example

./examples/ScaleMicrogrid/scalemicrogridarbitrary 1000

This will generate a matrix of size $36N-2$

pelesh
pelesh previously requested changes Jun 6, 2025
Copy link
Collaborator
@pelesh pelesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be rebased to develop, otherwise good to merge.

@superwhiskers superwhiskers force-pushed the shaked/print_jacobian branch from 8cc1610 to 6f13f09 Compare June 27, 2025 14:04
@superwhiskers
Copy link
Collaborator

i've rebased it in the process of doing some checks. that should be sufficient

Copy link
Collaborator Author
@shakedregev shakedregev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving this commit's changes.

@shakedregev shakedregev merged commit f529ebc into develop Jun 27, 2025
@shakedregev shakedregev deleted the shaked/print_jacobian branch June 27, 2025 14:57
WiktoriaZielinskaORNL pushed a commit that referenced this pull request Jul 23, 2025
* added the ability to print a COO matrix and a jacobian in the matrix market format

* documentation

* printing residual vector too

* fixed recommendations

* the new file actually allows you to supply N. It also removes tests, it's just for creating linear systems.

* Apply pre-commmit fixes

* rebase the branch and address compiler warnings

* fix memory leak in the example

* add iomanip include for setprecision

* Apply pre-commmit fixes

---------

Co-authored-by: shakedregev <shakedregev@users.noreply.github.com>
Co-authored-by: superwhiskers <whiskerdev@protonmail.com>
Co-authored-by: superwhiskers <superwhiskers@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0