~o=39 ~?i&32768 ~o=24 ~$>end_of_copyright ~/!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ~/Copyright (C) Isabelle Constantin, INRO Consultants Inc., 1995. ~/ ~/The right to use this macro is granted to all EMME/2 users, provided the ~/following conditions are met: ~/ 1) The macro cannot be sold for a fee (but it can be used and ~/ distributed without charge within consulting projects). ~/ 2) The user is aware that this macro is not a part of the EMME/2 ~/ software licence, and that there is no explicit or implied ~/ warranty or support provided with this macro. ~/ 3) The comments in this macro must not be removed. ~/ 4) Any addition or modification must be identified as such, and give ~/ at least date, name and the reason of the modification. ~/!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ~:end_of_copyright ~/********** AGGDEST - 1.4 (I. Constantin, INRO Consultants Inc.) ********** ~/ ~/AGGDEST - a macro to aggregate a matrix over destinations ~/ ~/This macro aggregates a matrix over destinations, according to the ~/ensemble and operator specified. In the resulting matrix, for each origin, ~/all the cells corresponding to destinations within the same group will ~/contain the aggregated value for that group. ~/ ~/Usage: ~ ~/ ~/where: Gpq matrix to aggregate (input) ~/ Rpq aggregated matrix, must not be Gpq (output) ~/ gx ensemble to use for aggregation ~/ oper operator to use for aggregation (default is +) ~/ ~/Notes: - This macro must be started at the main menu level ~/ - It needs Release 7.0 or later of the EMME/2 system ~/ - Reports are appended to the file aggdest.rep ~/************************************************************************** ~x=%m% / test if started from main menu ~x+%q% ~?x>0 ~$>end_of_macro ~t0=%t0% + ~x=%0% / test if enough parameters are provided ~?x<4 ~$>end_of_macro ~p=2005 ~t1=%p% ~/ ~/Macro AGGDEST was called with the following parameters: ~/ Gpq matrix to aggregate %1% ~/ Rpq aggregated matrix %2% ~/ gx ensemble to use for aggregation %3% ~/ oper operator to use for aggregation %4% ~/ ~/Computations: reports=aggdest.rep ~/..... creating the required temporary matrix (in module 3.21) 3.21 1 / create temporary matrix to identify dest. in same group of %3% y / save result ~+|%2%|y|tmp%3%|one for dest. in same group of %3%|~?q=1|y|0 %3%(p)==%3%(q) / no constraint n / no submatrix 2 / send report to printer q ~/..... performing the aggregation (in module 3.23, progress is shown below) 3.23 1 / matrix convolution %2% / operand matrix 1 * / combination operator %1% / operand matrix 2 y / transposed %4% / contraction operator (specified by user, default is +) %2% / result matrix ~+|y|agdest|%1% aggregated over dest. using %3%|n ~?q=0 / no argmin or argmax matrix (if applicable) n / no submatrix ~o-1 / no constraint ~o+1 ~+|y|2|q|~/yes (report appended to file aggdest.rep)|~/ ~/..... transposing the resulting matrix (in module 3.12) 3.12 4 / matrix copy 3 / transpose %2% / copy from %2% / copy to n / no submatrix q reports=^ ~+|~p=2005|~y=%%%p%%%|~y-%t1%|~y/10 ~/ ~/Macro AGGDEST terminated normally, after %y% CPU seconds. ~/========================================================================== ~:end_of_macro ~o=6