[Community] [Insight-users] explicitly instantiate vnl_sparse_matrix

Matt McCormick matt.mccormick at kitware.com
Tue Oct 15 10:20:00 EDT 2013


Hi Wei,

It may need a "tickle".

For example,


$ cat Modules/ThirdParty/VNL/src/vxl/core/vnl/Templates/vnl_sparse_matrix+int-.cxx

#include <vnl/vnl_sparse_matrix.txx>

template class vnl_sparse_matrix<int>;

static int vnl_sparse_matrix_float_tickler()
{
  vnl_sparse_matrix<int> md(3, 5);
  vnl_sparse_matrix_float_tickler(); // to avoid compiler warning
  return md(0,0);
}


HTH,
Matt

On Tue, Oct 15, 2013 at 4:56 AM, Wei Liu <weiliu620 at gmail.com> wrote:
> Dear ITK users,
>
> Is there a method to explicitly instantiate vnl_sparse_matrix<bool>?
> I'm trying to define: vnl_sparse_matrix<bool> mymatrix, but get  error
>
> undefined reference to `vnl_sparse_matrix<bool>::vnl_sparse_matrix()'
>
> I tried to add
>
> template class vnl_sparse_matrix<bool>;
>
> on the top of my main.cxx but it doesn't work. I appreciate any insights.
>
> Wei
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/cgi-bin/mailman/listinfo/community
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users



More information about the Community mailing list