tut_matrix_coefficient_accessors.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include <Eigen/Dense>
3 
4 int main()
5 {
6  Eigen::MatrixXd m(2,2);
7  m(0,0) = 3;
8  m(1,0) = 2.5;
9  m(0,1) = -1;
10  m(1,1) = m(1,0) + m(0,1);
11  std::cout << "Here is the matrix m:\n" << m << std::endl;
12  Eigen::VectorXd v(2);
13  v(0) = 4;
14  v(1) = v(0) - 1;
15  std::cout << "Here is the vector v:\n" << v << std::endl;
16 }
Matrix3f m
Array< int, Dynamic, 1 > v
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:182