[ 
https://issues.apache.org/jira/browse/MAHOUT-1532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13990939#comment-13990939
 ] 

Dmitriy Lyubimov commented on MAHOUT-1532:
------------------------------------------

assuming tests are passing, seems fine. few minor non-binding suggestions 

Scalatest has been experiencing some evolution (e.g. see MathSuite.scala). I 
guess more "fashionable" style to write this 

{code}
   assert(abs(1 - identity(0, 0)) < 1e-10)
   assert(abs(0 - identity(0, 1)) < 1e-10)
   assert(abs(0 - identity(1, 0)) < 1e-10)
   assert(abs(1 - identity(1, 1)) < 1e-10)  
{code}

 these days is something like this : 

{code}
  val control = eye(identity.ncol)
  (control - identity).norm should be < 1e-10
{code}


also this 

{code}
  test("solve rejects non-square matrix") {
+    try {
+      val a = dense((1, 2, 3), (4, 5, 6))
+      val b = dvec(1, 2)
+      solve(a, b)
+      fail("IllegalArgumentException expected")
+    } catch {
+      case e: IllegalArgumentException =>
+      case _: Throwable => fail("unexpected throwable encountered")
+    }
+  }
{code}

these days is more fashionable as this 
{code}
test(...) { 
 intercept[IllegalArgumentException] {
... 
  }
   
}
{code}

> Add solve() function to the Scala DSL 
> --------------------------------------
>
>                 Key: MAHOUT-1532
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-1532
>             Project: Mahout
>          Issue Type: Bug
>          Components: Math
>            Reporter: Sebastian Schelter
>             Fix For: 1.0
>
>         Attachments: MAHOUT-1532.patch, MAHOUT-1532.patch
>
>
> We should add a solve() function to the Scala DSL with helps with solving Ax 
> = b for in-core matrices and vectors.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to