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

◆ rankProfile() [1/5]

template<typename RT>
M2_arrayintOrNull MatrixOps::rankProfile ( const DMat< RT > & A,
bool row_profile )
inline

Definition at line 615 of file mat-linalg.hpp.

616{
617 std::vector<size_t> profile;
618 if (row_profile)
619 {
620 // First transpose A
621 DMat<RT> B(A.ring(), A.numColumns(), A.numRows());
623 DMatLinAlg<RT> LUdecomp(B);
624 LUdecomp.columnRankProfile(profile);
625 return stdvector_to_M2_arrayint(profile);
626 }
627 else
628 {
629 DMatLinAlg<RT> LUdecomp(A);
630 LUdecomp.columnRankProfile(profile);
631 return stdvector_to_M2_arrayint(profile);
632 }
633}
size_t numRows() const
Definition dmat.hpp:144
const ACoeffRing & ring() const
Definition dmat.hpp:143
size_t numColumns() const
Definition dmat.hpp:145
Definition dmat.hpp:62
void transpose(const DMat< RT > &A, DMat< RT > &result)
M2_arrayint stdvector_to_M2_arrayint(const std::vector< T > &v)
Definition util.hpp:79

References DMatLinAlg< RingType >::columnRankProfile(), DMat< ACoeffRing >::numColumns(), DMat< ACoeffRing >::numRows(), DMat< ACoeffRing >::ring(), stdvector_to_M2_arrayint(), and transpose().