From: Paul Smyth <paul.smyth@vi...>  20030225 19:52:28

Hi, We now have matrix_fixed and vector_fixed which are spaceefficient (thanks to Amitha), together with operators, or conversion functions to make a vnl_matrix or vnl_vector. I had written an number of functions which perform operations on fixed size vectors and matrices, and which took vector_fixed_ref and matrix_fixed_refs as arguments. (As vector_fixed was derived from vector_fixed_ref, these functions could operate on vector_fixed also). Now that the two fixedsize classes have been taken out of the heirarchy, it is now difficult/impossible to use a vector_fixed as a vector_fixed ref. e.g. T my_dot_product(const vnl_vector_fixed_ref<T,n> & a ,const vnl_vector_fixed_ref<T,n> & b) void f() { vnl_vector_fixed<double,3> a,b; double d = my_dot_product(a,b); } now doesn't compile. My questions are: 0) Did anyone else ever use the fixedref classes? 1) Am I being reasonable wanting this behaviour? 2) What can I do to get this behaviour again? 3) I'd like to make these fixedref classes standalone/lightweight, and no longer derived from vnl_vector_ref etc. for speed/inlining & simplicity. Is that mad? N.B. They are currently derived from vnl_vector_ref<T>, vnl_matrix_ref<T> The problem is pretty much the same for vnl_matrix_fixed_ref and vnl_vector_fixed_ref, so let's consider vnl_vector_fixed_ref. I've tried adding "operator vnl_vector_fixed_ref<T,n>()" to vnl_vector_fixed to do automatic casts. These don't seem to work, at least under MSCV6. Obviously, one could make vnl_vector_fixed_ref a base class to vnl_vector_fixed, at the cost of adding sizeof(T*) to the size of vnl_vector_fixed. I presume this is not desirable, given the amout of trouble that was gone to in order to minimise sizeof(vnl_vector_fixed). Other issues: Lots of built in algorithms in vnl_matrix_fixed.h that currently operate on vnl_matrix_fixed or vnl_vector_fixed might operate on fixed size reference types instead. Do people care about this at all? Any advice gratefully received. Paul. This email, and any attachment, is confidential. If you have received it in error, please delete it from your system, do not use or disclose the information in any way, and notify me immediately. 