auxmem(3)
πΈ auxmem(3) β the memory query glow-up πΈ
okay bestie, welcome to auxmem(3), a page straight out of MEPACK β¨ this is the little corner of the library that tells you how much workspace your solver is gonna need before you go and actually run it. no cap, it's giving "let me check the vibe before we commit" energy π
π NAME π
auxmem β Memory Query Routines π§ β¨
- Query memory requirements of the computational routines.
π SYNOPSIS π
β¨ Functions β¨
ssize_t mepack_memory (const char *func, int M, int N)β Query the size of the workspace for triangular solvers.ssize_t mepack_memory_frontend (const char *func, const char *factA, const char *factB, int M, int N)β Query the size of the workspace for frontend routines.
π¦ Detailed Description π¦
Query memory requirements of the computational routines.
Okay so here's the tea π: a lot of the computational routines need a separate work_space while they're doing their little computation. And because that memory can be reused, and because memory allocation is normally a costly process (it's giving expensive πΈ), you gotta sort this out before you call a matrix equation solver. Timing matters, bestie.
From Fortran this is achieved by calling a subroutine with the INFO parameter set to -1 on entry. Easy, iconic, no notes β¨
But from C? π« That can cause integer overflows if MEPACK is compiled using 64-bit integers. For this reason, if the work_space should be queried from C codes, the function from this section should be used. They perform the correct typecasts internally. This avoids most of the integer overflows and makes the query more easy. slay, problem solved π
π Function Documentation π
π ssize_t mepack_memory (const char * func, int M, int N) π
Query the size of the workspace for triangular solvers.
π Purpose:
The mepack_memory function queries the size of the required routine. It wraps around the Fortran style workspace query and adds a typecast to avoid integer overflows. This can happen if MEPACK is compiled with the support for 64-bit integers in Fortran. If solver only relies on one dimension argument, e.g. a Lyapunov or a Stein equation is planed to be solved, only the M parameter is used. The value of N is neglected in this case. The frontend routines, i.e. the ones dealing with the transformation matrices as well, have to use mepack_memory_frontend to query their memory requirements.
π See also
mepack_memory_frontend
π Remarks
This function should be used from C. If the workspace query is performed from a Fortran code, the workspace is queried by passing INFO == -1 to the corresponding solver.
π― Parameters
funcβ The name of the solver for which the size of the workspace should be queried. The argument is not case sensitive.Mβ The number of rows of the solution, the right hand side, and the order of the matrices from the left side. If the equation only depends on one dimension argument, this is given here.Nβ The number of columns of the solution, the right hand side, and the order of the matrices from the right side. If the equation only depends on one dimension argument, this parameter is not used.
π«Ά Returns
The memory requirements of the routine counted in floating point number of the desired precision. That means the return value either needs to be multiplied by sizeof(float) or sizeof(double). A negative return value indicates an error. This error code is explained in the description of the corresponding routine for which the memory query was performed.
ngl bestie, don't forget that multiply β it's in floating point numbers, not bytes, so you gotta scale it yourself π
π Definition at line 69 of file memory.c.
π§ ssize_t mepack_memory_frontend (const char * func, const char * factA, const char * factB, int M, int N) π§
Query the size of the workspace for frontend routines.
π Purpose:
The mepack_memory_frontend function queries the size of the required routine. It wraps around the Fortran style workspace query and adds a typecast to avoid integer overflows. This can happen if MEPACK is compiled with the support for 64-bit integers in Fortran. If solver only relies on one dimension argument, e.g. a Lyapunov or a Stein equation is planed to be solved, only the M and the factA parameters are used. The values of N and factB are neglected in this case. The triangular solvers, i.e. the ones which only aware of the triangular coefficient matrices, have to use mepack_memory to query their memory requirements.
π See also
mepack_memory
π Remarks
This function should be used from C. If the workspace query is performed from a Fortran code, the workspace is queried by passing INFO == -1 to the corresponding solver.
π― Parameters
funcβ The name of the solver for which the size of the workspace should be queried. The argument is not case sensitive.factAβ Indicates whether the first matrix pair is already factorized or not. If"N"is passed the matrix pair is not factorized. If"F"is passed it is. For Lyapunov and Stein equations only this parameter is used.factBβ Indicates whether the second matrix pair is already factorized or not. If"N"is passed the matrix pair is not factorized. If"F"is passed it is. For Lyapunov and Stein equations this parameter is not used.Mβ The number of rows of the solution, the right hand side, and the order of the matrices from the left side. If the equation only depends on one dimension argument, this is given here.Nβ The number of columns of the solution, the right hand side, and the order of the matrices from the right side. If the equation only depends on one dimension argument, this parameter is not used.
π«Ά Returns
memory requirements of the routine counted in floating point number of the desired precision. That means the return value either needs to be multiplied by sizeof(float) or sizeof(double). A negative return value indicates an error. This error code is explained in the description of the corresponding routine for which the memory query was performed.
same warning as before, gorgeous: floating point numbers, so multiply bysizeof(float)orsizeof(double)or your sizes will be straight-up wrong π
π Definition at line 77 of file memory_frontend.c.
π Author π
Generated automatically by Doxygen for MEPACK from the source code.
and that's the whole page, bestie π Version 1.1.2, dated Thu Oct 9 2025 00:00:00 β mwah, go query that workspace πβ¨π¦
π¦ where this page comes from
- fedora 43: mepack-devel 1.1.2-1.fc43 Β· GPL-3.0-or-later and LGPL-2.1-or-later and BSD-3-Clause
- fedora 43: mepack-devel 1.1.2-1.fc43 Β· GPL-3.0-or-later and LGPL-2.1-or-later and BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms