50 vector<double> expectedSolution = {
61 double trailingWindowIntensity = 0.0;
63 TestNNLSGivenSolution(expectedSolution, trailingWindowIntensity);
76 TestNNLSGivenSolution(expectedSolution, trailingWindowIntensity);
86 int numDemuxWindows = 7;
87 int numTransitions = 1;
88 signal.reset(
new MatrixType(numSpectra, numTransitions));
89 masks.reset(
new MatrixType(numSpectra, numDemuxWindows));
90 solution.reset(
new MatrixType(numDemuxWindows, numTransitions));
104 for (
int i = 0; i < numSpectra; ++i)
106 for (
int j = 0; j < numDemuxWindows; ++j)
108 if (j == i || j == i + 1)
110 masks->row(i)[j] = 1.0;
114 masks->row(i)[j] = 0.0;
120 vector<double> signalVec;
121 for (
int i = 0; i < numSpectra; ++i)
123 double signalSum = expectedSolution[i];
124 if (i + 1 < numSpectra)
125 signalSum += expectedSolution[i + 1];
127 signalSum += trailingWindowIntensity;
128 signalVec.push_back(signalSum);
130 for (
size_t i = 0; i < signalVec.size(); ++i)
132 signal->row(i)[0] = signalVec[i];
135 solver.
Solve(masks, signal, solution);
138 for (
size_t i = 0; i < expectedSolution.size(); ++i)
145 int main(
int argc,
char* argv[])