diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2018-11-12 06:42:35 +0100 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-11-12 06:42:35 +0100 |
| commit | 407b6208604d2822b1067ac64949e78a9167572b (patch) | |
| tree | 8e4371deef2804e77e2fe6e17158be2536de28da /eigen/doc/special_examples | |
| parent | ca2e0fcdcfff03747500344e2522ff330ccafa14 (diff) | |
eigen update
Diffstat (limited to 'eigen/doc/special_examples')
| -rw-r--r-- | eigen/doc/special_examples/Tutorial_sparse_example.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/eigen/doc/special_examples/Tutorial_sparse_example.cpp b/eigen/doc/special_examples/Tutorial_sparse_example.cpp index 830e196..c5767a8 100644 --- a/eigen/doc/special_examples/Tutorial_sparse_example.cpp +++ b/eigen/doc/special_examples/Tutorial_sparse_example.cpp @@ -1,5 +1,6 @@ #include <Eigen/Sparse> #include <vector> +#include <iostream> typedef Eigen::SparseMatrix<double> SpMat; // declares a column-major sparse matrix type of double typedef Eigen::Triplet<double> T; @@ -9,7 +10,10 @@ void saveAsBitmap(const Eigen::VectorXd& x, int n, const char* filename); int main(int argc, char** argv) { - assert(argc==2); + if(argc!=2) { + std::cerr << "Error: expected one and only one argument.\n"; + return -1; + } int n = 300; // size of the image int m = n*n; // number of unknows (=number of pixels) |
