eigen/doc/examples/QuickStart_example2_dynamic.cpp
Jitse Niesen 9196b6b659 Add second example to QuickStart guide.
Also, some changes suggested by Keir and Benoit on mailing list.
2010-06-17 12:12:40 +01:00

16 lines
384 B
C++

#include <iostream>
#include <Eigen/Dense>
using Eigen::MatrixXd;
using Eigen::VectorXd;
int main(int, char *[])
{
MatrixXd m(3,3);
for (int rowIndex = 0; rowIndex < 3; ++rowIndex)
for (int columnIndex = 0; columnIndex < 3; ++columnIndex)
m(rowIndex, columnIndex) = rowIndex + 0.01 * columnIndex;
VectorXd v = VectorXd::Ones(3);
std::cout << m * v << std::endl;
}