初始化复杂的稀疏矩阵

问题描述 投票:0回答:1

我已经使用apache commons-math声明了一个Sparse复杂矩阵,我完全不知道如何初始化它,此外,文档似乎很差。

import org.apache.commons.math3.linear.SparseFieldMatrix;

SparseFieldMatrix<Complex> Y;

如果我尝试将Y设置为等于新实例,则返回no suitable constructor的错误,如果我调用Y.CreateMatrix(int, int),它将告诉Y是空的。

那么,如何初始化Y

java apache-commons-math
1个回答
1
投票

我不知道图书馆,但看着Javadoc我认为这应该做的伎俩:

SparseFieldMatrix Y = new SparseFieldMatrix<>(ComplexField.getInstance());
© www.soinside.com 2019 - 2024. All rights reserved.