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.
Follow-up from review of #815.
cpp/modmesh/linalg/pymod/wrap_factorization.cpprepeats the samemod.def(...)shape for every LA free function (lu_factorization,lu_solve,lu_inv,lu_det, thellt_*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.:Scope: refactor the
.defcalls inwrap_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.