Dragan,

I need to use Vector FullMatrix, BlockVector and BlockSparseMatrix with
different datatype than what is already provided and instantiated (float,
double...). I have the following problem when instantiating with a different
type: the linking fails due to the multiple definitions of the following
functions:
vector.cc:-1: error: multiple definition of
`dealii::Vector<std::complex<float> >::operator=(std::complex<float>)'
vector.cc:-1: error: multiple definition of `dealii::Vector<int>::lp_norm(int)
const'

These two functions are explicitly instantiated in vector.templates.h for
float and int types. But, if I instantiate Vector<myNumber> in my code these
two definitions will appear in both files (vector.cc and my source file) even
though I use a different type.

Correct. Do you *explicitly* instantiate these classes in your code? If you do, why? If they're already explicitly instantiated in the library, you do not need to add explicit instantiations in your own code.


Could you please let me know if there is a reason to instantiate them in the
header file rather than in the source vector.cc file?

?? Can you point out where it is instantiated in the .h file? I think the only file is in the .inst file, which is #included in the .cc file.

Best
 Wolfgang

--
------------------------------------------------------------------------
Wolfgang Bangerth          email:                 bange...@colostate.edu
                           www: http://www.math.colostate.edu/~bangerth/

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to