How to know which function I'm calling

I’m using this library,
and when I call the norm function, IntelliJ tells me I’m missing an implicit.
I don’t see anything about implicit in the documentation/cheat-sheet? Is there something in the error message that tells me what I need to do?

  test("breeze"){
    import breeze.linalg._
    import scala.util.Random
    for{dim <- 1 to 4} {
      val dm1 = DenseMatrix.tabulate(dim, dim)((_,_)=>Random.between(-10.0,10.0))
      val svd.SVD(u, s, vt) = svd(dm1)
      val dm2 = u * diag(s) * vt.t
      val dist:Double = norm(dm2 - dm1)
      assert(dist < 0.001, s"dist=$dist dm1=[$dm1] dm2=[$dm2]")
    }
  }

Here is the error message.

/Users/jnewton/Repos/scalain_e/scalain-e-course-code/src/test/scala/TranscendentalsTestSuite.scala:493:29
could not find implicit value for parameter impl: breeze.linalg.norm.Impl[breeze.linalg.DenseMatrix[Double],VR]
      val dist:Double = norm(dm2 - dm1)

AFAICS this rather is norm#apply(), and it declares an implicit parameter, indeed.

Check the API doc and/or navigate to this class/method in your IDE.

Shouldn’t the documentation tell me how to define the implicits? That’s normally something the documentation explains, right? Or is it something a scala programmer is supposed to just know instinctively?

norm#apply() expects a norm.Impl which is a specialized UFunc.UImpl, and according to the API doc: “Many tensor objects have a norm implementation implicit, which is what this calls.” The cheat sheet you linked says “UFuncs are very important in Breeze.” Have you checked this documentation?

I don’t know Breeze at all, but given that it seems to be the go-to Scala math library, I’d be somewhat surprised if the documentation were so severely lacking that it’s impossible to get started.

It could be that norm is intended to work on vectors but not on matrices, even though the documentation says that norm Computes the norm of an object. Many tensor objects have a norm implementation implicit, which is what this calls.. That’s what I’m guessing until someone who knows breeze chimes in. I also posted a question on the GitHub issue tracker.

The GitHub page warns that the scaladoc is out of date and should not be trusted.

No, it’s not too lacking to get started. Indeed it’s pretty easy to get started.
The problem is finding out subtle things. For example, there is an svd function which computes a singular-value-decomposition. However, the SVD is not unique. I don’t see in the documentation which svd is computed.

Note that Scaladex generally automatically generates and links to the Scaladoc for public libraries – for instance, here is the breeze page. Since that is auto-generated, it is usually correct provided you identify the version correctly.