Showing posts with label data. Show all posts
Showing posts with label data. Show all posts

Sunday, July 3, 2022

Casio fx-CG50: Sparse Matrix Builder

Casio fx-CG50: Sparse Matrix Builder



Introduction


The programs can create a sparse matrix, a matrix where most of the entries have zero value.  There are several ways to represent sparse matrix in a shortcut form.  The most straight forward way is the COO (row-column-value) representation.


Mat A:  three column matrix:  (row-column-value representation)

Column 1:  row number

Column 2:  column number

Column 3:  value


Mat S:  sparse matrix


Casio fx-CG 50 Program:  SPARSE

[ [ row, column, value ] ... ] → sparse matrix


"TO SPARSE MATRIX"

"EDWARD SHORE"

"[[ROW,COL,VALUE]]"

"MAT"?→Mat A

Mat→List(Mat A,1)→List 26

Max(List 26)→R

Mat→List(Mat A,2)→List 26

Max(List 26)→C

{R,C}→Dim Mat S

Dim Mat A→List 26

List 26[1]→N

For 1→I To N

Mat A[I,1]→J

Mat A[I,2]→K

Mat A[I,3]→Mat S[J,K]

Next 

"SPARSE MATRIX:"⊿

Mat S


Casio fx-CG 50 Program: ISPARSE

sparse matrix → [ [ row, column, value ] ... ] 


"INV SPARSE MATRIX"

"EDWARD SHORE"

"SPARSE"?→Mat S

Dim Mat S→List 26

List 26[1]→R

List 26[2]→C

0→N

For 1→I To R

For 1→J To C

Mat S[I,J] →V

[[I][J][V]]→Mat Z

(V≠0 And N=0)⇒Mat Z→Mat A

(V≠0 And N>0)⇒Augment(Mat A,Mat Z)→Mat A

(V≠0)⇒1+N→N

Next

Next

"COO FORMAT:"⊿

Trn Mat A→Mat A


Example


Example 1:


Row/Column/Value (COO) Format:  (Mat A)


[ [ 1, 2, 8 ]

[ 2, 4, -3 ]

[ 3, 1, 2 ]

[ 3, 3, 6 ]

[ 4, 2, -1 ] ]


Sparse Matrix:  (Mat S)


[ [ 0, 8, 0, 0 ]

[ 0, 0, 0, -3 ]

[ 2, 0, 6, 0 ]

[ 0, -1, 0, 0 ] ]


Example 2:


Row/Column/Value (COO) Format:  (Mat A)


[ [ 1, 2, 1 ]

[ 1, 3, 2 ]

[ 2, 1, -1 ]

[ 2, 3, 3 ]

[ 3, 3, 4 ]

[ 4, 1, 5 ] ]


Sparse Matrix:  (Mat S)


[ [ 0, 1, 2 ] 

[-1, 0, 3 ] 

[ 0, 0, 4 ]

[ 5, 0, 0 ] ]


Source:


"Sparse matrix"  Wikipedia. Last edited March 11, 2022.  Accessed May 9, 2022.  https://en.wikipedia.org/wiki/Sparse_matrix


Eddie


All original content copyright, © 2011-2022.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Sunday, June 2, 2019

TI-Nspire Survival Guide

TI-Nspire Survival Guide









With both the TI-Nspire CX II and the TI-Nspire CX II CAS here, there is a renewed interest in the TI-Nspire.  To be honest, I have not used the TI-Nspire CX in quite while, so I had to re-learn some of the basics of the calculator.

The TI-Nspire calculators operates like a computer, with files, folders, documents, and each file containing a set of problems.

I put together a tns (TI-Nspire) documents, TI-Nspire Guide, available for download.  This document is for both the non-CAS and CAS version.  Hopefully, this document provides help with learning some of the basics for the TI-NSpire.

Problems (Table of Contents):

1.  Calculator Basics
2.  Programming functions to use anywhere (public functions)
3.  Graphing
4.  Data and Statistics
5.  Geometry
6.  Other Functions

 Link:  https://drive.google.com/open?id=15XolSFnCFLkj6pPm446PTdvpmVJfwcfw

Eddie

All original content copyright, © 2011-2019.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.

Symmetric Quartic Equation - Python

Symmetric Quartic Equation - Python Note: The code is programmed with a TI-84 Evo. No modules are used, so the scripts should be adopt...