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[][] { {1, 2}, {3, 4}});
30 DoubleMatrix im = new DoubleMatrix(new double[][] { {5, 6}, {7, 8}});
31 Matrix ac = new DoubleComplexMatrix(re, im);
32 ac.print("ac");
33
34 DoubleComplexNumber[][] cc = new DoubleComplexNumber[][] { {new DoubleComplexNumber(1, 5), new DoubleComplexNumber(2, 6)}, {new DoubleComplexNumber(3, 7), new DoubleComplexNumber(4, 8)}};
35 Matrix ac2 = new DoubleComplexMatrix(cc);
36 ac2.print("ac2");
37 }
38 }
|