Type of Matrix (C.Basic)

 Type of Matrix
<C.Basic>

This content is checked by fx-9860GII (OS 2.04).
This is on-going project, any changes may be made.


Model

fx-9860G Series


Description

i. C.Basic provides deferent type of matrix; a bit integer type, a byte integer (8bit) type, a word integer (16bit) type, a long integer (32bit) type and a double real number (64bit) type. 


ii. Those smaller bit type of matrix helps to save allocated memory size. This feature gives faster matrix access, handling bitmap data and direct access to VRAM.


Syntax

1. Mat A.p / Mat A.P defines as a bit type (1 bit)
2. Mat A.v / Mat A.V defines as a bit type for direct access to VRAM (1 bit)
3. Mat A.b / Mat A.B defines as a byte type (8 bit, byte integer)
4. Mat A.w / Mat A.W defines as a word type (16 bit, word integer)
5. Mat A.l / Mat A.L defines as a long type (32 bit, long integer)
6. Mat A.f / Mat A.F defines as a double-precision real number type (64 bit, double real) 

* Elements of each matrix is defined as the above type.


Function
  1. Definition of matrix type is available at matric allocation.
  2. Definition of matrix type is also available at initialization. User can change the matrix type which is once allocated or initialized in deferent type of matrix (see Example 1).
  3. Excepting a bit type, all other type of matrix Mat A[m,n] is Mat A[<row>,<column>]
  4. A bit type matrix is designed to handle bitmap, then the matrix is Mat A[X,Y] = Mat A[<coloum>,<row>] (see Example 2).
  5. Mat A.v / Mat A.V is a special matrix that directly reflect VRAM bitmap (see Example 2).

Note

Example 1

    [[1,2,3,4][5,6,7,8]]→Mat A.b
    Locate 1,1,ElmSize(A)
    Mat A→Dim Mat A.w
    Locate 1,2,ElmSize(A) 

This code display as follows;

    8
    16

The third line it to change matrix type.

ElmSize( )
returns bit size of elements. Defined by Mat A.b, a bit size of the elements is 8 bit. Transferring the matrix type from byte type to word type, the bit size of the elements is 16 bit. 


Example 2

    ClrGraph
    For -1→Y To 1 Step 0.1
        PlotOn 0,Y
    Next
    {127,63}→Dim Mat A.v
    0→P
    For 1→Y To 63
        For 1→X To 127
            P+A[X,Y]→P
        Next
    Next
    Locate 1,1,P


This code display as follows;

    21

{127,63}→Dim Mat A.v sets bitmap data of VRAM in Mat A. When a graphics command is processed automatically the VRAM bitmap reflected to the Mat A.

This code draws 21 dots at first then define Mat A.v. At this time the Mat A is directly reflected to bitmap data of VRAM. An element of the Mat A is 0 or 1, 

After allocating the Mat A, interestingly this matrix has already bitmap data of VRAM. Then calculating summary of all the elements should be a number of drawn dots. The dysplayed result shows the number of total drawn dots is 21.


Example 3

Exampl 2 is a sample to read out VRAM bitmap data. This Example 3 is to reflect VRAM bitmap data to LCD screen.

    ClrGraph
    Screen.G
    {127,63}→Dim Mat A.v
    For 53→X To 73
        1→A[X,31]
    Next
    PutDispDD

Before running a graphics drawing command, automatically text screen is selected, then swap to graphics screen by Screen.G. Mat A is allocated after ClirGraph then every element of the matrix is 0. Following code sets 21 pixels to 1. PutDispDD command transfers the VRAM data to LCD screen.
 



See also: ElmSize( ), PutDispDD, Screen

Copyright (C) 2013 - 2016 Krtyski / egadget.blog.fc2.com  All Rights Reserved.


関連記事

テーマ : プログラム関数電卓
ジャンル : コンピュータ

コメントの投稿

非公開コメント

最新記事
最新コメント
カテゴリ
C# (3)
検索フォーム
Visitors
Online Counter
現在の閲覧者数:
プロフィール

やす (Krtyski)

Author:やす (Krtyski)
since Oct 30, 2013


プログラム関数電卓は、プログラムを作り・使ってナンボ!

実際に触って気づいたこと、自作プログラム、電卓プログラミングについて書いています

おもしろい・役に立つならクリックしてください。励みになります。
にほんブログ村 IT技術ブログ 開発言語へ
にほんブログ村


人気ブログランキングへ


FC2ブログランキングへ


写真: 「4駆で泥んこ遊び@オックスフォード郊外」

リンク
月別アーカイブ
Sitemap

全ての記事を表示する

RSSリンクの表示
最新トラックバック
ブロとも申請フォーム

この人とブロともになる

QRコード
QR