[Insight-developers] Statistics class interface change

Brad Davis brad.davis at kitware.com
Tue Aug 15 16:09:37 EDT 2006


Bill,

All of the Insight tests compile and pass (cvs update yesterday,
linux2.6, gcc 4.0.4).  There is no coverage of the method in
InsightApplications.  I don't see any reason why this would cause a
compilation error.  Anyone else?

Brad

On 7/16/06,  Bill Lorensen < wlorens1 at nycap.rr.com> wrote:
> Brad,
>
> Will this cause any exiting code to stop compiling? I think not, but I want
> to be sure.
>
> Bill
>
> At 02:29 PM 7/14/2006, Brad Davis wrote:
> >All,
> >
> >In the class itk::Statistics::itkListSample I want to change the argument
> >to the PushBack method from pass-by-value to pass-by-reference.  That
> >is,  change
> >
> >void PushBack( MeasurementVectorType mv );
> >
> >to
> >
> >void PushBack( const MeasurementVectorType& mv );
> >
> >The reasons are:
> >
> >1)
> >When calling PushBack(MeasurementVectorType mv), two copies of mv are
> >made---one of them is unnecessary.  Because of call by value, a copy of
> >the measurement vector is placed on the stack.  A copy of this copy is
> >then made by the std::vector<MeasurementVectorType>::push_back() call.
> >
> >2)
> >The other methods for setting measurement vectors in this class, e.g.
> >,SetMeasurementVector(const InstanceIdentifier &id, const
> >MeasurementVectorType &mv) use call by reference, so the interface is
> >inconsistent.
> >
> >Any comments welcome.  As expected, all the tests under 'ctest -D
> >ExperimentalTest' passed after the change.
> >
> >Brad
> >
> >
> >_______________________________________________
> >Insight-developers mailing list
> >Insight-developers at itk.org
> >http://www.itk.org/mailman/listinfo/insight-developers
>
>


More information about the Insight-developers mailing list