How to resolve the algorithm Reduced row echelon form step by step in the Wren programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Reduced row echelon form step by step in the Wren programming language

Table of Contents

Problem Statement

Show how to compute the reduced row echelon form (a.k.a. row canonical form) of a matrix. The matrix can be stored in any datatype that is convenient (for most languages, this will probably be a two-dimensional array). Built-in functions or this pseudocode (from Wikipedia) may be used: For testing purposes, the RREF of this matrix: is:

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Reduced row echelon form step by step in the Wren programming language

Source code in the wren programming language

import "/matrix" for Matrix
import "/fmt" for Fmt

var m = Matrix.new([
    [ 1,  2,  -1,  -4],
    [ 2,  3,  -1, -11],
    [-2,  0,  -3,  22]
])

System.print("Original:\n")
Fmt.mprint(m, 3, 0)
System.print("\nRREF:\n")
m.toReducedRowEchelonForm
Fmt.mprint(m, 3, 0)

  

You may also check:How to resolve the algorithm Pierpont primes step by step in the Ruby programming language
You may also check:How to resolve the algorithm Product of min and max prime factors step by step in the Arturo programming language
You may also check:How to resolve the algorithm Abundant, deficient and perfect number classifications step by step in the XPL0 programming language
You may also check:How to resolve the algorithm Even or odd step by step in the ALGOL-M programming language
You may also check:How to resolve the algorithm Magic squares of odd order step by step in the Delphi programming language