solve.particular

8 views

Sid Andal

Dec 1, 2021, 2:25:09 PM12/1/21
to FriCAS - computer algebra system

The following file contains:

**** mysolv.input ****

F := PF 13

VF ==> Vector F
LZ ==> List Integer

fsol(a: List LZ, b: LZ): LZ ==_
x := solve(a :: SquareMatrix(3, F), b :: VF).particular
if x case VF then x :: LZ else [0,0,0] :: LZ

**** End of mysolv.input

The following run outputs an error:

(1) -> )r mysolv
F := PF 13

(1)  PrimeField(13)

VF ==> Vector F

LZ ==> List Integer

fsol(a: List LZ, b: LZ): LZ ==_
x := solve(a :: SquareMatrix(3, F), b :: VF).particular
if x case VF then x :: LZ else [0,0,0] :: LZ

Function declaration fsol : (List(List(Integer)), List(Integer)) ->
List(Integer) has been added to workspace.
(5) ->
(5) -> fsol([[1,2,3],[5,7,9],[11,2,8]],[4,0,3])

case is only used for Unions and the object on the left-hand side
does not belong to a union.

(5) ->

Isn't solve.particular of Union type?

Bill Page

Dec 2, 2021, 12:39:38 PM12/2/21
Do not use _ at the end of the first line.

fsol(a: List LZ, b: LZ): LZ ==
x := solve(a :: SquareMatrix(3, F), b :: VF).particular
if x case VF then x :: LZ else [0,0,0] :: LZ
--
You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel...@googlegroups.com.

Grégory Vanuxem

Dec 2, 2021, 1:51:50 PM12/2/21