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

◆ norm2()

template<typename RT>
void norm2 ( const DMat< RT > & M,
size_t n,
typename RT::RealElementType & result )
inline

Definition at line 338 of file SLP-imp.hpp.

341{
342 const auto& C = M.ring();
343 const auto& R = C.real_ring();
344 typename RT::RealRingType::Element c(R);
345 R.set_zero(result);
346 for (size_t i = 0; i < n; i++)
347 {
348 C.abs_squared(c, M.entry(0, i));
349 R.add(result, result, c);
350 }
351}
ElementType & entry(size_t row, size_t column)
Definition dmat.hpp:148
const ACoeffRing & ring() const
Definition dmat.hpp:143
VALGRIND_MAKE_MEM_DEFINED & result(result)

References DMat< ACoeffRing >::entry(), result(), and DMat< ACoeffRing >::ring().

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