n00b question: Finding docs / type for DenseMatrix.tabulate

43 views
Skip to first unread message

Antony Courtney

unread,
Mar 11, 2015, 6:07:36 PM3/11/15
to scala-...@googlegroups.com
Definitely a beginner question, and embarrassingly probably as much a n00b Scala question as a n00b Breeze question:

Is there scaladoc for functions like DenseMatrix.tabulate or DenseVector.fill ?

I saw them referenced on the linear algebra cheat sheet, but couldn't find them on http://www.scalanlp.org/api/breeze/index.html#breeze.linalg.DenseMatrix.

I imagine there is probably some sort of implicit conversion to the class that holds these operators, but what is that class and (more importantly) how can I find it?

Even if there is no useful scaladoc, it would be helpful to see the type signatures.

Thanks,

   -Antony

David Hall

unread,
Mar 11, 2015, 6:25:47 PM3/11/15
to scala-...@googlegroups.com
On Wed, Mar 11, 2015 at 3:04 PM, Antony Courtney <antony....@gmail.com> wrote:
Definitely a beginner question, and embarrassingly probably as much a n00b Scala question as a n00b Breeze question:

Is there scaladoc for functions like DenseMatrix.tabulate or DenseVector.fill ?

I saw them referenced on the linear algebra cheat sheet, but couldn't find them on http://www.scalanlp.org/api/breeze/index.html#breeze.linalg.DenseMatrix.

In general I've stopped updating that, mostly out of laziness, but also because Scaladoc doesn't do a good job documenting breeze functionality (mostly because everything depends so much on implicits.) I should probably just delete it.
 

I imagine there is probably some sort of implicit conversion to the class that holds these operators, but what is that class and (more importantly) how can I find it?

So fwiw, even though Breeze makes extremely(!) heavy use of implicit parameters, there are very few instances of implicit "adding methods to objects" conversions in all of Breeze. I can only think of one, and I added it quite recently (adding Breeze-style operators to built in numbers). I generally dislike them and try to avoid them.

DenseMatrix.tabulate etc. are methods on the *companion object*, not on an instance of the class. To see the companion in Scaladoc (this is true for all modernish scaladocs), you click the C image in the top left corner of the page. (See how there's a little turned up corner? That's supposed to be a hint, I guess... I agree it's not the most obvious thing.) This image: http://www.scalanlp.org/api/breeze/lib/class_to_object_big.png 
 

Even if there is no useful scaladoc, it would be helpful to see the type signatures.

My preferred method is to use an IDE and attach the source for Breeze, then goto declaration if you're ever confused. If you use SBT and IntelliJ, you can tell it to autodownload sources.
 

 

Thanks,

   -Antony

--
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/msgid/scala-breeze/0b3d1192-781e-4275-9ded-234a09ccb392%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Hall

unread,
Mar 11, 2015, 6:33:12 PM3/11/15
to scala-...@googlegroups.com

On Wed, Mar 11, 2015 at 3:25 PM, David Hall <david....@gmail.com> wrote:
 

I imagine there is probably some sort of implicit conversion to the class that holds these operators, but what is that class and (more importantly) how can I find it?

So fwiw, even though Breeze makes extremely(!) heavy use of implicit parameters, there are very few instances of implicit "adding methods to objects" conversions in all of Breeze. I can only think of one, and I added it quite recently (adding Breeze-style operators to built in numbers). I generally dislike them and try to avoid them.

Actually, that's not quite true, they're used a lot in the VectorSpace stuff, but that's mostly for upcasting, so I give myself a pass on that.

Antony Courtney

unread,
Mar 11, 2015, 9:46:36 PM3/11/15
to scala-...@googlegroups.com
D'oh!  Yes, that was it -- I simply had no idea that the (C) and (O) indicators were clickable in ScalaDoc!

Thank you very much for taking the time to offer such a thoughtful reply and helpful suggestions -- very much appreciated.

Best,

   -Antony 
Reply all
Reply to author
Forward
0 new messages