R
Ryan Mitchley
Hi all
I have the functions
friend CComplexMatrixTemp eye(const size_t nN);
and
friend CComplexMatrixTemp & chol(CComplexMatrixTemp &z);
I would like create expressions of the form CComplexMatrixTemp x =
chol(eye(6)), similar to MATLAB syntax.
GCC doesn't seem like the fact that chol(...) wants to take a reference to a
returned temporary. Is there anyway around this without losing the nice
notation? I could obviously do something like:
CComplexMatrixTemp temp = eye(80);
CComplexMatrixTemp x = chol(temp);
but this is definitely not as pretty!
Copying a matrix object is an expensive operation, hence the desire to use
references. The CComplexMatrixTemp class is formed in intermediate
expressions where storage space may be reused (I also have a CComplexMatrix
class which is used directly by the application programmer).
Thanks for any help!
Ryan
I have the functions
friend CComplexMatrixTemp eye(const size_t nN);
and
friend CComplexMatrixTemp & chol(CComplexMatrixTemp &z);
I would like create expressions of the form CComplexMatrixTemp x =
chol(eye(6)), similar to MATLAB syntax.
GCC doesn't seem like the fact that chol(...) wants to take a reference to a
returned temporary. Is there anyway around this without losing the nice
notation? I could obviously do something like:
CComplexMatrixTemp temp = eye(80);
CComplexMatrixTemp x = chol(temp);
but this is definitely not as pretty!
Copying a matrix object is an expensive operation, hence the desire to use
references. The CComplexMatrixTemp class is formed in intermediate
expressions where storage space may be reused (I also have a CComplexMatrix
class which is used directly by the application programmer).
Thanks for any help!
Ryan