From c25034710ede8eb7e177e8a7426817b6a29e5440 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 7 Jun 2018 16:09:22 +0200 Subject: Fiw some warnings in dox examples --- doc/special_examples/Tutorial_sparse_example.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'doc/special_examples') diff --git a/doc/special_examples/Tutorial_sparse_example.cpp b/doc/special_examples/Tutorial_sparse_example.cpp index 89937b411..8850db052 100644 --- a/doc/special_examples/Tutorial_sparse_example.cpp +++ b/doc/special_examples/Tutorial_sparse_example.cpp @@ -1,5 +1,6 @@ #include #include +#include typedef Eigen::SparseMatrix SpMat; // declares a column-major sparse matrix type of double typedef Eigen::Triplet 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 unknowns (=number of pixels) -- cgit v1.2.3