Path: utzoo!utgpu!watmath!att!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!ginosko!uunet!mcvax!ukc!reading!minster!forsyth From: forsyth@minster.york.ac.uk Newsgroups: comp.lang.c++ Subject: optimising matrix operations; deferred evaluation Message-ID: <619261726.27438@minster.york.ac.uk> Date: 16 Aug 89 09:08:47 GMT Organization: Department of Computer Science, University of York, England Lines: 23 one approach that i have not seen suggested here is to have the overloaded operators build a tree describing the calculation & defer the evaluation until the value is required (eg, by assignment). the expression evaluator can see the context and avoid the deplorable copying of large objects. this might be appropriate when the cost of transforming and interpreting the expression is less than the cost of creating temporary values needlessly. i have not considered doing this for matrix operations (as such) but rather for bitmap/image manipulation operations, perhaps in the style of: %T A Language for Bitmap Manipulation %A L. J. Guibas %A J. Stolfi %J ACM Transactions on Graphics %V 1 %N 3 %D July 1982 %P 191-214 whether it saves time obviously depends on the size of a matrix. a hybrid scheme might be attractive.