ComposedMatrixSample.java
01 /*
02  * $Id: ComposedMatrixSample.java,v 1.5 2008/02/02 03:06:24 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.DoubleMatrix;
10 
11 
12 /**
13  * 合成行列のサンプルです。
14  @author koga
15  @version $Revision: 1.5 $, 2004/04/14
16  */
17 public class ComposedMatrixSample {
18 
19   /**
20    * メインメソッド
21    
22    @param args コマンドライン引数
23    */
24   @SuppressWarnings("nls")
25   public static void main(String[] args) {
26     DoubleMatrix a = new DoubleMatrix(new double[][] { {12}{34}});
27     DoubleMatrix b = new DoubleMatrix(new double[] {56}).transpose();
28     DoubleMatrix c = new DoubleMatrix(new double[][] { {10}{01}});
29     DoubleMatrix d = new DoubleMatrix(new double[] {1});
30     DoubleMatrix a11 = a;
31     DoubleMatrix a12 = b.unaryMinus().multiply(d.inverse()).multiply(b.conjugateTranspose());
32     DoubleMatrix a21 = c.unaryMinus();
33     DoubleMatrix a22 = a.unaryMinus().conjugateTranspose();
34     DoubleMatrix aa1 = a11.appendRight(a12);
35     DoubleMatrix aa2 = a21.appendRight(a22);
36     DoubleMatrix e = aa1.appendDown(aa2);
37     e.print("e");
38   }
39 }