[Insight-developers] itkMatrix: Algorithms Call: 02/16/01

William A. Hoffman bill.hoffman@kitware.com
Sun, 18 Feb 2001 12:51:27 -0500


There should not be that much cost in the conversion to the vnl vectors.
This is what I feared in creating our own itkVector and itkMatrix, we
would re-implement much of the code.

The conversion should be no more expensive than a function call.
The vnl_fixed matrix and vector can re-use the memory of the itkVector and
itkMatrix.   The only difference is that there would be a pointer to the data,
and a size variable.   Think of it as a function call:

for example:

multiply_vectors(const float* data1, int size1, const float* data2, int size2);

same as:

itkVector v1, v2;
convert_tovnl_vector(v) * convert_tovnl_vector(v);

There should be some convenient way of converting from itkVector to 
vnl_vector_fixed.

No dynamic memory is allocated in the conversion, just the initialization of
the pointer and the size variable.  With a smart compiler, this could all be
done with registers.

-Bill


At 09:40 PM 2/16/01 -0500, Stephen R. Aylward wrote:

>The idea is to provide itk users with a consistent-looking interface and
>to increase the speed of common vector-matrix ops in itk.
>
>So, since we have itkVector, we should have itkMatrix for a more
>consistent API.
>
>Also, because of the cost associated with converting an itkVector to a
>vnlVector (a constructor is called and memory is allocated), we should
>provide a few FUNCTIONS for the most common vector and matrix math that
>uses the itkVector and itkMatrix classes directly.
>
>--
>===============================================
>Stephen R. Aylward
>Assistant Professor of Radiology
>Adjunct Assistant Professor of Computer Science
>http://www.cs.unc.edu/~aylward
>aylward@unc.edu
>(919) 966-9695
>
>
>
>_______________________________________________
>Insight-developers mailing list
>Insight-developers@public.kitware.com
>http://public.kitware.com/mailman/listinfo/insight-developers