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

◆ normSquared()

template<typename MatType>
void normSquared ( SubMatrix< MatType > M,
typename MatType::CoeffRing::RealElementType & result )

Definition at line 185 of file mat-arith.hpp.

187{
188 const auto& C = M.matrix.ring();
189 const auto& R = C.real_ring();
190 typename MatType::CoeffRing::RealRingType::Element c(R);
191 R.set_zero(result);
192 for (long rA = M.begin_row; rA < M.end_row; ++rA)
193 for (long cA = M.begin_column; cA < M.end_column; ++cA)
194 {
195 C.abs_squared(c, M.matrix.entry(rA, cA));
196 R.add(result, result, c);
197 }
198}
VALGRIND_MAKE_MEM_DEFINED & result(result)
const long begin_row
Definition mat-arith.hpp:84
const long begin_column
Definition mat-arith.hpp:86
const long end_column
Definition mat-arith.hpp:87
const long end_row
Definition mat-arith.hpp:85
MatType & matrix
Definition mat-arith.hpp:83

References SubMatrix< MatType >::begin_column, SubMatrix< MatType >::begin_row, SubMatrix< MatType >::end_column, SubMatrix< MatType >::end_row, SubMatrix< MatType >::matrix, and result().

Referenced by HomotopyConcrete< RT, FixedPrecisionHomotopyAlgorithm >::track().