Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
  • eigen eigen
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 653
    • Issues 653
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Custom issue tracker
    • Custom issue tracker
  • Merge requests 17
    • Merge requests 17
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • libeigen
  • eigeneigen
  • Issues
  • #1736
Closed
Open
Created Dec 04, 2019 by Eigen Bugzilla@eigenbzReporter

Column access of some IndexedView won't compile

Submitted by Antoine Bussy

Assigned to Nobody

Link to original bugzilla bug (#1736)
Version: 3.4 (development)

Description

Hi,

The following code won't compile on clang-7 (I also tried gcc-9 and clang-8 on https://godbolt.org/):

#include <Eigen/Core>
#include <array>

auto indexed_view_col()
{
auto const m = Eigen::Matrix4d::Random().eval();
auto ok = m(Eigen::all, Eigen::seq(1, Eigen::last)).col(0).eval();
auto ok2 = m(Eigen::all, Eigen::seq(0, 1)).col(0).eval();
auto err = m(Eigen::all, std::arrayEigen::Index,2{0,1}).col(0).eval();
auto err2= m(Eigen::all, Eigen::VectorEigen::Index,2(0, 1)).col(0).eval();
}

The compilers don't seem to find the unary version of coeff(), and indeed, it isn't in IndexedView.h (whereas it is present in Block.h). I implemented it similarly to Block's:

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
CoeffReturnType coeff(Index index) const
{
return coeff((m_xpr.rows() == 1 ? 0 : index),
(m_xpr.rows() == 1 ? index : 0));
}

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
Scalar& coeffRef(Index index)
{
return coeffRef((m_xpr.rows() == 1 ? 0 : index),
(m_xpr.rows() == 1 ? index : 0));
}

and it seems to solve my problem. but I'm not familiar with Eigen's internals at all, so the root cause might be elsewhere?

Blocking

#814 (closed)

Edited Dec 05, 2019 by Eigen Bugzilla
Assignee
Assign to
Time tracking