Skip Navigation Links
Numerical Libraries
Linear Algebra
Differential Equations
Optimization
Samples
Skip Navigation Links
Linear Algebra
CSLapack
CSBlas
   1:  #region Translated by Jose Antonio De Santiago-Castillo.
   2:   
   3:  //Translated by Jose Antonio De Santiago-Castillo. 
   4:  //E-mail:JAntonioDeSantiago@gmail.com
   5:  //Web: www.DotNumerics.com
   6:  //
   7:  //Fortran to C# Translation.
   8:  //Translated by:
   9:  //F2CSharp Version 0.71 (November 10, 2009)
  10:  //Code Optimizations: None
  11:  //
  12:  #endregion
  13:   
  14:  using System;
  15:  using DotNumerics.FortranLibrary;
  16:   
  17:  namespace DotNumerics.CSLapack
  18:  {
  19:      public class DROT
  20:      {
  21:      
  22:   
  23:          #region Fields
  24:          
  25:          double DTEMP = 0; int I = 0; int IX = 0; int IY = 0; 
  26:   
  27:          #endregion
  28:   
  29:          public DROT()
  30:          {
  31:      
  32:          }
  33:      
  34:          public void Run(int N, ref double[] DX, int offset_dx, int INCX, ref double[] DY, int offset_dy, int INCY, double C
  35:                           , double S)
  36:          {
  37:   
  38:              #region Array Index Correction
  39:              
  40:               int o_dx = -1 + offset_dx;  int o_dy = -1 + offset_dy; 
  41:   
  42:              #endregion
  43:   
  44:              // c
  45:              // c     applies a plane rotation.
  46:              // c     jack dongarra, linpack, 3/11/78.
  47:              // c     modified 12/3/93, array(1) declarations changed to array(*)
  48:              // c
  49:              // c
  50:   
  51:              #region Body
  52:              
  53:              if (N <= 0) return;
  54:              if (INCX == 1 && INCY == 1) goto LABEL20;
  55:              // c
  56:              // c       code for unequal increments or equal increments not equal
  57:              // c         to 1
  58:              // c
  59:              IX = 1;
  60:              IY = 1;
  61:              if (INCX < 0) IX = ( - N + 1) * INCX + 1;
  62:              if (INCY < 0) IY = ( - N + 1) * INCY + 1;
  63:              for (I = 1; I <= N; I++)
  64:              {
  65:                  DTEMP = C * DX[IX + o_dx] + S * DY[IY + o_dy];
  66:                  DY[IY + o_dy] = C * DY[IY + o_dy] - S * DX[IX + o_dx];
  67:                  DX[IX + o_dx] = DTEMP;
  68:                  IX = IX + INCX;
  69:                  IY = IY + INCY;
  70:              }
  71:              return;
  72:              // c
  73:              // c       code for both increments equal to 1
  74:              // c
  75:          LABEL20:  
  76:              for (I = 1; I <= N; I++)
  77:              {
  78:                  DTEMP = C * DX[I + o_dx] + S * DY[I + o_dy];
  79:                  DY[I + o_dy] = C * DY[I + o_dy] - S * DX[I + o_dx];
  80:                  DX[I + o_dx] = DTEMP;
  81:              }
  82:              return;
  83:   
  84:              #endregion
  85:   
  86:          }
  87:      }
  88:  }