Macaulay2 Engine
Loading...
Searching...
No Matches

◆ rankProfile() [1/2]

M2_arrayintOrNull ffpackInterface::rankProfile ( const DMatZZpFFPACK & A,
bool row_profile )

Definition at line 237 of file dmat.cpp.

239{
240 DMatZZpFFPACK N(mat);
241
242 size_t* prof; // this is where the result will be placed
243 size_t rk;
244 if (row_profile)
245 rk = FFPACK::RowRankProfile(mat.ring().field(),
246 mat.numRows(),
247 mat.numColumns(),
248 N.rowMajorArray(),
249 mat.numColumns(),
250 prof);
251 else
252 rk = FFPACK::ColumnRankProfile(mat.ring().field(),
253 mat.numRows(),
254 mat.numColumns(),
255 N.rowMajorArray(),
256 mat.numColumns(),
257 prof);
258
259 M2_arrayint profile = M2_makearrayint(static_cast<int>(rk));
260 for (size_t i = 0; i < rk; i++) profile->array[i] = static_cast<int>(prof[i]);
261
262 delete[] prof;
263 return profile;
264}
M2_arrayint M2_makearrayint(int n)
Definition m2-types.cpp:6
#define DMatZZpFFPACK

References DMatZZpFFPACK, and M2_makearrayint().

Referenced by DMatLinAlg< M2::ARingZZpFFPACK >::columnRankProfile().