diff options
author | Gael Guennebaud <g.gael@free.fr> | 2018-06-07 16:09:22 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2018-06-07 16:09:22 +0200 |
commit | c25034710ede8eb7e177e8a7426817b6a29e5440 (patch) | |
tree | 2efc3b98b4ef44807634d4585dbf99c6d9addd39 /doc | |
parent | 37348d03aee064e66c5969fb3f08080397d6a9c2 (diff) |
Fiw some warnings in dox examples
Diffstat (limited to 'doc')
-rw-r--r-- | doc/examples/Cwise_lgamma.cpp | 2 | ||||
-rw-r--r-- | doc/examples/Tutorial_simple_example_dynamic_size.cpp | 2 | ||||
-rw-r--r-- | doc/special_examples/Tutorial_sparse_example.cpp | 6 |
3 files changed, 7 insertions, 3 deletions
diff --git a/doc/examples/Cwise_lgamma.cpp b/doc/examples/Cwise_lgamma.cpp index f1c4f503e..6bfaccbce 100644 --- a/doc/examples/Cwise_lgamma.cpp +++ b/doc/examples/Cwise_lgamma.cpp @@ -6,4 +6,4 @@ int main() { Array4d v(0.5,10,0,-1); std::cout << v.lgamma() << std::endl; -}
\ No newline at end of file +} diff --git a/doc/examples/Tutorial_simple_example_dynamic_size.cpp b/doc/examples/Tutorial_simple_example_dynamic_size.cpp index 0f0280e0e..defcb1ee4 100644 --- a/doc/examples/Tutorial_simple_example_dynamic_size.cpp +++ b/doc/examples/Tutorial_simple_example_dynamic_size.cpp @@ -10,7 +10,7 @@ int main() MatrixXi m(size,size+1); // a (size)x(size+1)-matrix of int's for (int j=0; j<m.cols(); ++j) // loop over columns for (int i=0; i<m.rows(); ++i) // loop over rows - m(i,j) = i+j*m.rows(); // to access matrix coefficients, + m(i,j) = i+j*size; // to access matrix coefficients, // use operator()(int,int) std::cout << m << "\n\n"; } 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 <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 unknowns (=number of pixels) |