Re: positive definite matrix predicate

Tim Daly <[email protected]> Mon, 28 Dec 2009 17:17:01 -0500
Newsgroups gmane.comp.mathematics.axiom.user
Message-ID <[email protected]>
Konstantin L. Metlov wrote:
> I think I found an answer within Axiom itself:
>
> (1) -> sqrt(-1.0)
>  1) ->
>    >> Error detected within library code:
>    negative sqrt
>
> This is, probably, what I should do. It was really a question of how to fail: 
> at type conversion or during the computation itself. This example shows that 
> in the case of Float Axiom fails during the computation. My computation will 
> involve floats and is similar to this example. This way to fail is simple and 
> makes it unnecessary to define categories. I should, probably, simply add 
> predicates to SquareMatrixCategory to test for hermitiannes (symmetricity, if 
> its real) and positive definiteness to avoid duplicate code in future.
>
> On the other hand:
>
> (1) -> sqrt(-1)
> (1) ->
>          +---+
>    (1)  \|- 1
>                                                         Type: AlgebraicNumber
>
> (2) -> sqrt(-1)::Complex(Float)
> (2) ->
>    (2)  %i
>                                                           Type: Complex Float
>
> Shouldn't it be consistent with the former ?
>
> With the best regards,
>                            Konstantin.
>
>
> _______________________________________________
> Axiom-mail mailing list
> [email protected]
> http://lists.nongnu.org/mailman/listinfo/axiom-mail
>
>   
It is consistent with the former. The domain Float does not include the
result %i so it is an error. The other domains include the result.

Tim