Complexity nomenclature

Ola Fosheim Grøstad via Digitalmars-d digitalmars-d at puremagic.com
Fri Dec 4 00:32:52 PST 2015


On Friday, 4 December 2015 at 06:05:55 UTC, Tofu Ninja wrote:
> Also maybe a simpler idea would just be to annotate the the 
> operations with there complexity with UDAs. That way things 
> that really care about the complexity can get it, and those who 
> don't can ignore it. It has the benefit of being self 
> documenting as well.

Yes, but can you export it reliably in generically composed 
functions?

Say you have a loop of N iterations calling a function that 
involves M operations, you want to export N*M, but then the 
caller needs to know what N and M are referring to, so you need 
some standard way of getting there. (e.g. N could be number of 
edges and M could be number of nodes or something).



More information about the Digitalmars-d mailing list