Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • D dune-istl
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 32
    • Issues 32
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 29
    • Merge requests 29
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Core ModulesCore Modules
  • dune-istl
  • Merge requests
  • !425

Provide hybrid range and size utilities for matrices and vectors

  • Review changes

  • Download
  • Patches
  • Plain diff
Open Simon Praetorius requested to merge feature/hybrid-num-rows-cols into master Mar 12, 2021
  • Overview 2
  • Commits 1
  • Pipelines 1
  • Changes 5

Summary

This MR extends the idea of hybrid size from dune-common to matrices and vectors. It provides free functions Hybrid::numRows, Hybrid::numCols and Hybrid::numEntries for number of rows and number of columns of matrices, as well as number of entries in a vector, respectively. Thereby the specialization is done with dynamic-first idea. If a container provides dynamic index access, the corresponding size functions return a std::size_t. Otherwise if element access is not dynamic and size is a static constant, the methods provide size information as std::integral_constant. This allows to iterate over the containers using Hybrid::forEach where again, dynamic iteration is preferred over static (unrolled/recursive) iteration.

Discussion

  • The dynamic-first principle is used here for (typically) faster compile-times and better readable error messages. For vectors you have in dune-common also a static-first principle implemented in Dune::Hybrid::size.
  • I'm not yet sure about the naming of the functions. I have to distinguish numEntries from size for vectors.
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: feature/hybrid-num-rows-cols