Implicit def extDouble(d:Double) = new ExtDouble(d)ĭef gradient(f: (Double)=>Double, epsilon: Double) : (Double) => Double = * we use these two lines to add an implicit exponentiation shortcutĬlass ExtDouble(d:Double) ![]() The function that does the grading approximation receives another function as a first-class parameter: Here is one way to do it in Scala using functional programming concepts. We can do so by simply implementing the general formula for a derivative: Let’s consider we want to implement a function that approximates the derivative of any arbitrary differentiable function. What better way to illustrate the basic similarities (and differences) between Scala and Octave than with an example. Using that synergy I was able to delve into Octave’s basic syntax for functional programming. Given my unfamiliarity with Octave, I ended up prototyping and verifying my algorithms in Scala and then porting them into Octave. ![]() The Machine Language course used GNU Octave, a Matlab-like language for statistical and numerical computation. I did get a lot of learning done with the Scala and Machine Learning courses. ![]() Time to catch up and move on to the next plate challenge thingie. The parallel programming course is already a week in progress. In addition to that, two courses I’ve been waiting for a while (the U-Illinois’ Heterogeneous Parallel Programming and Stanford’s Algorithms 2 courses) have already started.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |