Skip to content

Commit 51fe530

Browse files
Array::grow and Array::resize usage re-implemented properly
1 parent 8cabab4 commit 51fe530

File tree

4 files changed

+8
-13
lines changed

4 files changed

+8
-13
lines changed

documentation/release_6.3.htm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,14 @@ <h3>Known problems</h3>
9797
<H2>What is new for developers (aside from what should be obvious from the above):</H2>
9898

9999
<h3>New functionality</h3>
100-
100+
<ul>
101101
<li>
102102
<code>ProjDataInMemory</code> <code>read_from_file</code> method now returns a <code>ProjDataInMemory</code> object.
103103
</li>
104+
<li>
105+
<code>Array::resize</code> and <code>Array::grow</code> argument <code>initialise_with_0</code> usage fixed</code>.
106+
</li>
107+
</ul>
104108

105109
<h3>Changed functionality</h3>
106110
<ul>

src/buildblock/ProjDataInMemory.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ ProjDataInMemory::ProjDataInMemory(shared_ptr<const ExamInfo> const& exam_info_s
7373
void
7474
ProjDataInMemory::create_buffer(const bool initialise_with_0)
7575
{
76-
// this->buffer.set_initialise_with_zeros(initialise_with_0);
77-
this->buffer.grow(0, this->size_all() - 1, initialise_with_0);
76+
this->buffer.resize(0, this->size_all() - 1, initialise_with_0);
7877
}
7978

8079
///////////////// /set functions

src/include/stir/Array.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -451,14 +451,13 @@ class Array<1, elemT> : public NumericVectorWithOffset<elemT, elemT>
451451
inline virtual void grow(const IndexRange<1>& range);
452452

453453
// Array::grow initialises new elements to 0
454-
inline void grow(const int min_index, const int max_index, bool initialise_with_0);
455-
inline void grow(const int min_index, const int max_index);
454+
inline void grow(const int min_index, const int max_index) override;
456455

457456
//! Array::resize initialises new elements to 0
458457
inline virtual void resize(const IndexRange<1>& range);
459458

460459
// Array::resize initialises new elements to 0
461-
inline void resize(const int min_index, const int max_index, bool initialise_with_0) override;
460+
inline void resize(const int min_index, const int max_index, bool initialise_with_0);
462461
inline void resize(const int min_index, const int max_index) override;
463462

464463
//! \name access to the data via a pointer

src/include/stir/Array.inl

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -620,13 +620,6 @@ Array<1, elemT>::resize(const IndexRange<1>& range)
620620
resize(range.get_min_index(), range.get_max_index());
621621
}
622622

623-
template <class elemT>
624-
void
625-
Array<1, elemT>::grow(const int min_index, const int max_index, bool initialise_with_0)
626-
{
627-
resize(min_index, max_index, initialise_with_0);
628-
}
629-
630623
template <class elemT>
631624
void
632625
Array<1, elemT>::grow(const int min_index, const int max_index)

0 commit comments

Comments
 (0)