Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
eigen
eigen
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 596
    • Issues 596
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Custom Issue Tracker
    • Custom Issue Tracker
  • Merge requests 17
    • Merge requests 17
  • Requirements
    • Requirements
    • List
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • libeigen
  • eigeneigen
  • Issues
  • #1286

Closed
Open
Created Dec 04, 2019 by Eigen Bugzilla@eigenbzMaintainer

Automatically adjust the prototype of functors for CwiseNullaryOp

Submitted by Gael Guennebaud @ggael

Assigned to Nobody

Link to original bugzilla bug (#1286)
Version: 3.3 (current stable)

Description

Created attachment 726
patch

Current functors passed to NullaryExpr must implement both operator()(i) and operator()(i,j) plus specialize internal::functor_has_linear_access<> for non trivial functors. This is rather painful and cumbersome to document (hence, this is currently not really documented!).

The proposed patch automatically detect whether the functor expose one or multiple of the following operators:

operator()()
operator()(i)
operator()(i,j)

and then a little helper augments the input functors with the missing operators.

With this change, no need to provide operator()(i,j) if nor i nor j are required (e.g., for random, and constant).

I'd like to push this change in 3.3 as it considerably help in documenting and using NullaryExpr.

Patch 726, "patch":
nullary_expr_auto_linear_access.diff

Blocking

#457 #720 (closed)

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