using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing ;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Meta.Numerics.Matrices;
double[,] ptsImgOne = new double[3, 5];
double[,] ptsImgTwo = new double[3, 5];
ptsImgOne = new double[,] { { 0.41726, 0.94478, 0.33771, 0.11120, 0.24169 },
{ 0.04965, 0.49086, 0.90005, 0.78025, 0.40391},
{ 0.90271, 0.48925, 0.36924, 0.38973, 0.09645 } };
ptsImgTwo = new double[,] { { 0.13197, 0.57520, 0.35315, 0.04302, 0.73172 },
{ 0.94205, 0.05977, 0.82119, 0.16899, 0.64774 },
{ 0.95613, 0.23477, 0.01540, 0.64911, 0.45092 } };
RectangularMatrix q1 = new RectangularMatrix(ptsImgOne);
RectangularMatrix q2 = new RectangularMatrix(ptsImgTwo);
RectangularMatrix Qmultiply = new RectangularMatrix(5, 9);
for (int i = 0; i < q2.ColumnCount; i++)
{
Qmultiply[i, 0] = q1[0, i] * q2[0, i];
Qmultiply[i, 1] = q1[1, i] * q2[0, i];
Qmultiply[i, 2] = q1[2, i] * q2[0, i];
Qmultiply[i, 3] = q1[0, i] * q2[1, i];
Qmultiply[i, 4] = q1[1, i] * q2[1, i];
Qmultiply[i, 5] = q1[2, i] * q2[1, i];
Qmultiply[i, 6] = q1[0, i] * q2[2, i];
Qmultiply[i, 7] = q1[1, i] * q2[2, i];
Qmultiply[i, 8] = q1[2, i] * q2[2, i];
}
SingularValueDecomposition singValDec= Qmultiply.SingularValueDecomposition();
}
}
}
我正在使用 Meta.Numerics.Matrices 处理矩阵并计算 SVD,
但每当编译器到达最后一行代码时:
“SingularValueDecomposition singValDec=Qmultiply.SingularValueDecomposition();”
我收到一条错误消息,说Index is outisde the bounds of array。我仔细检查了 Qmultiply 数组和其余部分的边界。我尝试调试它,但错误仍然存在。
谁能帮我解决这个问题?