Re: [scala-breeze] converting from scalala

27 views
Skip to first unread message

David Hall

unread,
Apr 23, 2013, 7:34:25 PM4/23/13
to scala-...@googlegroups.com
Hi Rob,

Sorry for the terse reply off list, was (am) in a meeting.

Basically, this is one of the many gaps in the implicits that are
available right now. What's needed is an implicit that converts
CanSlice[Seq[Int],...] to CanSlice[::.type, ...]

implicit def liftSliceRows[M,V,ColumnSlice, Result](implicit mbound: M
<:< Matrix[V]), cs2: CanSlice2[Seq[Int], ColumnSlice, Result]) = {
new ColumnSlice2[::.type, ColumnSlice, Result] {
def apply(m: M, seq: ::.type, column: ColumnSlice) = cs2(m, 0
until m.rows, column)
}
}


(haven't compiled it, will get to it soon, but PRs appreciated.)

In general, anything that isn't DenseMatrix or DenseVector is kind of
alpha-y or beta-y. Also, we need to rethink slicing in general, but
that's a longer conversation.

HTH!

-- David

On Tue, Apr 23, 2013 at 2:56 PM, Rob Norris <rob_n...@mac.com> wrote:
> Hi, I'm converting some code that I didn't write and don't understand (full
> disclosure) from Scalala and it's mostly painless so far, however I'm
> running into problems with the :: thing.
>
> [scalac] ... Amoeba.scala:89: error: could not find implicit value for
> parameter canSlice:
> breeze.linalg.support.CanSlice2[breeze.linalg.Matrix[Double],collection.immutable.::.type,Int,Result]
> [scalac] val value = funcName(p(::, 0));
> [scalac] ^
>
> Is there a secret import that will make this work?
>
> I'm on 2.10 and using 0.2.2 of math and core.
>
> Thanks,
>
> rob
>
> --
> You received this message because you are subscribed to the Google Groups
> "Scala Breeze" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to scala-breeze...@googlegroups.com.
> To post to this group, send email to scala-...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/scala-breeze/-/sY9e84cwz8UJ.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
Reply all
Reply to author
Forward
0 new messages