3
$\begingroup$

I have download sparselib++, but it seems that it can't be complied in Windows, only in Unix, I don't know. So can anyone recommend some which can be used in Visual Studio 2010? I want to do a large sparse matrix operation in VS2010. Thanks!

$\endgroup$
4
$\begingroup$

You will likely have trouble building any package that uses the Unix/Linux build system on Windows; instead, look for packages that are built using CMake (Cross-platform Make), which is much better about being able to install packages on either platform. SparseLib++ indeed looks like it was only intended for building on Unix.

To that end, I'd recommend PETSc or Trilinos. Jed Brown, one of the developers of PETSc, posts here often in case you're stuck with anything. There's also MTL4, which is supposed to work well with Windows and build Visual Studio project files.

There are also lots of sparse matrix data structures and routines in SciPy/NumPy if you're willing to interface to Python instead of using pure C++.

EDIT: Here's a big list of free linear algebra software, you can see which ones are in C, C++ or Fortran.

| cite | improve this answer | |
$\endgroup$
0
$\begingroup$

Assuming that you want a C++ library, Eigen could be a good candidate, depending on your need. It has a great interface and very good performances.

I used it with VS2010: as it's a template only library, you do not need to install anything, just add the link to the headers in your project.

Hope it helps!

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ Hi Dr_Sam, it is unbelievable, Eigen can't be compiled in my computer, for example, in ConjugateCongradient.h, error says "Scalar is not a member of "SparseMatrix", ...???? Do I just include <Eigen/Sparse>,<Eigen/IterativeLinearSolvers>,these forms, etc.? Thanks! $\endgroup$ – Hao Yu May 10 '13 at 15:21
  • $\begingroup$ That is strange. In my case, it worked immmediately, after having added the include path in the VC++ Directories and the includes like "<Eigen/Dense>" in the headers. Have you tried to create a simple example to see whether the problem comes from the "installation" or from how you use it? $\endgroup$ – Dr_Sam May 13 '13 at 5:50
0
$\begingroup$

GMRES is one of the best sparse matrix solvers. I don't know what size of matrix you want to solve, but I will suggest this site for GMRES (and most of the variations of GMRES). Here you can find its source and header files which you can add to your program and use it. They have given solved examples of all variations on that site. To know more about GMRES, search questions asked related GMRES on this forum. All the best.

| cite | improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.