ComplexMatrixSample.java
01 /*
02  * $Id: ComplexMatrixSample.java,v 1.10 2008/03/03 07:18:10 koga Exp $
03  *
04  * Copyright (C) 2004 Koga Laboratory. All rights reserved.
05  *
06  */
07 package matxbook.chap07;
08 
09 import org.mklab.nfc.matrix.DoubleComplexMatrix;
10 import org.mklab.nfc.matrix.DoubleMatrix;
11 import org.mklab.nfc.matrix.Matrix;
12 import org.mklab.nfc.scalar.DoubleComplexNumber;
13 
14 
15 /**
16  * 複素行列のサンプルです。
17  @author koga
18  @version $Revision: 1.10 $, 2004/04/14
19  */
20 public class ComplexMatrixSample {
21 
22   /**
23    * メインメソッド
24    
25    @param args コマンドライン引数
26    */
27   @SuppressWarnings("nls")
28   public static void main(String[] args) {
29     DoubleMatrix re = new DoubleMatrix(new double[][] { {12}{34}});
30     DoubleMatrix im = new DoubleMatrix(new double[][] { {56}{78}});
31     Matrix ac = new DoubleComplexMatrix(re, im);
32     ac.print("ac");
33 
34     DoubleComplexNumber[][] cc = new DoubleComplexNumber[][] { {new DoubleComplexNumber(15)new DoubleComplexNumber(26)}{new DoubleComplexNumber(37)new DoubleComplexNumber(48)}};
35     Matrix ac2 = new DoubleComplexMatrix(cc);
36     ac2.print("ac2");
37   }
38 }