24 #include <boost/make_shared.hpp> 49 for (
size_t i = 0; i < spectrumList_.size(); i += 3)
51 debugWriter.
WriteDeconvBlock(i, spectrumList_.at(i), spectrumList_.at(i + 1), spectrumList_.at(i + 2));
55 vector<MatrixPtr> readSpectrumList;
61 uint64_t spectrumIndex;
62 for (
size_t i = 0; i < debugReader.
NumBlocks(); ++i)
64 auto index =
static_cast<uint64_t
>(spectrumIndex);
66 readSpectrumList.push_back(A_);
67 readSpectrumList.push_back(B_);
68 readSpectrumList.push_back(C_);
73 for (
size_t i = 0; i < readSpectrumList.size(); ++i)
75 unit_assert(spectrumList_.at(i)->isApprox(*readSpectrumList.at(i)));
81 A_ = boost::make_shared<MatrixType>(3, 4);
82 B_ = boost::make_shared<MatrixType>(4, 3);
83 C_ = boost::make_shared<MatrixType>(3, 3);
84 *A_ << -14.834628974133, -15.729764770592, 56.292839002858, 30.766363712773,
85 79.595747995303, -8.356622426449, 20.840197237638, 83.801095382748,
86 87.889866880787, 13.75327399942, 86.730656404499, -0.46420627108677;
88 *B_ << 23.588885367543, 49.667231605868, -86.700220187964,
89 51.392601274063, -77.511392742378, 23.389497301117,
90 -78.475202879706, -62.60684915327, -42.39206607192,
91 59.595164405161, 2.1025961854091, 65.787705013259;
95 spectrumList_.push_back(A_);
96 spectrumList_.push_back(B_);
97 spectrumList_.push_back(C_);
99 MatrixPtr D = boost::make_shared<MatrixType>(3, 4);
100 MatrixPtr E = boost::make_shared<MatrixType>(4, 3);
101 MatrixPtr F = boost::make_shared<MatrixType>(3, 3);
107 spectrumList_.push_back(A_);
108 spectrumList_.push_back(B_);
109 spectrumList_.push_back(C_);
114 remove(
"DemuxDebugOutput_TestOut.log");
124 int main(
int argc,
char* argv[])
vector< MatrixPtr > spectrumList_
A class for reading demux matrices from file.
boost::shared_ptr< MatrixType > MatrixPtr
bool IsOpen() const
Should be called after construction to verify that the file was opened successfully.
A class for writing demux matrices to file.
#define unit_assert_operator_equal(expected, actual)
void ReadDeconvBlock(uint64_t &spectrumIndex, DemuxTypes::MatrixPtr masks, DemuxTypes::MatrixPtr solution, DemuxTypes::MatrixPtr signal)
Can be used to read through the blocks sequntially.
void WriteDeconvBlock(uint64_t spectrumIndex, DemuxTypes::MatrixPtr masks, DemuxTypes::MatrixPtr solution, DemuxTypes::MatrixPtr signal)
Writes a set of matrices with the given spectrum index to file.
bool IsOpen() const
Should be called after construction to verify that the file was opened successfully.
int main(int argc, char *argv[])
#define TEST_PROLOG(argc, argv)
size_t NumBlocks() const
Number of blocks (sets of matrices) that are contained in the file.