Skip to content

Collect linalg .def bindings in wrap_factorization.cpp into local CPP macros #892

@tigercosmos

Description

@tigercosmos

Follow-up from review of #815.

cpp/modmesh/linalg/pymod/wrap_factorization.cpp repeats the same mod.def(...) shape for every LA free function (lu_factorization, lu_solve, lu_inv, lu_det, the llt_* family) across four element types each. The boilerplate could be collapsed with local CPP macros that are #undef-ed at the end of the file, e.g.:

#define MM_DECL_LADEF(T) \
    mod.def( \
        "lu_det", [](SimpleArray<T> const & a) \
    ...
#undef MM_DECL_LADEF

Scope: refactor the .def calls in wrap_factorization.cpp (and consider the sibling LA wrap files) to use such macros. Behavior and the exposed Python API stay unchanged.

Raised by @yungyuc in #815.

Metadata

Metadata

Assignees

No one assigned

    Labels

    arrayMulti-dimensional array implementationrefactorChange code without changing tests

    Type

    No fields configured for Bug.

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions