LinearAlgebra[Modular] - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Linear Algebra : LinearAlgebra Package : Modular Subpackage : LinearAlgebra/Modular/ForwardSubstitute

LinearAlgebra[Modular]

  

ForwardSubstitute

  

apply in-place forward substitution from a lower triangular mod m Matrix to a mod m Matrix or Vector

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

ForwardSubstitute(m, A, B, diagflag)

Parameters

m

-

modulus

A

-

mod m lower triangular Matrix

B

-

mod m Matrix or Vector to which to apply forward substitution

diagflag

-

boolean; indicate whether to assume diagonal entries are 1

Description

• 

The ForwardSubstitute function applies the forward substitution described by the lower triangular part of the square mod m Matrix A to the mod m Matrix or Vector B.

  

Note: It is assumed that A is in lower triangular form, or that only the lower triangular part is relevant and the upper triangular part of A is completely ignored.

  

The mod m Matrix or Vector B must have the same number of rows as there are columns of A.

• 

Application of forward substitution requires that m is prime, but in some cases it can be computed if m is composite. If it cannot be computed for m composite, an error message is returned.

• 

The diagflag parameter is a boolean that indicates if the diagonal of the lower triangular Matrix is considered to be the identity (true), or used in the forward substitution (false). This option is most useful when applying forward substitution from a compact LU decomposition (see LUDecomposition), where the diagonal of the lower triangular factor is the identity, and is not explicitly stored.

• 

The ForwardSubstitute function is used as one of the steps in the LUApply function.

• 

This command is part of the LinearAlgebra[Modular] package, so it can be used in the form ForwardSubstitute(..) only after executing the command with(LinearAlgebra[Modular]).  However, it can always be used in the form LinearAlgebra[Modular][ForwardSubstitute](..).

Examples

Construct and solve a lower triangular system.

withLinearAlgebra[Modular]:

p97

p:=97

(1)

AModp,Matrix4,4,i,j→ifjithenrandelse0end if,integer[]:

BModp,Matrix4,2,i,j→rand,integer[]:

A,B

77000961000865836080224439,603943125522471

(2)

XCopyp,B:

ForwardSubstitutep,A,X,false:

X

943248275349458

(3)

Multiplyp,A,XB

00000000

(4)

Lower triangular system with assumed diagonal of 1.

p97

p:=97

(5)

AModp&comma;Matrix4&comma;4&comma;i&comma;j&rarr;ifj<ithenrandelse0end if&comma;float&lsqb;8&rsqb;&colon;

BModp&comma;Vector&lsqb;column&rsqb;4&comma;i&rarr;rand&comma;float&lsqb;8&rsqb;&colon;

A&comma;B

0.0.0.0.45.0.0.0.29.21.0.0.48.7.33.0.&comma;57.65.16.93.

(6)

XCopyp&comma;B&colon;

ForwardSubstitutep&comma;A&comma;X&comma;true&colon;

X

57.22.35.25.

(7)

AddMultiplep&comma;Multiplyp&comma;A&comma;X&comma;XB

0.0.0.0.

(8)

See Also

LinearAlgebra/Details

LinearAlgebra[Modular]

LinearAlgebra[Modular][AddMultiple]

LinearAlgebra[Modular][BackwardSubstitute]

LinearAlgebra[Modular][Copy]

LinearAlgebra[Modular][LUApply]

LinearAlgebra[Modular][LUDecomposition]

LinearAlgebra[Modular][Mod]

LinearAlgebra[Modular][Multiply]

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam