Skip to content

Reduce duplicate LAPACK Interfaces #6578

@Cstandardlib

Description

@Cstandardlib

Describe the Code Quality Issue

We now have 3 sets of LAPACK interfaces.

  1. namespace container::lapackConnector in source/source_base/module_container/base/third_party/lapack.h
  2. class LapackWrapper in source/source_base/module_external/lapack_wrapper.h, with only two useful routines that can be merged to 1.
  3. class LapackConnector in source/source_base/module_external/lapack_connector.h

These can be divided into two categories:

  1. Column Major (Fortran Style)

    • This interface is directly consistent with the original FORTRAN LAPACK
    • Except that the real and complex version have the same function parameter list for overloading, and some parameters are not referenced actually in real version.
    • Includes:
      1. namespace container::lapackConnector
      2. class LapackWrapper
  2. Row Major (used with C++ custom data type)

    • This set of interfaces employs some techniques to apply the column-major fortran LAPACK interface to the row-major C++ data structure, like ModuleBase::ComplexMatrix.
    • Includes: class LapackConnector

It is very confusing to have these three interfaces at the same time.

Proposed Solution

We should only have at most two different interfaces, one Column-Major, and one Row-Major.
It's better to use the unified one and expand new LAPACK routines there.

The duplicate one in class LapackWrapper in source/source_base/module_external/lapack_wrapper.h should be deprecated, and somehow merged into 1. namespace container::lapackConnector in source/source_base/module_container/base/third_party/lapack.h.

Metadata

Metadata

Assignees

No one assigned

    Labels

    InterfacesInterfaces with other packagesRefactorRefactor ABACUS codesUseful InformationUseful information for others to learn/study

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions