yrudotv0.h

来自「[[ Complex Matrices : Language c]]」· C头文件 代码 · 共 73 行

H
73
字号
/* xrndf.h                   free ware                     xhunga@tiscali.fr  */

/* --------------------------------- FUNCTION ------------------------------  */
/* Do    :                                                                    */
/*                                                                            */
/* -------------------------------------------------------------------------- */
void rnduv_0_mzF(
PmzF mu,
PmzF mv,
    int n,
    int d)
{
     int i;
     int j;
complexF InnerProduct;

   rnd_mzF(mu,n,d);
   rnd_mzF(mv,n,d);

       i = mu->rows - 1;
       j = mu->cols - C4;

     *(mu->pb+i *mu->cols+j  ) = 0;
     *(mu->pb+i *mu->cols+j+1) = 1;
     *(mu->pb+i *mu->cols+j+2) = 0;
     *(mu->pb+i *mu->cols+j+3) = 1;

     *(mv->pb+i *mv->cols+j  ) = 1;
     *(mv->pb+i *mv->cols+j+1) = 1;
     *(mv->pb+i *mv->cols+j+2) = 0;
     *(mv->pb+i *mv->cols+j+3) = 1;

   InnerProduct = innerprod_zF(mu,mv);

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


/* --------------------------------- FUNCTION ------------------------------  */
/* Do    :                                                                    */
/*                                                                            */
/* -------------------------------------------------------------------------- */
void rnduv_0_mzI(
PmzF mu,
PmzF mv,
    int n)
{
     int i;
     int j;
complexF InnerProduct;

   rnd_mzI(mu,n);
   rnd_mzI(mv,n);

       i = mu->rows - 1;
       j = mu->cols - C4;

     *(mu->pb+i *mu->cols+j  ) = 0;
     *(mu->pb+i *mu->cols+j+2) = 0;

     *(mv->pb+i *mv->cols+j  ) = 1;
     *(mv->pb+i *mv->cols+j+2) = 0;

   InnerProduct = innerprod_zF(mu,mv);

     *(mu->pb+i *mu->cols+j  ) = -InnerProduct.r.n;
     *(mu->pb+i *mu->cols+j+2) = -InnerProduct.i.n;
}

⌨️ 快捷键说明

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