我还没有喜欢告诉我如何在DenseVectors中比较Scala中的枚举:
import breeze.linalg._
object StepThresholdConsideration extends Enumeration {
type StepThresholdConsideration = Value
val Inclusive, Strict = Value
}
val stepThresholdConsideration = DenseVector(StepThresholdConsideration.Strict, StepThresholdConsideration.Strict, StepThresholdConsideration.Inclusive)
stepThresholdConsideration :== DenseVector.fill(3, StepThresholdConsideration.Strict)
stepThresholdConsideration :== DenseVector.fill(3, StepThresholdConsideration.Inclusive)
这不起作用。为什么呢?
stepThresholdConsideration.map(_ == StepThresholdConsideration.Strict)
stepThresholdConsideration.map(_ == StepThresholdConsideration.Inclusive)
另一方面工作。