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)
65 readSpectrumList.push_back(A_);
66 readSpectrumList.push_back(B_);
67 readSpectrumList.push_back(C_);
72 for (
size_t i = 0; i < readSpectrumList.size(); ++i)
74 unit_assert(spectrumList_.at(i)->isApprox(*readSpectrumList.at(i)));
80 A_ = boost::make_shared<MatrixType>(3, 4);
81 B_ = boost::make_shared<MatrixType>(4, 3);
82 C_ = boost::make_shared<MatrixType>(3, 3);
83 *A_ << -14.834628974133, -15.729764770592, 56.292839002858, 30.766363712773,
84 79.595747995303, -8.356622426449, 20.840197237638, 83.801095382748,
85 87.889866880787, 13.75327399942, 86.730656404499, -0.46420627108677;
87 *B_ << 23.588885367543, 49.667231605868, -86.700220187964,
88 51.392601274063, -77.511392742378, 23.389497301117,
89 -78.475202879706, -62.60684915327, -42.39206607192,
90 59.595164405161, 2.1025961854091, 65.787705013259;
94 spectrumList_.push_back(A_);
95 spectrumList_.push_back(B_);
96 spectrumList_.push_back(C_);
98 MatrixPtr D = boost::make_shared<MatrixType>(3, 4);
99 MatrixPtr E = boost::make_shared<MatrixType>(4, 3);
100 MatrixPtr F = boost::make_shared<MatrixType>(3, 3);
106 spectrumList_.push_back(A_);
107 spectrumList_.push_back(B_);
108 spectrumList_.push_back(C_);
113 remove(
"DemuxDebugOutput_TestOut.log");
123 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.