import qualified Algebra.Ring as Ring ( C )
import qualified Algebra.Algebraic as Algebraic ( C )
import Control.Arrow ( first )
-import Data.Vector.Fixed ( N1, S, ifoldl )
+import Data.Vector.Fixed ( S, ifoldl )
import Data.Vector.Fixed.Cont ( Arity )
import NumericPrelude hiding ( (*) )
-- Examples:
--
-- >>> import Linear.Matrix ( Col2, Col3, Mat2, Mat3 )
--- >>> import Linear.Matrix ( frobenius_norm, fromList, identity_matrix )
+-- >>> import Linear.Matrix ( column', frobenius_norm, fromList )
+-- >>> import Linear.Matrix ( identity_matrix, vec3d )
+-- >>> import Normed ( Normed(..) )
--
-- >>> let m = identity_matrix :: Mat3 Double
-- >>> let (vals, vecs) = eigenvectors_symmetric 100 m
-- >>> let expected_vals = fromList [[8],[-1],[-1]] :: Col3 Double
-- >>> let v0' = vec3d (2, 1, 2) :: Col3 Double
-- >>> let v0 = (1 / (norm v0') :: Double) *> v0'
--- >>> let v1' = vec3d (1, -2, 0) :: Col3 Double
+-- >>> let v1' = vec3d (-1, 2, 0) :: Col3 Double
-- >>> let v1 = (1 / (norm v1') :: Double) *> v1'
--- >>> let v2' = vec3d (4, 2, 5) :: Col3 Double
+-- >>> let v2' = vec3d (-4, -2, 5) :: Col3 Double
-- >>> let v2 = (1 / (norm v2') :: Double) *> v2'
--- >>> frobenius_norm (vals - expected_vals)
+-- >>> frobenius_norm ((column' vecs 0) - v0) < 1e-12
+-- True
+-- >>> frobenius_norm ((column' vecs 1) - v1) < 1e-12
+-- True
+-- >>> frobenius_norm ((column' vecs 2) - v2) < 1e-12
+-- True
--
eigenvectors_symmetric :: forall m a. (Arity m, Algebraic.C a, Eq a)
=> Int