Skip to content

Simplify colvargrid derived classes #870

@jhenin

Description

@jhenin

A remark from @levo-str : in colvargrid derived classes, there are a lot of forwarded functions like this:

std::ostream &colvar_grid_scalar::write_restart(std::ostream &os)
{
  return colvar_grid<cvm::real>::write_restart(os);
}

Many of them are not used and can be removed entirely. Others can be just grabbed from the base class with using (C++11 and later). This would shave a bunch of code from colvargrid.cpp.

Specifically, the colvar_grid_scalar class would contain:

using  colvar_grid<cvm::real>::write_restart;

Edit: there are unused features in colvargrid_scalar (samples grid), and a lot of redundancy between colvargrid_count and colvargrid_scalar.

Action plan:

  • remove samples member from colvargrid_scalar
  • replace explicit forwards with using statements in declaration
  • merge colvargrid_count into a template class colvargrid_scalar with integer or real type

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintenanceNo user-visible effects

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions