sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.38k stars 469 forks source link

numerical_approx broken for vectors #12195

Closed robertwb closed 12 years ago

robertwb commented 12 years ago

1294 implemented n() but not N() or the functional numerical_approx

Apply:

  1. attachment: trac_12195-numerical-approx-v3.patch

CC: @rbeezer @jasongrout

Component: linear algebra

Keywords: sd40.5

Author: Robert Bradshaw, Rob Beezer, William Stein

Reviewer: Rob Beezer, William Stein, Dan Drake

Merged: sage-5.1.beta4

Issue created by migration from https://trac.sagemath.org/ticket/12195

robertwb commented 12 years ago

Attachment: 12195-numerical_approx.patch.gz

robertwb commented 12 years ago

Description changed:

--- 
+++ 
@@ -1 +1 @@
-#1294 implemented {{n()}} but not {{N()}} or the functional {{numerical_approx}}
+#1294 implemented `n()` but not `N()` or the functional `numerical_approx`
1d7ec08f-60ae-4512-91a6-8324c06eab9f commented 12 years ago
comment:3

Robert,

Looks good, and very welcome. I should have noticed, and fixed, this omission during my big push last year. Looks ready for a positive review, but I have two questions.

  1. Could this make the .n() method (immediate prior in source) obsolete?

  2. This does not seem to show up explicitly anywhere in the documentation. Doing v.N? on an integer vector v seems to just give the generic documentation for a numerical approximation to a single scalar. For matrices, the approach is different. A bit more code, and not overriding the scalar method: Plus: explicit documentation. Minus: duplication of code, including a really bad approximation of log 10 as discussed recently on sage-devel.

A suggestion - add a doctest in this patch for the generic method exhibiting application to vectors. If that's agreeable, I'll make a ticket to have matrices follow the model of this ticket (and maybe even do it).

Rob

williamstein commented 12 years ago

Changed keywords from none to sd40.5

williamstein commented 12 years ago

Author: robertwb

williamstein commented 12 years ago

Reviewer: Rob Beezer, William Stein

williamstein commented 12 years ago
comment:5

This clearly needs work. Rob's point about there being an n method right before is serious. That should be deleted, and was the result of somebody not understanding the architecture of N...

williamstein commented 12 years ago

I fixed the patch by deleting the n function before. Looks great!

williamstein commented 12 years ago
comment:6

Attachment: 12195-numerical_approx.2.patch.gz

apply only: 12195-numerical_approx.2.patch

1d7ec08f-60ae-4512-91a6-8324c06eab9f commented 12 years ago

Attachment: trac_12195-numerical-approx-v3.patch.gz

1d7ec08f-60ae-4512-91a6-8324c06eab9f commented 12 years ago

Changed author from robertwb to Robert Bradshaw, Rob Beezer, William Stein

1d7ec08f-60ae-4512-91a6-8324c06eab9f commented 12 years ago

Description changed:

--- 
+++ 
@@ -1 +1,4 @@
 #1294 implemented `n()` but not `N()` or the functional `numerical_approx`
+
+**Apply:**
+1.  [attachment: trac_12195-numerical-approx-v3.patch](https://github.com/sagemath/sage-prod/files/10654368/trac_12195-numerical-approx-v3.patch.gz)
1d7ec08f-60ae-4512-91a6-8324c06eab9f commented 12 years ago
comment:7
jdemeyer commented 12 years ago

Merged: sage-5.1.beta4