[BACK]Return to correctors.ads CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / PHC / Ada / Continuation

Annotation of OpenXM_contrib/PHC/Ada/Continuation/correctors.ads, Revision 1.1

1.1     ! maekawa     1: with text_io;                            use text_io;
        !             2: with Standard_Floating_Numbers;          use Standard_Floating_Numbers;
        !             3: with Standard_Complex_Numbers;           use Standard_Complex_Numbers;
        !             4: with Standard_Complex_Vectors;           use Standard_Complex_Vectors;
        !             5: with Standard_Complex_Matrices;          use Standard_Complex_Matrices;
        !             6: with Standard_Complex_Solutions;         use Standard_Complex_Solutions;
        !             7: with Continuation_Data;                  use Continuation_Data;
        !             8:
        !             9: package Correctors is
        !            10:
        !            11: -- DESCRIPTION :
        !            12: --   This package contains implementations for the corrector
        !            13: --   in an increment-and-fix continuation.
        !            14: --
        !            15: --   The following options can be made :
        !            16: --    (Affine,Projective)
        !            17: --       An affine corrector works in affine space, while a projective
        !            18: --       corrector is a projective-perpendicular corrector: it works in
        !            19: --       projective space and corrects in a perpendicular way.
        !            20: --    (Single,Multiple)
        !            21: --       A single corrector only deals with one path at a time.
        !            22: --       A multiple corrector corrects more than one path when it is called.
        !            23: --    (Loose,Severe)
        !            24: --       A loose corrector will stop when either one of the following
        !            25: --       conditions is satisfied:
        !            26: --         1. One of the desired accuracies has been met.
        !            27: --         2. The maximum number of iterations is reached.
        !            28: --         3. The Jacobian matrix is singular.
        !            29: --       In addition to these stopping criteria, a severe corrector checks
        !            30: --       the convergence during the iterations and stops when it notices
        !            31: --       divergence is noticed.  A loose correctors allows divergence.
        !            32: --    (Normal,Conditioned)
        !            33: --       A normal corrector does not compute an estimate for the inverse of
        !            34: --       the condition number of the Jacobian matrix.  This additional work
        !            35: --       is done by a conditioned corrector.
        !            36: --    (Silent,Reporting)
        !            37: --       A silent corrector does not produce any output on file.
        !            38: --       A reporting corrector allows to put intermediate results on file.
        !            39: --
        !            40: --   Based on these options, the following 32 different correctors
        !            41: --   are provided :
        !            42: --
        !            43: --     Affine_Single_Loose_Normal_Silent_Corrector
        !            44: --     Affine_Single_Loose_Normal_Reporting_Corrector
        !            45: --     Affine_Single_Loose_Conditioned_Silent_Corrector
        !            46: --     Affine_Single_Loose_Conditioned_Reporting_Corrector
        !            47: --     Affine_Single_Severe_Normal_Silent_Corrector
        !            48: --     Affine_Single_Severe_Normal_Reporting_Corrector
        !            49: --     Affine_Single_Severe_Conditioned_Silent_Corrector
        !            50: --     Affine_Single_Severe_Conditioned_Reporting_Corrector
        !            51: --     Affine_Multiple_Loose_Normal_Silent_Corrector
        !            52: --     Affine_Multiple_Loose_Normal_Reporting_Corrector
        !            53: --     Affine_Multiple_Loose_Conditioned_Silent_Corrector
        !            54: --     Affine_Multiple_Loose_Conditioned_Reporting_Corrector
        !            55: --     Affine_Multiple_Severe_Normal_Silent_Corrector
        !            56: --     Affine_Multiple_Severe_Normal_Reporting_Corrector
        !            57: --     Affine_Multiple_Severe_Conditioned_Silent_Corrector
        !            58: --     Affine_Multiple_Severe_Conditioned_Reporting_Corrector
        !            59: --     Projective_Single_Loose_Normal_Silent_Corrector
        !            60: --     Projective_Single_Loose_Normal_Reporting_Corrector
        !            61: --     Projective_Single_Loose_Conditioned_Silent_Corrector
        !            62: --     Projective_Single_Loose_Conditioned_Reporting_Corrector
        !            63: --     Projective_Single_Severe_Normal_Silent_Corrector
        !            64: --     Projective_Single_Severe_Normal_Reporting_Corrector
        !            65: --     Projective_Single_Severe_Conditioned_Silent_Corrector
        !            66: --     Projective_Single_Severe_Conditioned_Reporting_Corrector
        !            67: --     Projective_Multiple_Loose_Normal_Silent_Corrector
        !            68: --     Projective_Multiple_Loose_Normal_Reporting_Corrector
        !            69: --     Projective_Multiple_Loose_Conditioned_Silent_Corrector
        !            70: --     Projective_Multiple_Loose_Conditioned_Reporting_Corrector
        !            71: --     Projective_Multiple_Severe_Normal_Silent_Corrector
        !            72: --     Projective_Multiple_Severe_Normal_Reporting_Corrector
        !            73: --     Projective_Multiple_Severe_Conditioned_Silent_Corrector
        !            74: --     Projective_Multiple_Severe_Conditioned_Reporting_Corrector
        !            75: --
        !            76: --   All these procedures have the following generic parameters:
        !            77: --     a norm function, polynomial vector and Jacobian matrix function.
        !            78: --   Note that the projective correctors require a homogeneous polynomial
        !            79: --   vector function.
        !            80:
        !            81:   generic
        !            82:     with function Norm ( x : Vector ) return double_float;
        !            83:     with function H  ( x : Vector; t : Complex_Number ) return Vector;
        !            84:     with function dH ( x : Vector; t : Complex_Number ) return Matrix;
        !            85:   procedure Affine_Single_Loose_Normal_Silent_Corrector
        !            86:               ( s : in out Solu_Info; c : in Corr_Pars );
        !            87:
        !            88:   generic
        !            89:     with function Norm ( x : Vector ) return double_float;
        !            90:     with function H  ( x : Vector; t : Complex_Number ) return Vector;
        !            91:     with function dH ( x : Vector; t : Complex_Number ) return Matrix;
        !            92:   procedure Affine_Single_Loose_Normal_Reporting_Corrector
        !            93:               ( file : in file_type; s : in out Solu_Info; c : in Corr_Pars );
        !            94:
        !            95:   generic
        !            96:     with function Norm ( x : Vector ) return double_float;
        !            97:     with function H  ( x : Vector; t : Complex_Number ) return Vector;
        !            98:     with function dH ( x : Vector; t : Complex_Number ) return Matrix;
        !            99:   procedure Affine_Single_Loose_Conditioned_Silent_Corrector
        !           100:               ( s : in out Solu_Info; c : in Corr_Pars );
        !           101:
        !           102:   generic
        !           103:     with function Norm ( x : Vector ) return double_float;
        !           104:     with function H  ( x : Vector; t : Complex_Number ) return Vector;
        !           105:     with function dH ( x : Vector; t : Complex_Number ) return Matrix;
        !           106:   procedure Affine_Single_Loose_Conditioned_Reporting_Corrector
        !           107:               ( file : in file_type; s : in out Solu_Info; c : in Corr_Pars );
        !           108:
        !           109:   generic
        !           110:     with function Norm ( x : Vector ) return double_float;
        !           111:     with function H  ( x : Vector; t : Complex_Number ) return Vector;
        !           112:     with function dH ( x : Vector; t : Complex_Number ) return Matrix;
        !           113:   procedure Affine_Single_Severe_Normal_Silent_Corrector
        !           114:               ( s : in out Solu_Info; c : in Corr_Pars );
        !           115:
        !           116:   generic
        !           117:     with function Norm ( x : Vector ) return double_float;
        !           118:     with function H  ( x : Vector; t : Complex_Number ) return Vector;
        !           119:     with function dH ( x : Vector; t : Complex_Number ) return Matrix;
        !           120:   procedure Affine_Single_Severe_Normal_Reporting_Corrector
        !           121:               ( file : in file_type; s : in out Solu_Info; c : in Corr_Pars );
        !           122:
        !           123:   generic
        !           124:     with function Norm ( x : Vector ) return double_float;
        !           125:     with function H  ( x : Vector; t : Complex_Number ) return Vector;
        !           126:     with function dH ( x : Vector; t : Complex_Number ) return Matrix;
        !           127:   procedure Affine_Single_Severe_Conditioned_Silent_Corrector
        !           128:               ( s : in out Solu_Info; c : in Corr_Pars );
        !           129:
        !           130:   generic
        !           131:     with function Norm ( x : Vector ) return double_float;
        !           132:     with function H  ( x : Vector; t : Complex_Number ) return Vector;
        !           133:     with function dH ( x : Vector; t : Complex_Number ) return Matrix;
        !           134:   procedure Affine_Single_Severe_Conditioned_Reporting_Corrector
        !           135:               ( file : in file_type; s : in out Solu_Info; c : in Corr_Pars );
        !           136:
        !           137:   generic
        !           138:     with function Norm ( x : Vector ) return double_float;
        !           139:     with function H  ( x : Vector; t : Complex_Number ) return Vector;
        !           140:     with function dH ( x : Vector; t : Complex_Number ) return Matrix;
        !           141:   procedure Affine_Multiple_Loose_Normal_Silent_Corrector
        !           142:               ( s : in out Solu_Info_Array;
        !           143:                 pivot : in out natural; dist_sols : in double_float;
        !           144:                 c : in Corr_Pars; fail : out boolean );
        !           145:
        !           146:   generic
        !           147:     with function Norm ( x : Vector ) return double_float;
        !           148:     with function H  ( x : Vector; t : Complex_Number ) return Vector;
        !           149:     with function dH ( x : Vector; t : Complex_Number ) return Matrix;
        !           150:   procedure Affine_Multiple_Loose_Normal_Reporting_Corrector
        !           151:               ( file : in file_type; s : in out Solu_Info_Array;
        !           152:                 pivot : in out natural; dist_sols : in double_float;
        !           153:                 c : in Corr_Pars; fail : out boolean );
        !           154:
        !           155:   generic
        !           156:     with function Norm ( x : Vector ) return double_float;
        !           157:     with function H  ( x : Vector; t : Complex_Number ) return Vector;
        !           158:     with function dH ( x : Vector; t : Complex_Number ) return Matrix;
        !           159:   procedure Affine_Multiple_Loose_Conditioned_Silent_Corrector
        !           160:               ( s : in out Solu_Info_Array;
        !           161:                 pivot : in out natural; dist_sols : in double_float;
        !           162:                 c : in Corr_Pars; fail : out boolean );
        !           163:
        !           164:   generic
        !           165:     with function Norm ( x : Vector ) return double_float;
        !           166:     with function H  ( x : Vector; t : Complex_Number ) return Vector;
        !           167:     with function dH ( x : Vector; t : Complex_Number ) return Matrix;
        !           168:   procedure Affine_Multiple_Loose_Conditioned_Reporting_Corrector
        !           169:               ( file : in file_type; s : in out Solu_Info_Array;
        !           170:                 pivot : in out natural; dist_sols : in double_float;
        !           171:                 c : in Corr_Pars; fail : out boolean );
        !           172:
        !           173:   generic
        !           174:     with function Norm ( x : Vector ) return double_float;
        !           175:     with function H  ( x : Vector; t : Complex_Number ) return Vector;
        !           176:     with function dH ( x : Vector; t : Complex_Number ) return Matrix;
        !           177:   procedure Affine_Multiple_Severe_Normal_Silent_Corrector
        !           178:               ( s : in out Solu_Info_Array;
        !           179:                 pivot : in out natural; dist_sols : in double_float;
        !           180:                 c : in Corr_Pars; fail : out boolean );
        !           181:
        !           182:   generic
        !           183:     with function Norm ( x : Vector ) return double_float;
        !           184:     with function H  ( x : Vector; t : Complex_Number ) return Vector;
        !           185:     with function dH ( x : Vector; t : Complex_Number ) return Matrix;
        !           186:   procedure Affine_Multiple_Severe_Normal_Reporting_Corrector
        !           187:               ( file : in file_type; s : in out Solu_Info_Array;
        !           188:                 pivot : in out natural; dist_sols : in double_float;
        !           189:                 c : in Corr_Pars; fail : out boolean );
        !           190:
        !           191:   generic
        !           192:     with function Norm ( x : Vector ) return double_float;
        !           193:     with function H  ( x : Vector; t : Complex_Number ) return Vector;
        !           194:     with function dH ( x : Vector; t : Complex_Number ) return Matrix;
        !           195:   procedure Affine_Multiple_Severe_Conditioned_Silent_Corrector
        !           196:               ( s : in out Solu_Info_Array;
        !           197:                 pivot : in out natural; dist_sols : in double_float;
        !           198:                 c : in Corr_Pars; fail : out boolean );
        !           199:
        !           200:   generic
        !           201:     with function Norm ( x : Vector ) return double_float;
        !           202:     with function H  ( x : Vector; t : Complex_Number ) return Vector;
        !           203:     with function dH ( x : Vector; t : Complex_Number ) return Matrix;
        !           204:   procedure Affine_Multiple_Severe_Conditioned_Reporting_Corrector
        !           205:               ( file : in file_type; s : in out Solu_Info_Array;
        !           206:                 pivot : in out natural; dist_sols : in double_float;
        !           207:                 c : in Corr_Pars; fail : out boolean );
        !           208:
        !           209:   generic
        !           210:     with function Norm ( x : Vector ) return double_float;
        !           211:     with function H  ( x : Vector; t : Complex_Number ) return Vector;
        !           212:     with function dH ( x : Vector; t : Complex_Number ) return Matrix;
        !           213:   procedure Projective_Single_Loose_Normal_Silent_Corrector
        !           214:               ( s : in out Solu_Info; c : in Corr_Pars );
        !           215:
        !           216:   generic
        !           217:     with function Norm ( x : Vector ) return double_float;
        !           218:     with function H  ( x : Vector; t : Complex_Number ) return Vector;
        !           219:     with function dH ( x : Vector; t : Complex_Number ) return Matrix;
        !           220:   procedure Projective_Single_Loose_Normal_Reporting_Corrector
        !           221:               ( file : in file_type; s : in out Solu_Info; c : in Corr_Pars );
        !           222:
        !           223:   generic
        !           224:     with function Norm ( x : Vector ) return double_float;
        !           225:     with function H  ( x : Vector; t : Complex_Number ) return Vector;
        !           226:     with function dH ( x : Vector; t : Complex_Number ) return Matrix;
        !           227:   procedure Projective_Single_Loose_Conditioned_Silent_Corrector
        !           228:               ( s : in out Solu_Info; c : in Corr_Pars );
        !           229:
        !           230:   generic
        !           231:     with function Norm ( x : Vector ) return double_float;
        !           232:     with function H  ( x : Vector; t : Complex_Number ) return Vector;
        !           233:     with function dH ( x : Vector; t : Complex_Number ) return Matrix;
        !           234:   procedure Projective_Single_Loose_Conditioned_Reporting_Corrector
        !           235:               ( file : in file_type; s : in out Solu_Info; c : in Corr_Pars );
        !           236:
        !           237:   generic
        !           238:     with function Norm ( x : Vector ) return double_float;
        !           239:     with function H  ( x : Vector; t : Complex_Number ) return Vector;
        !           240:     with function dH ( x : Vector; t : Complex_Number ) return Matrix;
        !           241:   procedure Projective_Single_Severe_Normal_Silent_Corrector
        !           242:               ( s : in out Solu_Info; c : in Corr_Pars );
        !           243:
        !           244:   generic
        !           245:     with function Norm ( x : Vector ) return double_float;
        !           246:     with function H  ( x : Vector; t : Complex_Number ) return Vector;
        !           247:     with function dH ( x : Vector; t : Complex_Number ) return Matrix;
        !           248:   procedure Projective_Single_Severe_Normal_Reporting_Corrector
        !           249:               ( file : in file_type; s : in out Solu_Info; c : in Corr_Pars );
        !           250:
        !           251:   generic
        !           252:     with function Norm ( x : Vector ) return double_float;
        !           253:     with function H  ( x : Vector; t : Complex_Number ) return Vector;
        !           254:     with function dH ( x : Vector; t : Complex_Number ) return Matrix;
        !           255:   procedure Projective_Single_Severe_Conditioned_Silent_Corrector
        !           256:               ( s : in out Solu_Info; c : in Corr_Pars );
        !           257:
        !           258:   generic
        !           259:     with function Norm ( x : Vector ) return double_float;
        !           260:     with function H  ( x : Vector; t : Complex_Number ) return Vector;
        !           261:     with function dH ( x : Vector; t : Complex_Number ) return Matrix;
        !           262:   procedure Projective_Single_Severe_Conditioned_Reporting_Corrector
        !           263:               ( file : in file_type; s : in out Solu_Info; c : in Corr_Pars );
        !           264:
        !           265:   generic
        !           266:     with function Norm ( x : Vector ) return double_float;
        !           267:     with function H  ( x : Vector; t : Complex_Number ) return Vector;
        !           268:     with function dH ( x : Vector; t : Complex_Number ) return Matrix;
        !           269:   procedure Projective_Multiple_Loose_Normal_Silent_Corrector
        !           270:               ( s : in out Solu_Info_Array;
        !           271:                 pivot : in out natural; dist_sols : in double_float;
        !           272:                 c : in Corr_Pars; fail : out boolean );
        !           273:
        !           274:   generic
        !           275:     with function Norm ( x : Vector ) return double_float;
        !           276:     with function H  ( x : Vector; t : Complex_Number ) return Vector;
        !           277:     with function dH ( x : Vector; t : Complex_Number ) return Matrix;
        !           278:   procedure Projective_Multiple_Loose_Normal_Reporting_Corrector
        !           279:               ( file : in file_type; s : in out Solu_Info_Array;
        !           280:                 pivot : in out natural; dist_sols : in double_float;
        !           281:                 c : in Corr_Pars; fail : out boolean );
        !           282:
        !           283:   generic
        !           284:     with function Norm ( x : Vector ) return double_float;
        !           285:     with function H  ( x : Vector; t : Complex_Number ) return Vector;
        !           286:     with function dH ( x : Vector; t : Complex_Number ) return Matrix;
        !           287:   procedure Projective_Multiple_Loose_Conditioned_Silent_Corrector
        !           288:               ( s : in out Solu_Info_Array;
        !           289:                 pivot : in out natural; dist_sols : in double_float;
        !           290:                 c : in Corr_Pars; fail : out boolean );
        !           291:
        !           292:   generic
        !           293:     with function Norm ( x : Vector ) return double_float;
        !           294:     with function H  ( x : Vector; t : Complex_Number ) return Vector;
        !           295:     with function dH ( x : Vector; t : Complex_Number ) return Matrix;
        !           296:   procedure Projective_Multiple_Loose_Conditioned_Reporting_Corrector
        !           297:               ( file : in file_type; s : in out Solu_Info_Array;
        !           298:                 pivot : in out natural; dist_sols : in double_float;
        !           299:                 c : in Corr_Pars; fail : out boolean );
        !           300:
        !           301:   generic
        !           302:     with function Norm ( x : Vector ) return double_float;
        !           303:     with function H  ( x : Vector; t : Complex_Number ) return Vector;
        !           304:     with function dH ( x : Vector; t : Complex_Number ) return Matrix;
        !           305:   procedure Projective_Multiple_Severe_Normal_Silent_Corrector
        !           306:               ( s : in out Solu_Info_Array;
        !           307:                 pivot : in out natural; dist_sols : in double_float;
        !           308:                 c : in Corr_Pars; fail : out boolean );
        !           309:
        !           310:   generic
        !           311:     with function Norm ( x : Vector ) return double_float;
        !           312:     with function H  ( x : Vector; t : Complex_Number ) return Vector;
        !           313:     with function dH ( x : Vector; t : Complex_Number ) return Matrix;
        !           314:   procedure Projective_Multiple_Severe_Normal_Reporting_Corrector
        !           315:               ( file : in file_type; s : in out Solu_Info_Array;
        !           316:                 pivot : in out natural; dist_sols : in double_float;
        !           317:                 c : in Corr_Pars; fail : out boolean );
        !           318:
        !           319:   generic
        !           320:     with function Norm ( x : Vector ) return double_float;
        !           321:     with function H  ( x : Vector; t : Complex_Number ) return Vector;
        !           322:     with function dH ( x : Vector; t : Complex_Number ) return Matrix;
        !           323:   procedure Projective_Multiple_Severe_Conditioned_Silent_Corrector
        !           324:               ( s : in out Solu_Info_Array;
        !           325:                 pivot : in out natural; dist_sols : in double_float;
        !           326:                 c : in Corr_Pars; fail : out boolean );
        !           327:
        !           328:   generic
        !           329:     with function Norm ( x : Vector ) return double_float;
        !           330:     with function H  ( x : Vector; t : Complex_Number ) return Vector;
        !           331:     with function dH ( x : Vector; t : Complex_Number ) return Matrix;
        !           332:   procedure Projective_Multiple_Severe_Conditioned_Reporting_Corrector
        !           333:               ( file : in file_type; s : in out Solu_Info_Array;
        !           334:                 pivot : in out natural; dist_sols : in double_float;
        !           335:                 c : in Corr_Pars; fail : out boolean );
        !           336:
        !           337:   -- DESCRIPTION :
        !           338:   --   The predicted solutions of the system H(x,t)=0 are corrected.
        !           339:   --   With a multiple corrector, the correction starts at s(pivot).
        !           340:
        !           341:   -- ON ENTRY :
        !           342:   --   file       to write intermediate results on;
        !           343:   --   s          are the predicted values for the solutions;
        !           344:   --   pivot      is the index in the array where the correction
        !           345:   --              process must start;
        !           346:   --   dist_sols  two solutions x1 and x2 are different
        !           347:   --              if for some k in 1..n : | x1(k) - x2(k) | > dist_sols;
        !           348:   --   c          the corrector parameters.
        !           349:
        !           350:   -- ON RETURN :
        !           351:   --   s          the computed solutions;
        !           352:   --   pivot      if fail then pivot is the index in the array where
        !           353:   --              a difficulty occured; otherwise it is the same pivot as
        !           354:   --              on entry;
        !           355:   --   fail       is false if all solutions are computed with the desired
        !           356:   --              precision eps, within the maximum number of allowed
        !           357:   --              iterations, and if all solutions are different.
        !           358:
        !           359: end Correctors;

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>