Add new matrix methods for DenseMatrix #3216
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please check if the PR fulfills these requirements
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
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?