How to resolve the algorithm Element-wise operations step by step in the PARI/GP programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Element-wise operations step by step in the PARI/GP programming language
Table of Contents
Problem Statement
This task is similar to:
Implement basic element-wise matrix-matrix and scalar-matrix operations, which can be referred to in other, higher-order tasks. Implement:
Extend the task if necessary to include additional basic operations, which should not require their own specialised task.
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Element-wise operations step by step in the PARI/GP programming language
Source code in the pari/gp programming language
multMM(A,B)=matrix(#A[,1],#A,i,j,A[i,j]*B[i,j]);
divMM(A,B)=matrix(#A[,1],#A,i,j,A[i,j]/B[i,j]);
powMM(A,B)=matrix(#A[,1],#A,i,j,A[i,j]^B[i,j]);
addMs(A,s)=A+matrix(#A[,1],#A,i,j,s);
subMs(A,s)=A-matrix(#A[,1],#A,i,j,s);
powMs(A,s)=matrix(#A[,1],#A,i,j,A[i,j]^s);
You may also check:How to resolve the algorithm Word wrap step by step in the Run BASIC programming language
You may also check:How to resolve the algorithm Extend your language step by step in the langur programming language
You may also check:How to resolve the algorithm Polynomial long division step by step in the zkl programming language
You may also check:How to resolve the algorithm Sorting algorithms/Quicksort step by step in the Forth programming language
You may also check:How to resolve the algorithm Möbius function step by step in the Factor programming language