gpt4 book ai didi

Jampack.Zmat.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 12:45:31 25 4
gpt4 key购买 nike

本文整理了Java中Jampack.Zmat.<init>()方法的一些代码示例,展示了Zmat.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Zmat.<init>()方法的具体详情如下:
包路径:Jampack.Zmat
类名称:Zmat
方法名:<init>

Zmat.<init>介绍

暂无

代码示例

代码示例来源:origin: marytts/marytts

Zmat B = new Zmat(M, 2 * L + 1);
Zmat s = new Zmat(frm.length, 1);
for (i = 0; i < frm.length; i++)
  s.put(i, 0, new Z(frm[i], 0.0));

代码示例来源:origin: marytts/marytts

Zmat B = new Zmat(M, 2 * L + 1);
Zmat s = new Zmat(frm.length, 1);
for (i = 0; i < frm.length; i++)
  s.put(i, 0, new Z(frm[i], 0.0));

代码示例来源:origin: gov.nist.math/Jampack

/**
  Negates a Zmat
  @param A  The matrix to be negated
  @return   -A
*/
  public static Zmat o(Zmat A)
  {

   Zmat B = new Zmat(A.nrow, A.ncol);

   for (int i=0; i<A.nrow; i++)
     for (int j=0; j<A.ncol; j++){
      B.re[i][j] = -A.re[i][j];
      B.im[i][j] = -A.im[i][j];
     }
   return B;
  }

代码示例来源:origin: gov.nist.math/Jampack

/**
  Computes the product of a Z and a Zmat.
  @param     z  The complex scalar
  @param     A  The Zmat
  @return    zA
*/

  public static Zmat o(Z z, Zmat A)
  {

   Zmat B = new Zmat(A.nrow, A.ncol);
   for (int i=0; i<A.nrow; i++)
     for (int j=0; j<A.ncol; j++){
      B.re[i][j] = z.re*A.re[i][j] - z.im*A.im[i][j];
      B.im[i][j] = z.im*A.re[i][j] + z.re*A.im[i][j];
   }
   return B;
  }
/**

代码示例来源:origin: gov.nist.math/Jampack

/**
  Returns the submatrix  (ii[], jj1:jj2).
  @param i[]    Contains the row indices of the submatrix
  @param jj1    The lower column index
  @param jj2    The upper column index
*/

  public Zmat get(int ii[], int jj1, int jj2){
   int nrow = ii.length;
   int ncol = jj2-jj1+1;
   Zmat A = new Zmat(nrow, ncol);
   for (int i=0; i<nrow; i++)
     for (int j=0; j<ncol; j++){
      A.re[i][j] = re[ii[i]-basex][j+jj1-basex];
      A.im[i][j] = im[ii[i]-basex][j+jj1-basex];
     }
   return A;
  }

代码示例来源:origin: gov.nist.math/Jampack

/**
  Returns the conjugate transpose of a Zmat.
  @param A  The matrix to be conjugated and transposed
  @return   The conjugate transpose of A
*/
  public static Zmat o(Zmat A)
  {

   Zmat Ah = new Zmat(A.nc, A.nr);
   for (int i=0; i<A.nr; i++)
     for (int j=0; j<A.nc; j++){
      Ah.re[j][i] = A.re[i][j];
      Ah.im[j][i] = -A.im[i][j];
     }
   return Ah;
  }

代码示例来源:origin: gov.nist.math/Jampack

/**
  Returns the submatrix  (ii1:ii2, jj1:jj2).
  @param ii1    The lower column index
  @param ii2    The upper column index
  @param jj1    The lower row index
  @param jj2    The upper row index
*/

  public Zmat get(int ii1, int ii2, int jj1, int jj2){
   int nrow = ii2-ii1+1;
   int ncol = jj2-jj1+1;
   Zmat A = new Zmat(nrow, ncol);
   for (int i=0; i<nrow; i++)
     for (int j=0; j<ncol; j++){
      A.re[i][j] = re[i+ii1-basex][j+jj1-basex];
      A.im[i][j] = im[i+ii1-basex][j+jj1-basex];
     }
   return A;
  }

代码示例来源:origin: gov.nist.math/Jampack

