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

Delete class MatrixUtil #1136

Merged
merged 10 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,28 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v4

- name: Checkout powsybl-core main branch
uses: actions/checkout@v4
with:
repository: powsybl/powsybl-core
ref: refs/heads/main
path: c

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'

- name: Build and install powsybl-core with Maven (Ubuntu / MacOS)
if: matrix.os != 'windows-latest'
run: ./mvnw --batch-mode -DskipTests=true --file ./c/pom.xml install

- name: Build and install powsybl-core with Maven (Windows)
if: matrix.os == 'windows-latest'
run: mvnw.cmd --batch-mode -DskipTests=true --file ./c/pom.xml install
shell: cmd

- name: Build with Maven (Ubuntu / MacOS)
if: matrix.os != 'windows-latest'
run: ./mvnw --batch-mode -Pjacoco install
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<slf4jtoys.version>1.6.3</slf4jtoys.version>
<asciitable.version>0.3.2</asciitable.version>

<powsybl-core.version>6.5.1</powsybl-core.version>
<powsybl-core.version>6.6.0-SNAPSHOT</powsybl-core.version>
</properties>

<build>
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/powsybl/openloadflow/NetworkCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ public void onUpdate(Identifiable identifiable, String attribute, String variant
}

@Override
public void onExtensionUpdate(Extension<?> extension, String attribute, Object oldValue, Object newValue) {
public void onExtensionUpdate(Extension<?> extension, String attribute, String variantId, Object oldValue, Object newValue) {
if (contexts == null || pause) {
return;
}
Expand Down Expand Up @@ -391,17 +391,17 @@ private void onPropertyChange() {
}

@Override
public void onElementAdded(Identifiable identifiable, String attribute, Object newValue) {
public void onPropertyAdded(Identifiable identifiable, String attribute, Object newValue) {
onPropertyChange();
}

@Override
public void onElementReplaced(Identifiable identifiable, String attribute, Object oldValue, Object newValue) {
public void onPropertyReplaced(Identifiable identifiable, String attribute, Object oldValue, Object newValue) {
onPropertyChange();
}

@Override
public void onElementRemoved(Identifiable identifiable, String attribute, Object oldValue) {
public void onPropertyRemoved(Identifiable identifiable, String attribute, Object oldValue) {
onPropertyChange();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import com.powsybl.math.matrix.DenseMatrix;
import com.powsybl.openloadflow.util.Fortescue;
import com.powsybl.openloadflow.util.Fortescue.SequenceType;
import com.powsybl.openloadflow.util.MatrixUtil;

/**
* This class is made to build and access the admittance terms that will be used to fill up the Jacobian :
Expand Down Expand Up @@ -212,15 +211,15 @@ private static DenseMatrix buildTwoBlocsMatrix(DenseMatrix m66) {
}

private static void cancelComponentMatrix(DenseMatrix m, int component) {
MatrixUtil.resetRow(m, 2 * component - 2);
MatrixUtil.resetRow(m, 2 * component - 1);
MatrixUtil.resetRow(m, 2 * component + 4);
MatrixUtil.resetRow(m, 2 * component + 5);

MatrixUtil.resetColumn(m, 2 * component - 2);
MatrixUtil.resetColumn(m, 2 * component - 1);
MatrixUtil.resetColumn(m, 2 * component + 4);
MatrixUtil.resetColumn(m, 2 * component + 5);
m.resetRow(2 * component - 2);
m.resetRow(2 * component - 1);
m.resetRow(2 * component + 4);
m.resetRow(2 * component + 5);

m.resetColumn(2 * component - 2);
m.resetColumn(2 * component - 1);
m.resetColumn(2 * component + 4);
m.resetColumn(2 * component + 5);
}

private static void add22Bloc(double mx, double my, int i, int j, DenseMatrix m) {
Expand All @@ -235,7 +234,7 @@ private static DenseMatrix productMatrixM1M2M3(DenseMatrix m1, DenseMatrix m2, D
DenseMatrix mResult = m1.times(m2M3);

// clean matrix (reset to zero very low values) in case after fortescue and inverse multiplication
MatrixUtil.clean(mResult, EPS_VALUE);
mResult.removeSmallValues(EPS_VALUE);

return mResult;
}
Expand Down
45 changes: 0 additions & 45 deletions src/main/java/com/powsybl/openloadflow/util/MatrixUtil.java

This file was deleted.