gpt4 book ai didi

java - 斯卡拉微风 : Solution to a complex system of linear equations

转载 作者:太空宇宙 更新时间:2023-11-04 14:24:23 25 4
gpt4 key购买 nike

我需要找到复杂线性方程组的解。当前的实现采用 C++ 并调用 LAPACK zgesv功能。我考虑用 Scala 重写它并使用 Breeze 进行线性代数。我尝试举个例子

import breeze.linalg._
import breeze.math._

val a = DenseMatrix(
(Complex(-1.34, 2.55), Complex(0.28, 3.17), Complex(-6.39, -2.20), Complex(0.72, -0.92)),
(Complex(-0.17, -1.41), Complex(3.31, -0.15), Complex(-0.15, 1.34), Complex(1.29, 1.38)),
(Complex(-3.29, -2.39), Complex(-1.91, 4.42), Complex(-0.14, -1.35), Complex(1.72, 1.35)),
(Complex(2.41, 0.39), Complex(-0.56, 1.47), Complex(-0.83, -0.69), Complex(-1.96, 0.67))
)

val b = DenseVector(Complex(26.26, 51.78), Complex(6.43, -8.68), Complex(-5.75, 25.31), Complex(1.16, 2.57))

val x = a \ b

我收到错误

Error:(14, 17) not enough arguments for method : (implicit op: breeze.linalg.operators.OpSolveMatrixBy.Impl2[breeze.linalg.DenseMatrix[breeze.math.Complex],breeze.linalg.DenseVector[breeze.math.Complex],That])That. Unspecified value parameter op. lazy val x = a \ b ^

看起来 Breeze 不支持此操作的复杂类型。我还发现 netlib-java 不支持复杂的例程,由 Breeze 使用。我理解正确吗?目前 Breeze 不支持它?

最佳答案

抱歉,Breeze 目前不支持复数的 lapack 调用。

关于java - 斯卡拉微风 : Solution to a complex system of linear equations,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26828842/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com