Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kbinani/lusolve
https://github.com/kbinani/lusolve
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/kbinani/lusolve
- Owner: kbinani
- Created: 2014-11-07T19:45:39.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-11-08T10:22:34.000Z (about 10 years ago)
- Last Synced: 2023-03-22T14:19:32.142Z (over 1 year ago)
- Language: C++
- Size: 117 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lusolve
C++ port of ruby's `LUSolve` module, solves `A・x = b` for `x`, using LU decomposition.
# usage
```c++
#include "lusolve.hpp"
#includeint main()
{
int const kSize = 3;
std::vector> a;
a.resize(kSize);
std::fill_n(a.begin(), kSize, std::vector(kSize));
a[0][0] = 1;
a[0][1] = 2;
// setup matrix "a".
// ...std::vector b;
b.resize(kSize);
// setup vector "b".
// ...std::vector x;
try {
x = LUSolve::lusolve(a, b);
} catch (std::runtime_error const&) {
// in case singular matrix
}return 0;
}
```# license
Same as ruby's license.
* https://github.com/ruby/ruby/blob/2cd6800fd8437b1f862f3f5c44db877159271d17/COPYING