[Insight-developers] about class Vector

Luis Ibanez ibanez@choroid.cs.unc.edu
Tue, 1 Jan 2002 15:12:13 -0500 (EST)


Hi,

The declaration of th itk::Vector class should work fine.

You're right, you should be able to assign values to
any component of the vector (this is inherited from
itk::Array).

One possibility is that you're using this with a type
(T) which is 'const', for example Vector<const char,3>
will prevent you from assigning values to the components.

Could you please post a more complete piece of code ?
or at least the complete error message that you get
along with the platform in which this is being tested ?

It looks like the problem should be comming from the 
surrounding code.

Thanks

Luis

==============================

On Tue, 1 Jan 2002, Xinwei Xue wrote:

> 
> Hi,
> 
> 
> I declared a vector using Vector<T, VectorDimension>  and when I do the
> following assignment, there was such error: "assignment of readonly
> location". I though we should be  able to assign value to single vector
> element, since it is a subclass of Array. Does anyone know the reason
> why the error occurs?
> 
> Vector<T,VectorDimension> vectorF; //declared as a class member
> 
> vectorF[0] = somevalue;  //assigned in a member function;
> 
> 
> Thanks,
> 
> Xinwei
> 
> _______________________________________________
> Insight-developers mailing list
> Insight-developers@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-developers
> 

-- 
Luis Ibanez                                      CB#:   7060
Research Assistan Professor                      phone: (919) 843 5436
Division of Neurosurgery                         fax:   (919) 966 6627
University of North Carolina at Chapel Hill      email: ibanez@cs.unc.edu
Chapel Hill, NC 27599-7060                       http://www.cs.unc.edu/~ibanez