powsybl / powsybl-math-native Goto Github PK
View Code? Open in Web Editor NEWLicense: Mozilla Public License 2.0
License: Mozilla Public License 2.0
Using SparseMatrix (int rowCount, int columnCount, int [] columnStart, int [] rowIndicators, double [] values) causes LU decomposition to fail
error log:
Exception in thread "main" com.powsybl.math.matrix.MatrixException: klu_analyze error KLU_INVALID
at com.powsybl.math.matrix.SparseLUDecomposition.init(Native Method)
at com.powsybl.math.matrix.SparseLUDecomposition.init(SparseLUDecomposition.java:49)
at com.powsybl.math.matrix.SparseLUDecomposition.(SparseLUDecomposition.java:43)
at com.powsybl.math.matrix.SparseMatrix.decomposeLU(SparseMatrix.java:330)
at com.powsybl.math.matrix.SparseMatrixTest.main(SparseMatrixTest.java:121)
Expected decomposition successful
SparseMatrix a =new SparseMatrix(2, 2, 2);
a.add(0, 0, 1d);
a.add(1, 0, 1d);
a.add(0, 1, 1d);
SparseMatrix m = new SparseMatrix(a.getRowCount(), a.getColumnCount(), a.getColumnStart(), a.getRowIndices(), a.getValues());
LUDecomposition decomposition = m.decomposeLU();
Problem solving:
This issue is caused by the variable "currentColumn" not being assigned during initialization
SparseMatrix(int rowCount, int columnCount, int[] columnStart, int[] rowIndices, double[] values) {
this.rowCount = rowCount;
this.columnCount = columnCount;
this.columnStart = Objects.requireNonNull(columnStart);
this.currentColumn = values.length;//Initialize here
columnValueCount = new int[columnCount];
this.rowIndices = new TIntArrayListHack(Objects.requireNonNull(rowIndices));
this.values = new TDoubleArrayListHack(Objects.requireNonNull(values));
fillColumnValueCount(this.columnCount, this.columnStart, columnValueCount, this.values);
}
}
powsybl-core 6.2.0-SNAPSHOT
No response
No response
Do you want to request a feature or report a bug?
Todo
What is the current behavior?
The Dockerfile and the README.md must be updated due to the changes introduced in #1. We can also remove the Dockerfile and explain how to build natively the library and package it for development purpose.
Using the Dockerfile helps to release the powsybl-math-native project, but only powsybl team is in charge of it.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
What is the expected behavior?
What is the motivation / use case for changing the behavior?
There is no need to set proxy in Dockerfile: the README.md file should explain how to setup proxy configuration via config.json file.
The dockerfile should generate the libmath.so
in the target/classes of the host machine. It's not sufficient to release powsybl-math-native because you need to build on Windows and MacOS.
Please tell us about your environment:
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, spectrum, etc)
(if a question doesn't apply, you can delete it)
Traceback (most recent call last):
File "/home/papa/aur/_power/powsybl-math-native/src/powsybl-math-native/suitesparse_patch.py", line 16, in <module>
tar.extractall()
File "/usr/lib/python3.7/tarfile.py", line 2002, in extractall
numeric_owner=numeric_owner)
File "/usr/lib/python3.7/tarfile.py", line 2044, in extract
numeric_owner=numeric_owner)
File "/usr/lib/python3.7/tarfile.py", line 2114, in _extract_member
self.makefile(tarinfo, targetpath)
File "/usr/lib/python3.7/tarfile.py", line 2163, in makefile
copyfileobj(source, target, tarinfo.size, ReadError, bufsize)
File "/usr/lib/python3.7/tarfile.py", line 253, in copyfileobj
buf = src.read(remainder)
File "/usr/lib/python3.7/gzip.py", line 276, in read
return self._buffer.read(size)
File "/usr/lib/python3.7/_compression.py", line 68, in readinto
data = self.read(len(byte_view))
File "/usr/lib/python3.7/gzip.py", line 482, in read
raise EOFError("Compressed file ended before the "
EOFError: Compressed file ended before the end-of-stream marker was reached
make[2]: *** [CMakeFiles/suitesparse.dir/build.make:100: suitesparse-prefix/src/suitesparse-stamp/suitesparse-patch] Error 1
make[1]: *** [CMakeFiles/Makefile2:77: CMakeFiles/suitesparse.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.