function_taking_eigenbase.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include <Eigen/Core>
3 using namespace Eigen;
4 
5 template <typename Derived>
7 {
8  std::cout << "size (rows, cols): " << b.size() << " (" << b.rows()
9  << ", " << b.cols() << ")" << std::endl;
10 }
11 
12 int main()
13 {
14  Vector3f v;
15  print_size(v);
16  // v.asDiagonal() returns a 3x3 diagonal matrix pseudo-expression
17  print_size(v.asDiagonal());
18 }
Scalar * b
Definition: benchVecAdd.cpp:17
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition: EigenBase.h:63
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index size() const EIGEN_NOEXCEPT
Definition: EigenBase.h:67
void print_size(const EigenBase< Derived > &b)
Array< int, Dynamic, 1 > v
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition: EigenBase.h:60


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:34:14