Updates to the Sparse unsupported solvers module.

* change Sparse* specialization's signatures from <..., int Backend> to <..., typename Backend>. Update SparseExtra accordingly to use structs instead of the SparseBackend enum.
* add SparseLDLT Cholmod specialization
* for Cholmod and UmfPack, SparseLU, SparseLLT and SparseLDLT now use ei_solve_retval and have the new solve() method (to be closer to the 3.0 API).

* fix doc
This commit is contained in:
Romain Bossart
2010-10-04 20:56:54 +02:00
parent e3d01f85b2
commit c6503e03eb
15 changed files with 563 additions and 187 deletions

View File

@@ -1,24 +0,0 @@
#include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Eigen::MatrixXf m(2,4);
Eigen::VectorXf v(2);
m << 1, 2, 6, 9,
3, 1, 7, 2;
v << 2,
3;
MatrixXf::Index index;
// find nearest neighbour
(m.colwise() - v).colwise().squaredNorm().minCoeff(&index);
cout << "Nearest neighbour is column " << index << ":" << endl;
cout << m.col(index) << endl;
}

View File

@@ -1,21 +0,0 @@
#include <iostream>
#include <Eigen/Dense>
using namespace std;
int main()
{
Eigen::MatrixXf mat(2,4);
Eigen::MatrixXf v(2);
mat << 1, 2, 6, 9,
3, 1, 7, 2;
v << 0,
1;
//add v to each column of m
mat.colwise() += v;
std::cout << "Broadcasting result: " << std::endl;
std::cout << mat << std::endl;
}

View File

@@ -1,28 +0,0 @@
#include <Eigen/Dense>
#include <iostream>
using namespace std;
using namespace Eigen;
int main()
{
VectorXf v(2);
MatrixXf m(2,2), n(2,2);
v << 2,
5;
m << 0,2,
3,4;
n << 1,2,
3,4;
cout << "v.norm() = " << m.norm() << endl;
cout << "m.norm() = " << m.norm() << endl;
cout << "n.norm() = " << m.norm() << endl;
cout << endl;
cout << "v.squaredNorm() = " << v.squaredNorm() << endl;
cout << "m.squaredNorm() = " << m.squaredNorm() << endl;
cout << "n.squaredNorm() = " << n.squaredNorm() << endl;
}

View File

@@ -1,26 +0,0 @@
#include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Eigen::MatrixXf m(2,2);
m << 1, 2,
3, 4;
//get location of maximum
MatrixXf::Index maxRow, maxCol;
m.maxCoeff(&maxRow, &maxCol);
//get location of minimum
MatrixXf::Index minRow, minCol;
m.minCoeff(&minRow, &minCol);
cout << "Max at: " <<
maxRow << "," << maxCol << endl;
cout << "Min at: " <<
minRow << "," << minCol << endl;
}