Hi all
I have the functions
friend CComplexMatrixT emp eye(const size_t nN);
and
friend CComplexMatrixT emp & chol(CComplexMa trixTemp &z);
I would like create expressions of the form CComplexMatrixT emp 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:
CComplexMatrixT emp temp = eye(80);
CComplexMatrixT emp 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 CComplexMatrixT emp 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 CComplexMatrixT emp eye(const size_t nN);
and
friend CComplexMatrixT emp & chol(CComplexMa trixTemp &z);
I would like create expressions of the form CComplexMatrixT emp 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:
CComplexMatrixT emp temp = eye(80);
CComplexMatrixT emp 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 CComplexMatrixT emp 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
Comment