Hi all
I'm trying to create compositors (as described in TCPPPL 3rd edition 22.4.7)
for expressing the matrix multiplication function:
mat_mult( a, b, result );
As this:
result = a * b;
I have defined the compositor structure like this:
================================================== =========================
In "matrix.hpp"which contains:
template <typename T> class Mat { ....
--------------------------------------------------------------
struct MMmul;
Mat( const MMmul& mm ) { mat_mult( this, &m.m1, &m.m2 ); }
Mat& operator=( const MMmul& mm ) {
mat_mult( this, &m.m1, &m.m2 );
return *this;
}
In "la_operations.hpp" which includes "matrix.hpp"
--------------------------------------------------
struct MMmul {
Mat<double> const & m1;
Mat<double> const & m2;
MMmul( const Mat<double>& mm1, const Mat<double>& mm2 ) : m1(mm1), m2(mm2)
{}
operator Mat<double>();
};
inline
MMmul operator* ( const Mat<double> & m1, const Mat<double> & m2 ) {
return MMmul( m1, m2 );
}
================================================== =========================
It all compiles OK when used with some Mat<double> objects, but fails the
link with this:
ld: Undefined symbols:
MMmul::operator Mat<double>()
Any thoughts gratefully received - please also cc to my email.
TIA
Michael
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
_/ _/ _/_/_/ Hopkins Research Ltd
_/ _/ _/ _/
_/_/_/_/ _/_/_/
http://www.hopkins-research.com/
_/ _/ _/ _/
_/ _/ _/ _/ 'touch the future'
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
[ See
http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]