~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to routines/optim/nvkt03.f

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
      SUBROUTINE NVKT03(A,IA,C,IC,G,V,W,IPVT,DNORMA,N,M,MI1,MI,NMD,NDF)
 
2
C
 
3
C***********************************************************************
 
4
C                                                                      *
 
5
C                                                                      *
 
6
C     ORIGEN:           Eduardo Casas Renteria                         *
 
7
C                       Cecilia Pola Mendez                            *
 
8
C                                                                      *
 
9
C       Departamento de Matematicas,Estadistica y Computacion          *
 
10
C       -----------------------------------------------------          *
 
11
C                       UNIVERSIDAD DE CANTABRIA                       *
 
12
C                       ------------------------                       *
 
13
C                              AGOSTO  1987                            *
 
14
C                                                                      *
 
15
C***********************************************************************
 
16
C
 
17
C     OBJETIVO:
 
18
C        Esta es una subrutina auxiliar a  OPTR03. Calcula la norma del
 
19
C        vector de Kuhn-Tucker.
 
20
C
 
21
C     LISTA DE LLAMADA:
 
22
C
 
23
C        A      Matriz de dimension (IA,NDF-NMD). (Referencia en OPTR03)
 
24
C
 
25
C        C      Matriz  de  dimension   (IC,MI+NMD-N).  ( Referencia  en
 
26
C               OPTR03).
 
27
C
 
28
C        G      Vector de dimension  N que contiene el vector gradiente.
 
29
C
 
30
C        V      Vector  de  dimension  M  que contiene  el vector de los
 
31
C               multiplicadores de Lagrange.
 
32
C
 
33
C        W      Vector de trabajo de dimension  N+M.
 
34
C
 
35
C        IPVT   Vector de dimension  M. (Referencia en  OPTR03).
 
36
C
 
37
C        DNORMA Variable de salida que contiene la norma del vector de
 
38
C               Kuhn-Tucker.
 
39
C
 
40
C        MI1    (Referencia en OPTR03).
 
41
C
 
42
C        MI     (Referencia en  OPTR03).
 
43
C
 
44
C        NMD    N+MD (Referencia en OPTR03).
 
45
C
 
46
C        NDF    NMD+MIF+MDF+1 (Referencia en OPTR03).
 
47
C
 
48
C
 
49
C        Esta subrutina trabaja en doble precision via una sentencia
 
50
C     "implicit":
 
51
C                Implicit double precision (a-h,o-z)
 
52
C
 
53
C     SUBPROGRAMAS AUXILIARES:  ddot,dadd,dnrm2
 
54
C     FUNCIONES FORTRAN INTRINSECAS:  abs,mod,sqrt
 
55
C
 
56
      implicit double precision(a-h,o-z)
 
57
      dimension a(ia,*),c(ic,*),v(*),w(*),ipvt(*),g(*)
 
58
      m1=m+1
 
59
      mi2=mi1+1
 
60
      ni=mi-n
 
61
      do 30 i=1,n
 
62
         do 10 j=1,mi1
 
63
10       w(j)=c(i,ipvt(j))
 
64
         do 20 j=mi2,m
 
65
            ij=ipvt(j)
 
66
            if(ij.lt.0) then
 
67
               if(i.eq.-ij) then
 
68
                  w(j)=-1
 
69
               else
 
70
                  w(j)=0
 
71
               end if
 
72
            else if(ij.le.n) then
 
73
               if(i.eq.ij) then
 
74
                  w(j)=1
 
75
               else
 
76
                  w(j)=0
 
77
               end if
 
78
            else if(ij.le.nmd) then
 
79
               w(j)=c(i,ij+ni)
 
80
            else if(ij.lt.ndf) then
 
81
               w(j)=a(i,ij-nmd)
 
82
            end if
 
83
20       continue
 
84
         w(m+i)=ddot(m,w,1,v,1)
 
85
30    continue
 
86
      call dadd(n,g,1,w(m1),1)
 
87
      dnorma=dnrm2(n,w(m1),1)
 
88
      end