これは少しばかげた質問かもしれませんし、私もこの問題に取り組むための最良の方法を誤解しているかもしれませんが、私が本質的にやりたいことは次のとおりです。
次の行列を乗算して、結果を-0.8にします。ただし、理想的にはJAMA関数を使用してこれを実行したいと思います。これまでのところ、私は次のことを行っていますが、もうすぐそこにいると思います。これは、私が立ち往生している最後のステップにすぎません。
// Create the two arrays (in reality I won't be creating these, the two 1D matrices
// will be the result of other calculations - I have just created them for this example)
double[] aArray = [0.2, -0.2];
double[] bArray = [0, 4];
// Create matrices out of the arrays
Matrix a = new Matrix( aArray, 1 );
Matrix b = new Matrix( bArray, 1 );
// Multiply matrix a by matrix b to get matrix c
Matrix c = a.times(b);
// Turn matrix c into a double
double x = // ... this is where I'm stuck
これに関するどんな助けも本当にありがたいです。前もって感謝します!