~ubuntu-branches/ubuntu/wily/eso-midas/wily-proposed

« back to all changes in this revision

Viewing changes to applic/fit/libsrc/mnmx.for

  • Committer: Package Import Robot
  • Author(s): Ole Streicher
  • Date: 2014-04-22 14:44:58 UTC
  • Revision ID: package-import@ubuntu.com-20140422144458-okiwi1assxkkiz39
Tags: upstream-13.09pl1.2+dfsg
ImportĀ upstreamĀ versionĀ 13.09pl1.2+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
C @(#)mnmx.for  19.1 (ES0-DMD) 02/25/03 13:17:42
 
2
C===========================================================================
 
3
C Copyright (C) 1995 European Southern Observatory (ESO)
 
4
C
 
5
C This program is free software; you can redistribute it and/or 
 
6
C modify it under the terms of the GNU General Public License as 
 
7
C published by the Free Software Foundation; either version 2 of 
 
8
C the License, or (at your option) any later version.
 
9
C
 
10
C This program is distributed in the hope that it will be useful,
 
11
C but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
C GNU General Public License for more details.
 
14
C
 
15
C You should have received a copy of the GNU General Public 
 
16
C License along with this program; if not, write to the Free 
 
17
C Software Foundation, Inc., 675 Massachusetss Ave, Cambridge, 
 
18
C MA 02139, USA.
 
19
C
 
20
C Corresponding concerning ESO-MIDAS should be addressed as follows:
 
21
C       Internet e-mail: midas@eso.org
 
22
C       Postal address: European Southern Observatory
 
23
C                       Data Management Division 
 
24
C                       Karl-Schwarzschild-Strasse 2
 
25
C                       D 85748 Garching bei Muenchen 
 
26
C                       GERMANY
 
27
C===========================================================================
 
28
C
 
29
      SUBROUTINE MNMX(VECTOR,DIM,MINI,IMIN,MAXI,IMAX)                           
 
30
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++        
 
31
C                                                                               
 
32
C.MODULE                                                                        
 
33
C       FIT                                                                     
 
34
C                                                                               
 
35
C.NAME                                                                          
 
36
C       MNMX                                                                    
 
37
C                                                                               
 
38
C.PURPOSE                                                                       
 
39
C       Computes the minimum and maximum of a vector                            
 
40
C                                                                               
 
41
C.KEYWORDS                                                                      
 
42
C       Linear algebra.                                                         
 
43
C                                                                               
 
44
C.DESCRIPTION                                                                   
 
45
C       trivial                                                                 
 
46
C                                                                               
 
47
C.RESTRICTIONS                                                                  
 
48
C       ...                                                                     
 
49
C                                                                               
 
50
C.LANGUAGE                                                                      
 
51
C       FORTRAN                                                                 
 
52
C                                                                               
 
53
C.CALLING SEQUENCE                                                              
 
54
C       CALL MNMX (VECTOR,DIM,MINI,IMIN,MAXI,IMAX)                              
 
55
C                                                                               
 
56
C.INPUT PARAMETERS                                                              
 
57
C       VECTOR    (DIM)               DOUBLE  Input vector                      
 
58
C       DIM                           INTEGER Dimension of the vector           
 
59
C                                                                               
 
60
C.MODIFIED PARAMETERS                                                           
 
61
C       none                                                                    
 
62
C                                                                               
 
63
C.OUTPUT PARAMETERS                                                             
 
64
C       MINI                          DOUBLE  Minimum                           
 
65
C       IMIN                          INTEGER Index of minimum                  
 
66
C       MAXI                          DOUBLE  Maximum                           
 
67
C       IMAX                          INTEGER Index of maximum                  
 
68
C                                                                               
 
69
C.FILES                                                                         
 
70
C       none                                                                    
 
71
C                                                                               
 
72
C.MODULES CALLED                                                                
 
73
C       none                                                                    
 
74
C                                                                               
 
75
C.AUTHOR                                                                        
 
76
C       Ph. DEFERT,      Feb 1986                                               
 
77
C                                                                               
 
78
C.MODIFICATIONS                                                                 
 
79
C                                                                               
 
80
C                                                                               
 
81
C-----------------------------------------------------------------------        
 
82
C      IMPLICIT NONE                                                            
 
83
C     ..                                                                        
 
84
C     .. Scalar Arguments ..                                                    
 
85
      INTEGER DIM,IMIN,IMAX                                                     
 
86
      DOUBLE PRECISION MINI,MAXI                                                
 
87
C     ..                                                                        
 
88
C     .. Array Arguments ..                                                     
 
89
      DOUBLE PRECISION VECTOR(DIM)                                              
 
90
C     ..                                                                        
 
91
C     .. Local Scalars ..                                                       
 
92
      INTEGER I                                                                 
 
93
                                                                                
 
94
      DO 10 I = 1,DIM                                                           
 
95
          IF (VECTOR(I).LT.MINI) THEN                                           
 
96
              MINI   = VECTOR(I)                                                
 
97
              IMIN   = I                                                        
 
98
          END IF                                                                
 
99
                                                                                
 
100
          IF (VECTOR(I).GT.MAXI) THEN                                           
 
101
              MAXI   = VECTOR(I)                                                
 
102
              IMAX   = I                                                        
 
103
          END IF                                                                
 
104
                                                                                
 
105
   10 CONTINUE                                                                  
 
106
      RETURN                                                                    
 
107
                                                                                
 
108
      END