Revision 1001 trunk/src/linad99/newfmin.cpp

newfmin.cpp (revision 1001)
525 525
          gbest.elem(i)=w.elem(i);
526 526
        }
527 527
      }
528
      if (use_control_c==1)         
529
      {
528 530
#if (defined( __SUN__) && !defined(__GNU__)) || defined(UNIXKLUDGE) || defined(linux)
529
       if(ctlc_flag || ifn == dcheck_flag )
530
#elif defined(__BORLANDC__)
531
       if ( kbhit() || ctlc_flag|| ifn == dcheck_flag )
532
#else
533
       if ( kbhit() || ifn == dcheck_flag )
534
#endif
535
       {
536
          int c=0;
537
          if (ifn != dcheck_flag)
538
          {
539
          #if !defined(__GNUDOS__)  || defined(UNIXKLUDGE)  || defined(linux) \
540
	      || defined(__CYGWIN32__) || defined(__MINGW32__)
541
            c = toupper(getch());
542
          #else
543
            c = toupper(getxkey());
544
          #endif
545
          }
546
          else
547
            c='C';
548
          if ( c == 'C')
549
          {
550
            for (i=1; i<=n; i++)
531
         if(ctlc_flag || ifn == dcheck_flag )
532
  #elif defined(__BORLANDC__)
533
         if ( kbhit() || ctlc_flag|| ifn == dcheck_flag )
534
  #else
535
         if ( kbhit() || ifn == dcheck_flag )
536
  #endif
537
         {
538
            int c=0;
539
            if (ifn != dcheck_flag)
551 540
            {
552
              x.elem(i)=xx.elem(i);
541
            #if !defined(__GNUDOS__)  || defined(UNIXKLUDGE)  || defined(linux) \
542
  	      || defined(__CYGWIN32__) || defined(__MINGW32__)
543
              c = toupper(getch());
544
            #else
545
              c = toupper(getxkey());
546
            #endif
553 547
            }
554
            ireturn = 3;
555
            derch(f, x , w, n, ireturn);
556
            return;
557
          }
558
          else 
559
          {
560
            if ( c == 'Q'|| c == 'N') 
548
            else
549
              c='C';
550
            if ( c == 'C')
561 551
            {
562
              quit_flag=c;
563
              goto label92;
552
              for (i=1; i<=n; i++)
553
              {
554
                x.elem(i)=xx.elem(i);
555
              }
556
              ireturn = 3;
557
              derch(f, x , w, n, ireturn);
558
              return;
564 559
            }
565
            else
560
            else 
566 561
            {
567
              quit_flag=0;
562
              if ( c == 'Q'|| c == 'N') 
563
              {
564
                quit_flag=c;
565
                goto label92;
566
              }
567
              else
568
              {
569
                quit_flag=0;
570
              }
568 571
            }
569
          }
572
         }
570 573
       }
571 574
       if (quit_flag)
572 575
       {

Also available in: Unified diff