summaryrefslogtreecommitdiffhomepage
path: root/eigen/doc/examples/Tutorial_BlockOperations_vector.cpp
blob: 4a0b02342435c4c71094b42cb5e90907d311c483 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <Eigen/Dense>
#include <iostream>

using namespace std;

int main()
{
  Eigen::ArrayXf v(6);
  v << 1, 2, 3, 4, 5, 6;
  cout << "v.head(3) =" << endl << v.head(3) << endl << endl;
  cout << "v.tail<3>() = " << endl << v.tail<3>() << endl << endl;
  v.segment(1,4) *= 2;
  cout << "after 'v.segment(1,4) *= 2', v =" << endl << v << endl;
}