-
Notifications
You must be signed in to change notification settings - Fork 7
Add dependency-tracking variable data type. #63
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
Conversation
Can you explain why the value is 120? I understand the indices. |
shakedregev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No major comments and tests pass, so I'm approving. I will branch off this to make some quick fixes.
nkoukpaizan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR works as advertised. It will be helpful to expand the documentation of the functionality, so people won't have to read the paper to understand what's going on.
I am also getting many warnings I did not use to see, but I don't think these are related to this PR, but to an earlier one. e.g.,
In file included from /lustre/orion/scratch/nkouk/stf006/Codes/GridKit/tests/UnitTests/PhasorDynamics/runBranchTests.cpp:1:
In file included from /lustre/orion/scratch/nkouk/stf006/Codes/GridKit/tests/UnitTests/PhasorDynamics/BranchTests.hpp:6:
In file included from /lustre/orion/scratch/nkouk/stf006/Codes/GridKit/src/Model/PhasorDynamics/Branch/Branch.hpp:11:
/lustre/orion/scratch/nkouk/stf006/Codes/GridKit/src/Model/PhasorDynamics/Component.hpp:51:22: warning: 'nnz' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
virtual IdxT nnz()
In file included from /lustre/orion/scratch/nkouk/stf006/Codes/GridKit/tests/UnitTests/PhasorDynamics/runBranchTests.cpp:1:
In file included from /lustre/orion/scratch/nkouk/stf006/Codes/GridKit/tests/UnitTests/PhasorDynamics/BranchTests.hpp:6:
In file included from /lustre/orion/scratch/nkouk/stf006/Codes/GridKit/src/Model/PhasorDynamics/Branch/Branch.hpp:11:
/lustre/orion/scratch/nkouk/stf006/Codes/GridKit/src/Model/PhasorDynamics/Component.hpp:56:22: warning: 'hasJacobian' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
virtual bool hasJacobian()
Updated PR description to clarify this. |
* Add dependency-tracking variable data type. * Fix compiler warnings. * Test chain rule with local variable. --------- Co-authored-by: shakedregev <[email protected]>
Add a definition for a variable type that tracks its dependencies. This dependency tracking is helpful when computing e.g. Jacobian sparsity pattern.
For example, consider function template
Substituting template parameter
GridKit::Sparse::Variable<double>would produce a function that computes vectorfsuch that each element offcontains numerical value and the list of elements ofxthat are used to compute that value. For example, with values ofxset asf[0]would contain double floating point value120.0and indices0and1. See here for more details.This PR only provides dependency tracking data type and a simple unit test.
CC @sklus