⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ykelrop.h

📁 [[ Complex Matrices : Language c]]
💻 H
字号:
/* xcelrop.h                   free ware                   xhunga@tiscali.fr  */


/* --------------------------------- FUNCTION ------------------------------  */
/* Do    : swap two rows in a matrix                                          */
/*                                                                            */
/* -------------------------------------------------------------------------- */
void swaprow_mzF(
PmzF m,
int     row1,
int     row2)
{
int    j;
double t;

    for ( j = 0 ; j < m->cols ; j++)
    {
                            t   = *(m->pb+row1 *m->cols+j);
      *(m->pb+row1 *m->cols+j ) = *(m->pb+row2 *m->cols+j);
      *(m->pb+row2 *m->cols+j ) =   t;
    }
}

/* --------------------------------- FUNCTION ------------------------------  */
/* Do    :                                                                    */
/*                                                                            */
/* -------------------------------------------------------------------------- */
void mulrow_mzF(
PmzF  mA,
int      row,
complexF z)
{
     int j;
complexF za;

    for ( j = 0; j < mA->cols ; j += C4)
         {
          za.r.n = *(mA->pb+row *mA->cols+j  );
          za.r.d = *(mA->pb+row *mA->cols+j+1);
          za.i.n = *(mA->pb+row *mA->cols+j+2);
          za.i.d = *(mA->pb+row *mA->cols+j+3);

          za.r = mini_F(za.r);          za.i = mini_F(za.i);
           z.r = mini_F( z.r);           z.i = mini_F( z.i);

          za = mul_zF(za,z);

          za.r = mini_F(za.r);          za.i = mini_F(za.i);

          *(mA->pb+row *mA->cols+j  ) = za.r.n;
          *(mA->pb+row *mA->cols+j+1) = za.r.d;
          *(mA->pb+row *mA->cols+j+2) = za.i.n;
          *(mA->pb+row *mA->cols+j+3) = za.i.d;
         }
}


/* --------------------------------- FUNCTION ------------------------------  */
/* Do    :                                                                    */
/*                                                                            */
/* -------------------------------------------------------------------------- */
void addrow_mzF(
PmzF  mA,
complexF z,
int      row1,
int      row2)
{
     int j;
complexF zrow1;
complexF zrow2;

    for( j = 0; j < mA->cols ; j += C4)
        {
        zrow1.r.n = *(mA->pb+row1 *mA->cols+j  );
        zrow1.r.d = *(mA->pb+row1 *mA->cols+j+1);
        zrow1.i.n = *(mA->pb+row1 *mA->cols+j+2);
        zrow1.i.d = *(mA->pb+row1 *mA->cols+j+3);

        zrow1 = mul_zF(zrow1,z);

        zrow2.r.n = *(mA->pb+row2 *mA->cols+j  );
        zrow2.r.d = *(mA->pb+row2 *mA->cols+j+1);
        zrow2.i.n = *(mA->pb+row2 *mA->cols+j+2);
        zrow2.i.d = *(mA->pb+row2 *mA->cols+j+3);

        zrow2 = add_zF(zrow1,zrow2);

        *(mA->pb+row2 *mA->cols+j  ) = zrow2.r.n;
        *(mA->pb+row2 *mA->cols+j+1) = zrow2.r.d;
        *(mA->pb+row2 *mA->cols+j+2) = zrow2.i.n;
        *(mA->pb+row2 *mA->cols+j+3) = zrow2.i.d;
        }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -