MCPcopy Create free account
hub / github.com/ablab/spades / Realloc

Method Realloc

ext/src/spoa/src/sisd_alignment_engine.cpp:82–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82void SisdAlignmentEngine::Realloc(
83 std::uint64_t matrix_width,
84 std::uint64_t matrix_height,
85 std::uint8_t num_codes) {
86 if (pimpl_->node_id_to_rank.size() < matrix_height - 1) {
87 pimpl_->node_id_to_rank.resize(matrix_height - 1, 0);
88 }
89 if (pimpl_->sequence_profile.size() < num_codes * matrix_width) {
90 pimpl_->sequence_profile.resize(num_codes * matrix_width, 0);
91 }
92 if (subtype_ == AlignmentSubtype::kLinear) {
93 if (pimpl_->M.size() < matrix_height * matrix_width) {
94 pimpl_->M.resize(matrix_width * matrix_height, 0);
95 pimpl_->H = pimpl_->M.data();
96 pimpl_->F = nullptr;
97 pimpl_->E = nullptr;
98 }
99 } else if (subtype_ == AlignmentSubtype::kAffine) {
100 if (pimpl_->M.size() < 3 * matrix_height * matrix_width) {
101 pimpl_->M.resize(3 * matrix_width * matrix_height, 0);
102 pimpl_->H = pimpl_->M.data();
103 pimpl_->F = pimpl_->H + matrix_width * matrix_height;
104 pimpl_->E = pimpl_->F + matrix_width * matrix_height;
105 }
106 } else if (subtype_ == AlignmentSubtype::kConvex) {
107 if (pimpl_->M.size() < 5 * matrix_height * matrix_width) {
108 pimpl_->M.resize(5 * matrix_width * matrix_height, 0);
109 pimpl_->H = pimpl_->M.data();
110 pimpl_->F = pimpl_->H + matrix_width * matrix_height;
111 pimpl_->E = pimpl_->F + matrix_width * matrix_height;
112 pimpl_->O = pimpl_->E + matrix_width * matrix_height;
113 pimpl_->Q = pimpl_->O + matrix_width * matrix_height;
114 }
115 }
116}
117
118void SisdAlignmentEngine::Initialize(
119 const char* sequence, std::uint32_t sequence_len,

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.45
resizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected