Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>specifying <code>dot[Real]</code> explicitly should work too. </p> <pre><code>def rowDot(r1: Row, r2: Row) = dot[Real](_*_)(r1, r2) </code></pre> <p><strong>EDIT</strong></p> <p>replying to your edit: I think the issue is that the implicit conversion from <code>Array</code> to <code>WrappedArray</code> is not applied recursively when you have a <code>Array[Array]</code>. </p> <p><code>Array[Int]</code> is not an <code>Iterable[Int]</code>; normally, when you assign it to a Iterable, an <code>Array[Int]</code> is implicitly converted to a <code>WrappedArray[Int]</code> (where <code>WrappedArray</code> <strong>is</strong> a Iterable[Int]). This is what happens when you use <code>List[Array[Int]]</code> (you get a <code>List[WrappedArray[Int]]</code> implicitly). </p> <p>However, as I said, the implicit conversion is not applied recursively, so an <code>Array[Array[Int]]</code> is not implicitly converted to <code>WrappedArray[WrappedArray[Int]]</code>.</p> <p>Here's a REPL session that demonstrates the problem:</p> <p>A List[Array[Int]] can be assigned to Iterable[Iterable[Int]] (note that Array is converted to WrappedArray) </p> <pre><code>scala&gt; val i : Iterable[Iterable[Int]] = List(Array(1,2), Array(1,2,3)) i: Iterable[Iterable[Int]] = List(WrappedArray(1, 2), WrappedArray(1, 2, 3)) </code></pre> <p>An Array[Array[Int]] does not work automatically (as you discovered)</p> <pre><code>scala&gt; val j : Iterable[Iterable[Int]] = Array(Array(1,2), Array(1,2,3)) &lt;console&gt;:9: error: type mismatch; found : Array[Array[Int]] required: Iterable[Iterable[Int]] val j : Iterable[Iterable[Int]] = Array(Array(1,2), Array(1,2,3)) ^ </code></pre> <p>However, with some hand-holding (converting manually the inner Arrays to WrappedArrays) everything works again: </p> <pre><code> scala&gt; import scala.collection.mutable.WrappedArray import scala.collection.mutable.WrappedArray scala&gt; val k : Iterable[Iterable[Int]] = Array(WrappedArray.make(Array(1,2)), WrappedArray.make(Array(1,2,3))) k: Iterable[Iterable[Int]] = WrappedArray(WrappedArray(1, 2), WrappedArray(1, 2, 3)) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload