MatrixBase_colwise_iterator_cxx11.cpp
Go to the documentation of this file.
1 Matrix3i m = Matrix3i::Random();
2 cout << "Here is the initial matrix m:" << endl << m << endl;
3 int i = -1;
4 for(auto c: m.colwise()) {
5  c *= i;
6  ++i;
7 }
8 cout << "Here is the matrix m after the for-range-loop:" << endl << m << endl;
9 auto cols = m.colwise();
10 auto it = std::find_if(cols.cbegin(), cols.cend(),
11  [](Matrix3i::ConstColXpr x) { return x.squaredNorm() == 0; });
12 cout << "The first empty column is: " << distance(cols.cbegin(),it) << endl;
c
Scalar Scalar * c
Definition: benchVecAdd.cpp:17
m
Matrix3i m
Definition: MatrixBase_colwise_iterator_cxx11.cpp:1
x
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Definition: gnuplot_common_settings.hh:12
ConstColXpr
const typedef Block< const Derived, internal::traits< Derived >::RowsAtCompileTime, 1, !IsRowMajor > ConstColXpr
Definition: BlockMethods.h:15
gtsam::distance
Double_ distance(const OrientedPlane3_ &p)
Definition: slam/expressions.h:117
cols
int cols
Definition: Tutorial_commainit_02.cpp:1
i
int i
Definition: BiCGSTAB_step_by_step.cpp:9


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:03:06