#include <vector>
#include <QImage>
{
int n = int(boundary.
size());
if(
i==-1 ||
i==
n)
b(
id) -=
w * boundary(
j);
else if(
j==-1 ||
j==
n)
b(
id) -=
w * boundary(
i);
else coeffs.push_back(
T(
id,id1,
w));
}
{
{
{
}
}
}
{
QImage img(bits.
data(),
n,
n,QImage::Format_Indexed8);
img.setColorCount(256);
for(
int i=0;
i<256;
i++) img.setColor(
i,qRgb(
i,
i,
i));
img.save(filename);
}
Eigen::SparseMatrix< double > SpMat
void buildProblem(std::vector< T > &coefficients, Eigen::VectorXd &b, int n)
Eigen::Triplet< double > T
void saveAsBitmap(const Eigen::VectorXd &x, int n, const char *filename)
void insertCoefficient(int id, int i, int j, double w, std::vector< T > &coeffs, Eigen::VectorXd &b, const Eigen::VectorXd &boundary)
General-purpose arrays with easy API for coefficient-wise operations.
static EIGEN_DEPRECATED const RandomAccessLinSpacedReturnType LinSpaced(Sequential_t, Index size, const Scalar &low, const Scalar &high)
EIGEN_CONSTEXPR Index size() const EIGEN_NOEXCEPT
The matrix class, also used for vectors and row-vectors.
const Scalar * data() const