Scala中的多变量插值

时间:2018-04-07 14:34:53

标签: scala scala-breeze

我需要在Scala中进行多变量插值。我正在使用breeze.interpolation的LinearInterpolator但无法找到传递矩阵的方法。我想知道是否有人知道这是否可能?

这是我尝试过的:

 for( const auto &p : other.monomial )
          monomial.insert( p );

它不会运行,因为import breeze.interpolation.LinearInterpolator import breeze.linalg.{DenseMatrix, DenseVector} val dm = DenseMatrix( Array(1.2, 2.4, 6.8), Array(1.5, 2.6, 6.1), Array(1.3, 2.9, 6.8), Array(1.7, 2.2, 6.2), Array(1.1, 2.8, 6.8), Array(1.7, 2.1, 6.9) ) val dv = DenseVector(2.2, 3.1, 5.2, 1.8, 4.4, 7, 2) LinearInterpolator(dm, dv) 似乎不允许Linearinterpolator()。提前谢谢了!

1 个答案:

答案 0 :(得分:0)

根据documentation,这可能是不可能的:

  

breeze.interpolation模块目前支持一维数据的插值工具(单变量插值)

并查看attributes of the LinearInterpolator类的类型,您可以看到需要传递Vector,而DenseMatrix不是Vector