File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -688,8 +688,9 @@ void ComputeRowHermiteNormalForm_Kernel(MyMatrix<T> &H, F f) {
688688 ListIdx.push_back (iRow);
689689 T eVal = H (iRow, iCol);
690690 ListX.push_back (eVal);
691- if (eVal != 0 )
691+ if (eVal != 0 ) {
692692 HasNonZero = true ;
693+ }
693694 }
694695 if (HasNonZero) {
695696 //
@@ -765,6 +766,19 @@ ComputeRowHermiteNormalForm(MyMatrix<T> const &M) {
765766 return {std::move (U), std::move (H)};
766767}
767768
769+ template <typename T>
770+ MyMatrix<T> ComputeRowHermiteNormalForm_first (MyMatrix<T> const &M) {
771+ int nbRow = M.rows ();
772+ MyMatrix<T> H = M;
773+ MyMatrix<T> U = IdentityMat<T>(nbRow);
774+ auto f = [&](auto g) -> void {
775+ g (H); // We need to update H because that is what we work on
776+ g (U);
777+ };
778+ ComputeRowHermiteNormalForm_Kernel (H, f);
779+ return U;
780+ }
781+
768782template <typename T>
769783MyMatrix<T> ComputeRowHermiteNormalForm_second (MyMatrix<T> const &M) {
770784 MyMatrix<T> H = M;
@@ -794,8 +808,9 @@ void ComputeColHermiteNormalForm_Kernel(MyMatrix<T> &H, F f) {
794808 ListIdx.push_back (iCol);
795809 T eVal = H (iRow, iCol);
796810 ListX.push_back (eVal);
797- if (eVal != 0 )
811+ if (eVal != 0 ) {
798812 HasNonZero = true ;
813+ }
799814 }
800815 if (HasNonZero) {
801816 //
You can’t perform that action at this time.
0 commit comments