- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
REAL::X(100,5) INTEGER::IS,K IS=merge(MINLOC(X(:,K)),MAXLOC(X(:,-K)),K>0) ! its equivalent is IF(K>0)THEN IS=MINLOC(X(:,K)) ELSEIF(K<0)THEN IS=MAXLOC(X(:,-K)) END IF
! but it seems the later has better efficiency.
- Marcas:
- Intel® Fortran Compiler
Link copiado
1 Responder
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Did you mean to set a DIM argument for minloc and maxloc? Until the code does what you intend, talking about efficiency seems pointless.
The strength of MERGE is not for cases as complicated as array operations. Performance would depend on the expansion of minloc and maxloc and whether the compiler is able to optimize without making temporary arrays. The size you quote is marginal on whether vectorization would be useful, and that depends (with recent released ifort) on whether you have set the old_maxminloc. What do your optreports say?

Responder
Opções do tópico
- Subscrever fonte RSS
- Marcar tópico como novo
- Marcar tópico como lido
- Flutuar este Tópico para o utilizador atual
- Marcador
- Subscrever
- Página amigável para impressora