chessai / eigen Goto Github PK
View Code? Open in Web Editor NEWHaskell bindings to the Eigen C++ library
License: Other
Haskell bindings to the Eigen C++ library
License: Other
@chessai thank you for taking care of this package.
I noticed that build is broken on ubuntu:xenial:
/tmp/stack1/eigen-3.3.4.1/cbits/eigen-sparse.cpp:24:5: error:
error: ‘unique_ptr’ is not a member of ‘std’
std::unique_ptr<M> a(new M(rows, cols));
^
as well as cabal file is not compatible with LTS Haskell < 12.x due to cabal version mismatch.
I'm new to Eigen and the haskell wrapper--which looks amazing!--so forgive me if this is an already answered and/or obvious question.
I see that the wrapper for Sparse solvers provides the LU and QR but not the simplical Cholesky solvers. Is that a licensing issue (since those are LGPL instead of MPL2), because they depend on external libraries (CHOLMOD ?) or something else?
I'd like to use them. I'm trying to replicate some of the functionality of Rs lme4 package and the simplical cholesky stuff is at the heart of it, at least for problems of any significant size.
I'd be happy to work on a PR--though I have no idea how hard it is!--or a separate library that has eigen as a dependency if that somehow helps with the licensing, dependency issues?
Anyway, any info would be much appreciated! I'm looking forward to using eigen!
Hey Oleg,
I've been following the eigen utorial and it looks like some functions, available in C++, such as
AngleAxis(angle,axis); are not available in haskell-eigen. Are you, perhaps, planning to support more
functions at some point or could you give some directions on how I could achieve that? Or, mayby, I
misunderstand how to use the library and access such functions, in which case - could you provide
some info on that?
Regards,
Vlad
by @madjestic
as is the coeff
function checks if the row, col vals are less than or equal to the dimensions of the array... but it should just be less than :(
opened by: @taktoa
Why is it that Data.Eigen.SparseMatrix.Mutable defines IOSparseMatrix a b instead of a MSparseMatrix a b s that can be used in the ST monad? Are the sparse matrix operations exported by Eigen not pure?
Is it possible to efficiently get a row, column, or diagonal of a sparse matrix as a sparse vector? Are map
and imap available for sparse matrices and sparse vectors?
For the first question: It looks like
eigen
itself does not carry those operations for sparse matrices.
Such a change would need to take place ineigen
itself.
For the second question: I think so. A function called_map
exists but is not exported from
Data.Eigen.SparseMatrix
, here:
_map :: I.Elem a b => (a -> a) -> SparseMatrix a b -> SparseMatrix a b
_map f m = fromVector (rows m) (cols m) . VS.map g . toVector $ m where
g (I.CTriplet r c v) = I.CTriplet r c $ I.cast $ f $ I.cast v
I think an 'imap' could exist. It might look like this:
_imap :: I.Elem a b => (Int -> Int -> a -> a) -> SparseMatrix a b -> SparseMatrix a b
_imap f m = fromVector rs cs . VS.map g . toVector $ m where
rs = rows m
cs = cols m
g n (I.CTriplet r c v) = I.CTriplet r c $ I.cast $ f r' c' $ I.cast v where
(c', r') = divMod n rs
It would be nice to have row major support in addition to column major.
What happened to these functions?
Hi,
I've been looking for a suitable linear algebra package to be used in a finite element solver I'm writing just for fun, and this package looks very nice. The only thing is that I can't figure out how to work with large sparse equation systems emerging from FEM whose size can't be known at compile time. Is it somehow possible?
I'm a mediocre haskeller and haven't used type literals or many of the extensions used in the code. I tried to look around the code. It seems that there are quite many KnownNat constraints in many of the functions although the C-interface layer could also work with dynamically sized matrices.
There are some functions missing after the refactor. They were simply forgotten when re-implementing the library. @GregorySchwartz brought some good ones up. If anyone notices any more, please report them here. I will be looking through and re-implementing them, taking note here.
Is it possible to add functions to return eigenvectors and eigenvalues from sparse eigen matrices? I'm not sure if eigen does it, but there are libraries built on eigen which do this.
http://eigen.tuxfamily.org/dox/unsupported/index.html
Would you be willing to take contributions allowing users to use unsupported code from Eigen?
A lot of the stuff inside of the unsupported modules seems to be well-tested, user-supplied code, as well
as being very useful. For example, the unsupported modules define things such as the Kronecker
Product and FFT.
I would put these in Data.Eigen.Unsupported.X or something. I am willing to start work on such a
contribution(s).
almost all functions in eigen are good candidates for inlining. some of the internal functions should probably just be marked INLINEABLE.
Lots of functions in this module are not total. I plan to use refined
to make them total.
Another thing, the Matrix types are totally unsafe. Basically, I think Matrix
should look like this:
data Matrix :: Nat -> Nat -> Type -> Type where
Matrix :: !(Vector (C a)) -> a
C
is a closed injective type family that maps Haskell types to their C counterparts. In other words,
a ~ Complex ===> C a ~ CComplex
, etc.
Eigen 3.3.5 was released. Can Haskell bindings be updated to use Eigen 3.3.5 version ?
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.