/**
  Returns the transpose of a Zmat.
  @param A  The matrix to be transposed
  @return   The transpose of A
*/
  public static Zmat trans(Zmat A)
  {

   Zmat Ah = new Zmat(A.nc, A.nr);
   for (int i=0; i<A.nr; i++)
     for (int j=0; j<A.nc; j++){
      Ah.re[j][i] = A.re[i][j];
      Ah.im[j][i] = A.im[i][j];
     }
   return Ah;
  }
}

代码示例来源:origin: gov.nist.math/Jampack

/**
  Returns the submatrix  (ii[], jj[]).
  @param ii[]  Contains the row indices of the submatrix
  @param jj[]  Contains the column indices of the submatrix
*/

  public Zmat get(int ii[] , int jj[]){
   int nrow = ii.length;
   int ncol = jj.length;
   Zmat A = new Zmat(nrow, ncol);
   for (int i=0; i<nrow; i++)
     for (int j=0; j<ncol; j++){
      A.re[i][j] = re[ii[i]-basex][jj[j]-basex];
      A.im[i][j] = im[ii[i]-basex][jj[j]-basex];
     }
   return A;
  }

代码示例来源:origin: gov.nist.math/Jampack

/**
  Returns the submatrix  (ii1:ii2, jj[]).
  @param ii1    The lower row index
  @param ii2    The upper row index
  @param jj[]   Contains the column indices of the submatrix
*/

  public Zmat get(int ii1, int ii2, int jj[]){
   int nrow = ii2-ii1+1;
   int ncol = jj.length;
   Zmat A = new Zmat(nrow, ncol);
   for (int i=0; i<nrow; i++)
     for (int j=0; j<ncol; j++){
      A.re[i][j] = re[i+ii1-basex][jj[j]-basex];
      A.im[i][j] = im[i+ii1-basex][jj[j]-basex];
     }
   return A;
  }

代码示例来源:origin: gov.nist.math/Jampack

/**
  Generates an <tt>mxn</tt> matrix whose diagonal elements are
  one and whose off diagonal elements are zero.
  @param <tt>m</tt>   The number of rows in the matrix
  @param <tt>n</tt>   The number of columns in the matrix
*/
  public static Zmat o(int m, int n){

   Zmat I = new Zmat(m, n);

   for (int i=0; i<Math.min(m, n); i++){
     I.re[i][i] = 1;
     I.im[i][i] = 0;
   }

   return I;
  }

代码示例来源:origin: gov.nist.math/Jampack

/**
  Generates  a uniform random  Zmat.
  @param     m   The number of rows in the Zmat
  @param     n   The number of columns in the Zmat
  @return    The uniform random Zmat
  @exception JampackException
       Passed from below.

*/
  public static Zmat uzmat(int m, int n)
  throws JampackException{
   Zmat zm = new Zmat(m, n);
   for (int i=0; i<m; i++){
     for (int j=0; j<n; j++){
      zm.re[i][j] = R.nextDouble();
      zm.im[i][j] = R.nextDouble();
     }
   }
   return zm;
  }

代码示例来源:origin: gov.nist.math/Jampack

/**
  Generates  a normal random  Zmat.
  @param     m   The number of rows in the Zmat
  @param     n   The number of columns in the Zmat
  @return    The normal random Zmat
  @exception JampackException
       Passed from below.

*/
  public static Zmat nzmat(int m, int n)
  throws JampackException{
   Zmat zm = new Zmat(m, n);
   for (int i=0; i<m; i++){
     for (int j=0; j<n; j++){
      zm.re[i][j] = R.nextGaussian();
      zm.im[i][j] = R.nextGaussian();
     }
   }
   return zm;
  }
}

代码示例来源:origin: gov.nist.math/Jampack

/**
  Computes the sum of a Zdiagmat and a Zmat.
  @param     D  The Zdiagmat
  @param     A  The Zmat
  @return    D + A
  @exception JampackException
       Thrown for nonconformity.
*/

  public static Zmat o(Zdiagmat D, Zmat A)
  throws JampackException{

   if (D.order != A.nrow || D.order != A.ncol){
     throw new JampackException("Matrices not conformable for addition");
   }
   Zmat C = new Zmat(A);
   for (int i=0; i<D.order; i++){
     C.re[i][i] = C.re[i][i] + D.re[i];
     C.im[i][i] = C.im[i][i] + D.im[i];
   }
   return C;
  }

代码示例来源:origin: gov.nist.math/Jampack

