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

Add new matrix methods for DenseMatrix #3216

Merged
merged 4 commits into from
Nov 22, 2024
Merged

Add new matrix methods for DenseMatrix #3216

merged 4 commits into from
Nov 22, 2024

Conversation

SylvestreSakti
Copy link
Contributor

@SylvestreSakti SylvestreSakti commented Nov 19, 2024

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Does this PR already have an issue describing the problem?
This PR adresses multiple needs :

What kind of change does this PR introduce?
This PR introduces 4 new methods in DenseMatrix

  • Copying values from another DenseMatrix
  • Resetting a specific row of a DenseMatrix
  • Resetting a specific column of a DenseMatrix
  • Remove small values of a DenseMatrix

It introduces also a new final static object EMPTY for empty matrix.

What is the current behavior?
Currently these methods are implemented in OpenLoadFlow but they are concerning DenseMatrix operations so it would be cleaner to have them in powsybl-core

What is the new behavior (if this is a feature change)?

These methods have been moved :

  • From powsybl.openloadflow.sensi.DcSensitivityAnalysis :
    private static void matrixCopyValues(DenseMatrix originalMatrix, DenseMatrix copyMatrix)
    => To powsybl.math.matrix.DenseMatrix :
    public void copyValuesFrom(DenseMatrix originalMatrix)

  • From powsybl.openloadflow.util.MatrixUtil :
    public static void resetRow(DenseMatrix m, int row)
    public static void resetColumn(DenseMatrix m, int column)
    public static void clean(DenseMatrix m, double epsilonValue)
    => To powsybl.math.matrix.DenseMatrix :
    public void resetRow(int row)
    public void resetColumn(int column)
    public void removeSmallValues(double epsilonValue)

  • From powsybl.openloadflow.sensi.WoodburyEngine (in https://github.com/powsybl/powsybl-open-loadflow/pull/1095/files/f69a2011d21da80c0483d2f68a78295feb541592#diff-cccda1bb06d9d483f786ebdf66343e1d85e9728488bedcf9f9bf732ed4ca610d) :
    public static class EmptyDenseMatrix
    => To powsybl.math.matrix.DenseMatrix :
    public static final DenseMatrix EMPTY

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No (MatrixUtil class in OpenLoadFlow will be kept as deprecated)

Signed-off-by: PRABAKARAN Sylvestre <[email protected]>
Signed-off-by: PRABAKARAN Sylvestre <[email protected]>
@p-arvy p-arvy closed this Nov 20, 2024
@p-arvy p-arvy reopened this Nov 20, 2024
@olperr1 olperr1 merged commit 7ad0f5d into main Nov 22, 2024
7 checks passed
@olperr1 olperr1 deleted the densematrix_utils branch November 22, 2024 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants