Scala(Breeze)+ Intellij:“无法解析符号*” [英] Scala (Breeze) + Intellij: "Cannot resolve symbol *"

查看:453
本文介绍了Scala(Breeze)+ Intellij:“无法解析符号*”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Breeze对密集矩阵进行简单的线性代数运算。我正在使用Intellij IDEA。以下是我的代码片段:

I'm using Breeze to to do sum simple linear algebra operations on dense matrices. I'm using the Intellij IDEA. Here is an snippet of my code:

import breeze.linalg._    
val X1:DenseMatrix[Double] = DenseMatrix.zeros[Double](10, 5) + 1.0
val n1 : Double = X1.rows.toDouble
val one_tall_t1  = DenseMatrix.zeros[Double](1, n1.toInt) + 1.0
val mu1=one_tall_t1*X1/n1

在最后一行,符号*和/在IDE中显示为红色。错误消息是无法解析符号*。

In the last line, the symbols * and / are shown with red color in the IDE. The error message is "Cannot resolve the symbol *".

但是Intellij构建程序时没有任何错误,并且运行正常。

But Intellij builds the program without any errors, and it runs fine.

我一直在尝试找出原因:因为我是Scala的新手,我不确定是不是因为Intellij,Breeze,还是我的代码。在某些帖子中,人们建议使缓存无效并重新启动Intellij,但这并不能解决我的问题。

I've been trying to find out the reason: since I'm new to Scala, I'm not sure if it is because of Intellij, Breeze, or just my code. In some posts, people have suggested to invalidate cache and restart Intellij, but this does not solve my issue.

感谢您的意见或解决方案!

I appreciate your comments or solutions!

推荐答案

IntelliJ被Breeze中使用的复杂隐式搜索搞糊涂了。当我可以最小化它们并绕过它时我会提出错误,但这是一个艰难的过程。 (Eclipse,它的价值,并没有好多少。)

IntelliJ gets confused by complex implicit searches like those used in Breeze. I file bugs when I can minimize them and get around to it, but it's a slog. (Eclipse, for what it's worth, isn't much better.)

如果你只是依赖于Breeze,而不是在它内部开发,它通常会更好。我假设你已经这样做了。

It typically works better if you're just depending on Breeze, not developing inside of it. I assume you're doing that already though.

这篇关于Scala(Breeze)+ Intellij:“无法解析符号*”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