On 23.11.21 21:47, Sid Andal wrote:
> When I try to run the code from the attachment I get the following
> error:
Oh, I am sorry. My editor still held an unsaved version.
> seems to be working with the following line:
>
> fricas -nosman < file.input > /dev/null
>
> then the file.out contains only the solutions and the extra stuff
> (system msgs) go /dev/null.
You should understand, that output is completely done via fricas' write!
command.
What comes out of
fricas -nosman < file.input
goes to stdout or to /dev/null when you redirect it. But the latter is
completely irrelevant to file.out UNLESS you redirect to file.out.
Ralf
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/fricas-devel/402b18d3-fbb3-a933-9037-f1d77e150873%40hemmecke.org.
-- Although InnerPrimeField does what you want, you should know that
-- constructor names starting with Inner... are intended for internal
-- (i.e. for developers) use only.
-- As ordinary user you should rather rely on PrimeField or be aware
-- that and Inner... constructor may disappear from a future version
-- or slightly change its behaviour.
F := PrimeField 19;
Z ==> Integer
LZ ==> List Z
wsol(f: File List F, a: List LZ , b: LZ): Void() == (_
x := (solve(a :: SquareMatrix(4, F), b::Vector(F))).particular;_
write!(f, if x case "failed" then vector [0,0,0,0] else x::Vector(F)))
fp : File List F := open("file.out", "output");
wsol(fp, [[1,13,14,15],[1,11,18,4],[1,14,10,4],[1,6,17,16]], [13,8,6,14]);
wsol(fp, [[17,13,14,15],[17,11,18,4],[17,14,10,4],[17,6,17,16]], [13,8,6,14]);
wsol(fp, [[2,13,0,7],[15,7,6,13],[11,0,14,2],[12,3,2,10]], [15,15,4,12]);
wsol(fp, [[14,3,12,15],[11,15,0,14],[17,16,1,13],[4,5,15,17]], [10,10,12,6]);
wsol(fp, [[3,8,10,2],[8,14,16,0],[9,5,12,14],[5,2,1,5]], [15,8,11,3]);
close! (fp);