80template <
typename MatType>
98 SubMatrix(MatType& m,
long x,
long y,
long nrows,
long ncols)
128 for (; rA <
end_row; ++rA, ++rB)
142 for (; rA <
end_row; ++rA, ++rB)
148 auto& a =
matrix.entry(rA, cA);
154 template <
typename ElementType>
160 for (; rA <
end_row; ++rA, ++rB)
165 matrix.ring().addMultipleTo(
170 template <
typename ElementType>
177 auto& a =
matrix.entry(rA, cA);
178 matrix.ring().mult(a, a, c);
184template <
typename MatType>
186 typename MatType::CoeffRing::RealElementType&
result)
188 const auto& C = M.
matrix.ring();
189 const auto& R = C.real_ring();
190 typename MatType::CoeffRing::RealRingType::Element c(R);
195 C.abs_squared(c, M.
matrix.entry(rA, cA));
200template <
typename MatType>
205template <
typename MatType>
212template <
typename RT>
215 for (
int r = 0; r < A.
numRows(); ++r)
217 if (!A.
ring().is_zero(A.
entry(r,c)))
return false;
221template <
typename RT>
228 for (
int r = 0; r < A.
numRows(); ++r)
234template <
typename RT>
237 for (
int r = 0; r < A.
numRows(); ++r)
242template <
typename RT>
246 for (
int r = 0; r < A.
numRows(); ++r)
251template <
typename RT>
259 for (
int r = 0; r < A.
numRows(); ++r)
264template <
typename RT>
272 for (
int r = 0; r < A.
numRows(); ++r)
277template <
typename RT>
284 for (
int r = 0; r < A.
numRows(); ++r)
290template <
typename RT>
298template <
typename MatType>
304 M.ring().set_zero(M.entry(rA, cA));
308template <
typename RT>
314 for (; rA < wA.
end_row; ++rA, ++rB)
324template <
typename RT>
330 for (; rA < wA.
end_row; ++rA, ++rB)
336 auto& a = A.
entry(rA, cA);
343template <
typename RT>
346 const typename RT::ElementType& c,
351 typename RT::Element tmp(A.
ring());
354 for (; rA < wA.
end_row; ++rA, ++rB)
361 auto& a = A.
entry(rA, cA);
362 A.
ring().add(a, a, tmp);
368template <
typename RT>
371 const typename RT::ElementType& c,
378 for (; rA < wA.
end_row; ++rA, ++rB)
390template <
typename RT>
393 const typename RT::ElementType& c)
401 auto& a = A.
entry(rA, cA);
402 A.
ring().mult(a, a, c);
411template <
typename RT>
417template <
typename RT>
423template <
typename RT>
430template <
typename RT>
437template <
typename RT>
447template <
typename RT>
458template <
typename RT>
468 "'transpose' not written for sparse mutable matrices");
ElementType & entry(size_t row, size_t column)
const ACoeffRing & ring() const
size_t numColumns() const
const CoeffRing & ring() const
void addInPlace(const SMat &B)
void scalarMultInPlace(const elem &f)
bool is_equal(const SMat &B) const
void subtractInPlace(const SMat &B)
size_t numColumns() const
DMat<ACoeffRing> — dense-matrix template plus the umbrella that wires in every per-ring specialisatio...
VALGRIND_MAKE_MEM_DEFINED & result(result)
void normSquared(SubMatrix< MatType > M, typename MatType::CoeffRing::RealElementType &result)
SubMatrix< MatType > submatrix(MatType &m)
void scalarMult(DMat< RT > &A, MatrixWindow wA, const typename RT::ElementType &c, const DMat< RT > &B, MatrixWindow wB)
void scalarMultInPlace(DMat< RT > &A, const typename RT::ElementType &f)
void negateInPlace(DMat< RT > &A)
void set(DMat< RT > &A, MatrixWindow wA, const DMat< RT > &B, MatrixWindow wB)
bool isEqual(const DMat< RT > &A, const DMat< RT > &B)
bool isZero(const DMat< RT > &A)
void setZero(DMat< RT > &A, MatrixWindow wA)
void subtractInPlace(DMat< RT > &A, const DMat< RT > &B)
void addTo(DMat< RT > &A, MatrixWindow wA, const DMat< RT > &B, MatrixWindow wB)
void addMultipleTo(DMatZZpFFPACK &C, const DMatZZpFFPACK::ElementType &a, const DMatZZpFFPACK &A, const DMatZZpFFPACK &B)
void addInPlace(DMat< RT > &A, const DMat< RT > &B)
void transpose(const DMat< RT > &A, DMat< RT > &result)
SMat<ACoeffRing> — column-oriented sparse matrix template, dual of DMat<R>.
bool sameSize(const MatrixWindow &b) const
MatrixWindow(long x, long y, long nrows, long ncols)
Half-open rectangular submatrix descriptor: [begin_row, end_row) x [begin_column, end_column).
void addMultipleTo(ElementType &c, SubMatrix< MatType > src)
void operator*=(ElementType &c)
void operator+=(SubMatrix< MatType > src)
bool sameSize(const SubMatrix &b) const
void operator=(SubMatrix< MatType > src)
SubMatrix(MatType &m, long x, long y, long nrows, long ncols)