Thank you, Ralf,

On Wednesday, July 5, 2023 at 6:39:16 PM UTC+8 [email protected] wrote:

Hi, and welcome to FriCAS! 

On 05.07.23 11:56, 张志雄 wrote: 
> It seems there are functions to do row operations as described in below 
> url: https://fricas.github.io/api/LinearMultivariateMatrixPencil.html 

The functions description is correct, you are just not using it the way 
it is supposed to be used. 

> But it shows error when i try to use them as below: 
> 
> -> C := matrix[[1,2],[3,4]] 
> -> addrows!(C,1,2,-3) 
> 
> There are no library operations named addrows! 
> Use HyperDoc Browse or issue 
> )what op addrows! 
> to learn if there is any operation containing " addrows! " in its 
> name. 
> 
> Cannot find a definition or applicable library operation named addrows! 
> with argument type(s) 
> Matrix(Integer) 
> PositiveInteger 
> PositiveInteger 
> Integer 
> 
> Perhaps you should use "@" to indicate the required return type, 
> or "$" to specify which version of the function you need. 

FriCAS is working as expected here, but maybe not the way you expected 
it. Note that it says that it cannot fine a function addRows! that has 
(in particular) Matrix(Integer) as its first argument type. The type on 
the above website lists % as the type of the first argument. So this is 
what you will have to provide. 

I had to look up myself how this can actually be done. Strangely this 
domain seems to be rather cumbersome to work with, at least for the 
creation of a pencil. Maybe we should add a function that can coerce a 
list of matrices into the pencil domain. 

Hopefully, the following will enable you to go further. Otherwise, pose 
the actual problem you want to solve. 

I am tring to teaching linear algebra using friCAS.
I want to show how to get the rank of a matrix in a more detailed way 
although there is a function rank. 
I have run this tow lines with the same message:  There are no exposed 
library operations named qnew having 3
      argument(s) though there are 1 unexposed operation(s) with 
3 argument(s).

(3) -> PEN==>LinearMultivariateMatrixPencil(Integer) 

(9) -> r:=4; c:=3; l:=2; pen := qnew(r, c, l)

 



+0 0 0+ +0 0 0+ 
| | | | 
|0 0 0| |0 0 0| 
(9) [| |, | |] 
|0 0 0| |0 0 0| 
| | | | 
+0 0 0+ +0 0 0+ 
Type: LinearMultivariateMatrixPencil(Integer) 
(10) -> for i in 1..r repeat for j in 1..c repeat for k in 1..l repeat 
pen(i,j,k) := random(10) 
Type: Void 
(11) -> pen 

+6 5 3+ +9 1 5+ 
| | | | 
|4 7 9| |0 4 1| 
(11) [| |, | |] 
|1 7 8| |3 2 9| 
| | | | 
+1 9 0+ +7 8 5+ 
Type: LinearMultivariateMatrixPencil(Integer) 
(12) -> addRows!(pen,2,1,2) 

+14 19 21+ +9 9 7+ 
| | | | 
|4 7 9 | |0 4 1| 
(12) [| |, | |] 
|1 7 8 | |3 2 9| 
| | | | 
+1 9 0 + +7 8 5+ 
Type: LinearMultivariateMatrixPencil(Integer) 

Ralf


Sky 

-- 
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/91e9dcba-5493-4d41-8ddf-6a8b3120012en%40googlegroups.com.

Reply via email to