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

◆ fill_from_lapack_upper() [2/2]

void fill_from_lapack_upper ( const std::vector< double > & lapack_numbers,
int numrows,
int numcols,
DMatRR & upper )

Definition at line 74 of file lapack.cpp.

84{
85 (void) numcols;
86 // At this point, upper should be a zero matrix of size (min(numrows, numcols) x numcols)
87 assert(upper.numRows() == std::min(numrows, numcols));
88 assert(upper.numColumns() == numcols);
89 assert(MatrixOps::isZero(upper));
90
91 const double* U = lapack_numbers.data();
92 for (size_t c = 0; c < upper.numColumns(); c++, U += numrows)
93 for (size_t r = 0; r <= c; ++r)
94 {
95 if (r >= upper.numRows()) break;
96 upper.entry(r, c) = U[r];
97 }
98}
size_t numRows() const
Definition dmat.hpp:144
ElementType & entry(size_t row, size_t column)
Definition dmat.hpp:148
size_t numColumns() const
Definition dmat.hpp:145
bool isZero(const DMat< RT > &A)

References DMat< ACoeffRing >::entry(), MatrixOps::isZero(), DMat< ACoeffRing >::numColumns(), and DMat< ACoeffRing >::numRows().

Referenced by Lapack::QR(), and Lapack::QR().