GithubHelp home page GithubHelp logo

powsybl-math-native's People

Contributors

celmhari avatar geofjamg avatar jonenst avatar sylvlecl avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

powsybl-math-native's Issues

Creating a sparse matrix using SparseMatrix's CSC constructor resulted in LU decomposition failure

Describe the current behavior

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)

Describe the expected behavior

Expected decomposition successful

Describe the steps

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);
}

}

Environment

powsybl-core 6.2.0-SNAPSHOT

Relevant Log Output

No response

Extra Information

No response

Docker

  • 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:

    • PowSyBl Version: 1.0.0
    • OS Version: Linux
  • 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)

SuitesParse installation fails

  • Please tell us about your environment:
    • PowSyBl Version: git master (2.6.1+)
    • OS Version: Linux kernel 5.3.6
    • Python 2.7.16 & 3.7.4
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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.