mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-11-27 06:30:28 +08:00
Fiw some warnings in dox examples
This commit is contained in:
parent
37348d03ae
commit
c25034710e
@ -6,4 +6,4 @@ int main()
|
|||||||
{
|
{
|
||||||
Array4d v(0.5,10,0,-1);
|
Array4d v(0.5,10,0,-1);
|
||||||
std::cout << v.lgamma() << std::endl;
|
std::cout << v.lgamma() << std::endl;
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ int main()
|
|||||||
MatrixXi m(size,size+1); // a (size)x(size+1)-matrix of int's
|
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 j=0; j<m.cols(); ++j) // loop over columns
|
||||||
for (int i=0; i<m.rows(); ++i) // loop over rows
|
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)
|
// use operator()(int,int)
|
||||||
std::cout << m << "\n\n";
|
std::cout << m << "\n\n";
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#include <Eigen/Sparse>
|
#include <Eigen/Sparse>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
typedef Eigen::SparseMatrix<double> SpMat; // declares a column-major sparse matrix type of double
|
typedef Eigen::SparseMatrix<double> SpMat; // declares a column-major sparse matrix type of double
|
||||||
typedef Eigen::Triplet<double> T;
|
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)
|
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 n = 300; // size of the image
|
||||||
int m = n*n; // number of unknowns (=number of pixels)
|
int m = n*n; // number of unknowns (=number of pixels)
|
||||||
|
Loading…
Reference in New Issue
Block a user