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

◆ fill_from_lapack_upper() [1/2]

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

Definition at line 100 of file lapack.cpp.

110{
111 (void) numcols;
112 // At this point, upper should be a zero matrix of size (min(numrows, numcols) x numcols)
113 assert(upper.numRows() == std::min(numrows, numcols));
114 assert(upper.numColumns() == numcols);
115 assert(MatrixOps::isZero(upper));
116
117 const double* U = lapack_numbers.data();
118 for (size_t c = 0; c < upper.numColumns(); c++, U += 2*numrows)
119 for (size_t r = 0; r <= c; ++r)
120 {
121 if (r >= upper.numRows()) break;
122 upper.ring().set_from_doubles(upper.entry(r, c), U[2*r], U[2*r+1]);
123 }
124}
size_t numRows() const
Definition dmat.hpp:144
ElementType & entry(size_t row, size_t column)
Definition dmat.hpp:148
const ACoeffRing & ring() const
Definition dmat.hpp:143
size_t numColumns() const
Definition dmat.hpp:145
void set_from_doubles(ElementType &result, double re, double im) const
Definition aring-CC.hpp:455
bool isZero(const DMat< RT > &A)

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