/**
  Computes the sum of two Zmats
  @param     A  The first Zmat
  @param     B  The second Zmat
  @return    A + B
  @exception JampackException
       Thrown for nonconformity.
*/
  public static Zmat o(Zmat A, Zmat B)
  throws JampackException{
   if (A.nrow!=B.nrow || A.ncol != B.ncol){
     throw new JampackException("Matrices not conformable for addition");
   }
   Zmat C = new Zmat(A.nr, A.nc);

   for (int i=0; i<A.nrow; i++)
     for (int j=0; j<A.ncol; j++){
      C.re[i][j] = A.re[i][j] + B.re[i][j];
      C.im[i][j] = A.im[i][j] + B.im[i][j];
     }
   return C;
  }

代码示例来源:origin: gov.nist.math/Jampack

/**
  Computes the product of a Zmat and a Zdiagmat.
  @param     A  The Zgmat
  @param     D  The Zdiagmat
  @return    AD
  @exception JampackException for unconformity
*/

  public static Zmat o(Zmat A, Zdiagmat D)
  throws JampackException{

   if (D.order != A.ncol){
     throw new JampackException
      ("Unconformity in product.");
   }
   Zmat B = new Zmat(A.nrow, A.ncol);
   for (int i=0; i<A.nrow; i++){
     for (int j=0; j<A.ncol; j++){
      B.re[i][j] = D.re[j]*A.re[i][j] - D.im[j]*A.im[i][j];
      B.im[i][j] = D.re[j]*A.im[i][j] + D.im[j]*A.re[i][j];
     }
   }
   return B;
  }

代码示例来源:origin: gov.nist.math/Jampack

/**
  Computes the sum of a Zmat and a Zdiagmat.
  @param     A The Zmat
  @param     D The Zdiagmat
  @return    A + D
  @exception JampackException
       Thrown for nonconformity.
*/

  public static Zmat o(Zmat A, Zdiagmat D)
  throws JampackException{

   if (D.order != A.nrow || D.order != A.ncol){
     throw new JampackException("Matrices not conformable for addition");
   }
   Zmat C = new Zmat(A);
   for (int i=0; i<A.nrow; i++){
     C.re[i][i] = C.re[i][i] + D.re[i];
     C.im[i][i] = C.im[i][i] + D.im[i];
   }
   return C;
  }

代码示例来源:origin: gov.nist.math/Jampack

/**
  Computes the difference of a Zmat and a Zdiagmat.
  @param     A  The Zmat
  @param     D  The Zdiagmat
  @return    A - D
  @exception JampackException
       Thrown if there is a nonconformity.
*/

  public static Zmat o(Zmat A, Zdiagmat D)
  throws JampackException{

   if (D.order != A.nrow || D.order != A.ncol){
     throw new JampackException
      ("Matrices not conformable for subtraction");
   }
   Zmat C = new Zmat(A);
   for (int i=0; i<D.order; i++){
     C.re[i][i] = C.re[i][i] - D.re[i];
     C.im[i][i] = C.im[i][i] - D.im[i];
   }
   return C;
  }

代码示例来源:origin: gov.nist.math/Jampack

/**
  Computes the product Q<sup>H</sup>B.   Throws JampackException for
  inconsistent dimenstions.

  @param     B A Zmat
  @return    Q<sup>H</sup>B
  @exception JampackException
       Thrown for inconsistent dimensions.
*/
  public Zmat qhb(Zmat B)
  throws JampackException{

    if (B.ncol != ncol){
     throw new JampackException
      ("Inconsistent dimensions.");
   }

   Zmat C = new Zmat(B);

   for (int k=0; k<ntran; k++){
     House.ua(U[k], C, C.bx+k, C.rx, C.bx, C.cx);
   }

   return C;

  }

代码示例来源:origin: gov.nist.math/Jampack

/**
  Computes the product QB.  Throws JampackException for
  inconsistent dimenstions.

  @param     B A Zmat
  @return    QB
  @exception JampackException
       Thrown for inconsistent dimensions.
*/
  
  public Zmat qb(Zmat B)
  throws JampackException{

   if (B.ncol != ncol){
     throw new JampackException
      ("Inconsistent dimensions.");
   }  

   Zmat C = new Zmat(B);

   for (int k=ntran-1; k>=0; k--){
     House.ua(U[k], C, C.bx+k, C.rx, C.bx, C.cx);
   }

   return C;

  }

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com