MCPcopy Create free account
hub / github.com/ERGO-Code/HiGHS / lu_reallocix

Function lu_reallocix

highs/ipm/basiclu/basiclu_object.c:32–45  ·  view source on GitHub ↗

* lu_reallocix() - reallocate two arrays * * @nz new number of elements per array * @p_Ai location of pointer to integer memory * @p_Ax location of pointer to floating point memory * * If a reallocation fails, then do not overwrite the old pointer. * * Return: BASICLU_OK or BASICLU_ERROR_out_of_memory */

Source from the content-addressed store, hash-verified

30 * Return: BASICLU_OK or BASICLU_ERROR_out_of_memory
31 */
32static lu_int lu_reallocix(lu_int nz, lu_int **p_Ai, double **p_Ax)
33{
34 lu_int *Ainew;
35 double *Axnew;
36
37 Ainew = realloc(*p_Ai, nz * sizeof(lu_int));
38 if (Ainew)
39 *p_Ai = Ainew;
40 Axnew = realloc(*p_Ax, nz * sizeof(double));
41 if (Axnew)
42 *p_Ax = Axnew;
43
44 return Ainew && Axnew ? BASICLU_OK : BASICLU_ERROR_out_of_memory;
45}
46
47/*
48 * lu_realloc_obj()

Callers 1

lu_realloc_objFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected