[go: up one dir, main page]

JPH0586579B2 - - Google Patents

Info

Publication number
JPH0586579B2
JPH0586579B2 JP61181701A JP18170186A JPH0586579B2 JP H0586579 B2 JPH0586579 B2 JP H0586579B2 JP 61181701 A JP61181701 A JP 61181701A JP 18170186 A JP18170186 A JP 18170186A JP H0586579 B2 JPH0586579 B2 JP H0586579B2
Authority
JP
Japan
Prior art keywords
data
matrix
stored
key
input
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP61181701A
Other languages
Japanese (ja)
Other versions
JPS6336475A (en
Inventor
Shoichi Kawai
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sharp Corp
Original Assignee
Sharp Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sharp Corp filed Critical Sharp Corp
Priority to JP61181701A priority Critical patent/JPS6336475A/en
Priority to DE8787108562T priority patent/DE3776598D1/en
Priority to EP87108562A priority patent/EP0253138B1/en
Publication of JPS6336475A publication Critical patent/JPS6336475A/en
Priority to US07/464,702 priority patent/US5043916A/en
Publication of JPH0586579B2 publication Critical patent/JPH0586579B2/ja
Granted legal-status Critical Current

Links

Landscapes

  • Calculators And Similar Devices (AREA)

Description

【発明の詳細な説明】[Detailed description of the invention]

産業上の利用分野 本発明は、元の行列からその転置行列を作成す
るための装置に関する。 従来の技術 従来、2次元の行列状の配列態様を有するデー
タ群を処理する、いわゆるポケツトコンピユータ
が用いられている。このようなポケツトコンピユ
ータにおいて、前記行列状のデータ群に関して転
置行列に対応する配列態様を有するデータ群を得
ようとする場合、典型的には以下のような技術が
用いられていた。 第1の従来技術では、前記行列状(以下、最大
列数C0、最大行数L0の行列を想定して説明する)
のデータ群を記憶する第1記憶素子に対して、少
なくとも同一記憶容量を有する第2記憶素子を準
備する。第1記憶素子に記憶されたデータ行列の
内、第i行第j列目(すなわち縦方向に上から第
i番日の行、横方向に左から第j番目の列)のデ
ータaij(i=1,2,…,C0;j=1,2,…,
L0)を、第2記憶素子の第j行第0列目の配置
位置に格納する。このようにして、第1記憶素子
に記憶されたデータ行列の転置行列に対応する配
列態様を有するデータ行列を、前記第2記憶素子
に得ることができる。 第2の従来技術では、行列状のデータ群を処理
するプログラムに関して、前記データ群の行方向
列および列方向列を処理する全てのステツプに、
行と列とを入替える処理を挿入する。 このような従来技術によつて、行列状ののデー
タ群に関して、その転置行列の配列態様のデータ
群を得ることができる。 発明が解決しようとする問題点 上述したような第1の従来技術では、このよう
な処理を行なう前記ポケツトコンピユータに装備
すべき記憶素子の記憶容量がむやみに増大してし
まい、構成が複雑になつてしまう。また、第2の
先行技術では、ポケツトコンピユータの動作を制
御するプログラムがむやみに複雑となつてしまう
などの問題点があつた。 本発明の目的は、上述の問題点を解決し、簡便
な構成によつて行列状のデータ群に関して、その
転置行列に対応する配列態様をデータ群を発生す
ることができる転置行列の作成装置を提供するこ
とである。 問題点を解決するための手段 本発明は、 (a) 最大列数C0、最大行数L0である元の行列を
構成する各行列要素を、各行を順次的にかつ行
方向に順次的に1次元データとして記憶する記
憶手段と、 (b) 前記記憶手段に記憶されている行列要素によ
つて構成される行列を表示する表示手段と、 (c) レジスタ31と、 (d) 第m行第n列の行列要素をレジスタ31に記
憶し、その第m行第n列の行列要素に対応する
第1の値aを、 a=(m−1)C0+n として求め、 次に第2の値a′を、 a′={(a−1)−[a−1/C0]C0}L0 +{[a−1/C0]+1} として求め、 第2の値a′に対応する記憶手段に記憶されて
いる行列要素と、レジスタ31に記憶してある
行列要素とを入れ替え、 その入れ替え後に、レジスタ31に記憶され
た行列要素に関して、第2の値a′を求めて記憶
手段に記憶されている第1の値aに対応する行
列要素とを入れ替え、このような入れ替える動
作をを繰り返して転置行列を構成する行列要素
を1次元データとして作成する転置行列作成手
段とを含むことを特徴とする転置行列の作成装
置である。 作 用 本発明に従えば、元の行列を最大列数C0、最
大行数L0であり、記憶手段に、その各行列要素
を、1次元データとして、各行毎に順次的に、行
方向(すなわち横方向)に順次的に記憶してお
き、レジスタ31は、元の行列の第m行(すなわ
ち上から第m番目)、第n列(すなわち左から第
n番目)の行列要素をレジスタ31に記憶し、そ
の第1の値aを求め、次にその第1の値aに基づ
いて第2の値a′を求め、この第2のの値a′に対応
する記憶手段に記憶されている行列要素と、レジ
スタ31に記憶してある行列要素とを入れ替え、 その入れ替えた後に、レジスタ31に記憶され
ている行列要素に関して、第1の値aを求めて第
2の値a′を求め、その第2の値a′に等しい元の行
列の第1の値aに対応する行列要素とを入れ替
え、このような入れ替える動作を繰返すことによ
つて転置行列を構成する行列要素を、1次元デー
タとして作成して記憶手段に記憶することができ
る。 実施例 第1図は本発明の一実施例のデータ処理装置で
ある、いわゆるポケツトコンピユータ(以下、計
算機と略称する)1の正面図であり、第2図は計
算機1の電気的構成を示すブロツク図である。第
1図および第2図を参照して、計算機1の構成に
ついて説明する。計算機1の前面板2の一隅に
は、表示手段であり、たとえば液晶表示素子
(LCD)などによつて実現される表示部4が設け
られる。表示部4は、たとえばマトリツクス駆動
形であつて、たとえば24桁の1行分の表示容量を
有している。 上記表示部4の近傍には、後述するような表の
作成時において項目名などの文字を入力する際に
用いられ、またいわゆる関数キーを兼ねる文字入
力キー群5と、いわゆるテンキーである数値入力
キー群6と、演算子(たとえば「÷」や「+」な
ど)指示キー群7と、カーソルキー群8などが配
置される。また表機能キー9は、後述するような
表データの作成機能を実現し、行指示キー10
は、後述するような2次元表データの作成時にお
いて、当該データ行列の入力すべき各行を選択す
る機能を有する。また列指示キー11は、同様に
データ行列の入力すべき列を指示する機能を有す
る。また入替キー12は、後述するように作成さ
れた表データに関して、当該データ行列の転置行
列に対応する配列態様のデータ行列を発生させる
機能を有する。 計算機1は、計算機1の各種データ処理を制御
する中央処理装置(以下、CPUと略称する)1
3を備える。CPU13には、キー入力バツフア
47を介して前述の文字入力キー群5などを含む
キー入力部14が接続され、また表示制御部15
を介して前記表示部4が接続される。表示制御部
15には、表示バツフア16が設けられており、
表示部4に表示すべきデータを一時的に記憶す
る。 またCPU13には、たとえばROM(リードオ
ンリメモリ)などによつて構成される固定記憶部
17と、たとえばRAM(ランダムアクセスメモ
リ)などによつて構成される記憶部18とが接続
される。固定記憶部17および記憶部18が、記
憶手段を構成する。 固定記憶部17は、計算機1が起動されたとき
に初期設定処理を制御するイニシヤルプログラム
を記憶するイニシヤルプログラム領域19と、計
算機1において用いられるたとえばBASICなど
の高級言語に関するインタプリタプログラムが記
憶されるインタプリタ領域20と、後述するよう
な表処理を行なうプログラムが記憶された表処理
プログラム領域21と、キー入力部14のキー操
作に伴つてCPU13に入力力されるキヤラクタ
コードデータから、当該コードに対応する表示キ
ヤラクタのドツトパターンを発生するプログラム
(以下、CGプログラムと略称する)が、記憶され
るCGプログラム領域22と、その他各種のシス
テムプログラムが記憶されるシステムプログラム
領域23とを含む。 また記憶部18には、計算機1の操作者が任意
に作成したBASICプログラムや、各種データな
どを記憶するユーザプログラム領域24と、後述
する表データを記憶する表データ領域25と、各
種のバツフア、カウンタまたはレジスタなどが割
付けられるシステム領域26とを含む。システム
領域26には、複数の表を識別する表題目に対応
するパラメータであるhカウンタ27と、各表の
列方向(縦方向)の位置すなわち、各行を識別す
るパラメータであるmカウンタ31と、行方向
(横方向)の各位置である各列を識別するパラメ
ータであるnカウンタ29とを含む。さらに表の
各データごとに設定される行/列の入替完了フラ
グの集合であるFレジスタ30と、この行/列の
入替処理に用いられるXレジスタ31と、C,
M,N,A,Bレジスタ33,34,35,3
6,37とがそれぞれ設定される。 第3図は表データ領域20の各種データの割付
態様を示す図である。表データ領域25は、ユー
ザプログラム領域24の一部分に割付けられ、そ
の各データは、後述の入力処理ごとに、または
BASICプログラムの変換データの割付け命令な
どによつて記憶され、表データが作成される。第
3図に示す表データ領域25のデータ例は、下記
の第1表に対応し、表データの各項目は、たとえ
ば16バイトの固定長で形成される。
FIELD OF INDUSTRIAL APPLICATION The present invention relates to a device for creating a transposed matrix from an original matrix. 2. Description of the Related Art Conventionally, so-called pocket computers have been used that process data groups having a two-dimensional matrix arrangement. In such a pocket computer, when attempting to obtain a data group having an arrangement pattern corresponding to a transposed matrix with respect to the matrix-like data group, the following technique is typically used. In the first conventional technique, the above-mentioned matrix form (hereinafter, explanation will be given assuming a matrix with a maximum number of columns C0 and a maximum number of rows L0)
A second storage element having at least the same storage capacity as the first storage element that stores a data group is prepared. Of the data matrix stored in the first storage element, data aij(i =1,2,…,C0;j=1,2,…,
L0) is stored in the j-th row and 0th column of the second storage element. In this way, a data matrix having an arrangement pattern corresponding to the transposed matrix of the data matrix stored in the first storage element can be obtained in the second storage element. In the second prior art, with respect to a program that processes a data group in a matrix, all steps for processing columns in the row direction and columns in the data group include:
Insert processing to swap rows and columns. With such a conventional technique, it is possible to obtain a data group in the arrangement form of a transposed matrix for a matrix-like data group. Problems to be Solved by the Invention In the first prior art as described above, the storage capacity of the storage element to be installed in the pocket computer that performs such processing increases unnecessarily, and the configuration becomes complicated. I end up. Further, the second prior art has problems such as the program for controlling the operation of the pocket computer becoming unnecessarily complicated. An object of the present invention is to solve the above-mentioned problems and to provide a transposed matrix creation device that can generate a data group with a matrix-like data group in an arrangement format corresponding to the transposed matrix using a simple configuration. It is to provide. Means for Solving the Problems The present invention provides the following methods: (a) Each matrix element constituting an original matrix having a maximum number of columns C0 and a maximum number of rows L0 is sequentially divided into 1 elements in each row in the row direction. (b) display means for displaying a matrix constituted by matrix elements stored in the storage means; (c) register 31; (d) m-th row The matrix elements of column n are stored in the register 31, the first value a corresponding to the matrix element of the mth row and nth column is determined as a=(m-1)C0+n, and then the second value a ' is obtained as a'={(a-1)-[a-1/C0]C0}L0+{[a-1/C0]+1} and stored in the storage means corresponding to the second value a'. The matrix element stored in the register 31 is exchanged with the matrix element stored in the register 31, and after the exchange, a second value a' is calculated for the matrix element stored in the register 31 and stored in the storage means. transposed matrix creation means for replacing the matrix element corresponding to the first value a and repeating such switching operation to create matrix elements constituting the transposed matrix as one-dimensional data. This is a matrix creation device. Effect According to the present invention, the original matrix has a maximum number of columns C0 and a maximum number of rows L0, and each matrix element is stored in the storage means as one-dimensional data in the row direction (i.e. The register 31 stores matrix elements in the m-th row (i.e., the m-th from the top) and the n-th column (i.e., the n-th from the left) of the original matrix in the register 31. The first value a is determined, the second value a' is determined based on the first value a, and the second value a' is stored in the storage means corresponding to the second value a'. Swap the matrix element with the matrix element stored in the register 31, and after the swap, calculate the first value a and the second value a' for the matrix element stored in the register 31, By exchanging the matrix elements corresponding to the first value a of the original matrix that is equal to the second value a' and repeating this operation, the matrix elements constituting the transposed matrix can be converted into one-dimensional data. can be created and stored in the storage means. Embodiment FIG. 1 is a front view of a so-called pocket computer (hereinafter referred to as a computer) 1, which is a data processing device according to an embodiment of the present invention, and FIG. 2 is a block diagram showing the electrical configuration of the computer 1. It is a diagram. The configuration of the computer 1 will be described with reference to FIGS. 1 and 2. At one corner of the front panel 2 of the computer 1, there is provided a display section 4 which is a display means and is realized by, for example, a liquid crystal display element (LCD). The display section 4 is, for example, a matrix drive type, and has a display capacity for one line of, for example, 24 digits. Near the display section 4, there is a character input key group 5, which is used to input characters such as item names when creating a table as described later, and which also serves as a so-called function key, and a numerical input key, which is a so-called numeric keypad. A key group 6, an operator (for example, "÷", "+", etc.) instruction key group 7, a cursor key group 8, and the like are arranged. Further, the table function key 9 realizes a table data creation function as described later, and the row direction key 10
has a function of selecting each row to be input in the data matrix when creating two-dimensional table data as described later. Similarly, the column designation key 11 has the function of designating the column to be input in the data matrix. Further, the replacement key 12 has a function of generating a data matrix in an arrangement format corresponding to a transposed matrix of the data matrix with respect to tabular data created as described later. The computer 1 includes a central processing unit (hereinafter abbreviated as CPU) 1 that controls various data processing of the computer 1.
Equipped with 3. A key input unit 14 including the aforementioned character input key group 5 is connected to the CPU 13 via a key input buffer 47, and a display control unit 15 is connected to the CPU 13.
The display section 4 is connected via the. The display control unit 15 is provided with a display buffer 16.
Data to be displayed on the display unit 4 is temporarily stored. Also connected to the CPU 13 are a fixed storage section 17 made up of, for example, a ROM (read only memory), and a storage section 18 made up of, for example, a RAM (random access memory). Fixed storage section 17 and storage section 18 constitute storage means. The fixed storage unit 17 includes an initial program area 19 that stores an initial program that controls initial setting processing when the computer 1 is started, and an interpreter program for a high-level language such as BASIC used in the computer 1. The code is extracted from an interpreter area 20, a table processing program area 21 in which a program for performing table processing as described later is stored, and character code data input to the CPU 13 in response to key operations in the key input unit 14. It includes a CG program area 22 in which a program (hereinafter abbreviated as CG program) for generating a dot pattern of a display character corresponding to the above is stored, and a system program area 23 in which various other system programs are stored. The storage unit 18 also includes a user program area 24 for storing BASIC programs and various data arbitrarily created by the operator of the computer 1, a table data area 25 for storing table data to be described later, and various buffers, It also includes a system area 26 to which counters, registers, etc. are allocated. The system area 26 includes an h counter 27 which is a parameter corresponding to the title for identifying a plurality of tables, an m counter 31 which is a parameter identifying the position in the column direction (vertical direction) of each table, that is, each row, It includes an n counter 29 which is a parameter for identifying each column which is each position in the row direction (horizontal direction). Furthermore, there is an F register 30 which is a set of row/column swapping completion flags set for each data in the table, an X register 31 used for this row/column swapping process, a C,
M, N, A, B registers 33, 34, 35, 3
6 and 37 are set, respectively. FIG. 3 is a diagram showing how various types of data are allocated in the table data area 20. The table data area 25 is allocated to a part of the user program area 24, and each data is stored for each input process described below or
It is stored by the conversion data allocation command of the BASIC program, and table data is created. The data example of the table data area 25 shown in FIG. 3 corresponds to the following table 1, and each item of the table data is formed with a fixed length of, for example, 16 bytes.

【表】 表データ領域25の最先頭アドレス側からは、
表の表題と各表の列項目名とが割付けられるスト
リング関数ThS|(C)と、列項目数(実際には列項
目数+1)の数値とが定義されて割付けられる定
義領域38が設定される。以下、Cレジスタ33
のカウント値Cをパラメータに、第1表に示す列
目名が、 T0S|(0)=“スウガク” …(1) のように記憶される列項目領域39a〜39eが
設定される。 引続き定義領域40が設定され、第1表の“ア
オキ”などの行項目名データが割付けられるスト
リング関数DhS|(L)が格納される。以下、カウン
ト値Lをパラメータとして行項目名領域41a,
41b,41c,…が設定され、それぞれたとえ
ば D0S|(0)=“アオキ” …(2) のように行項目名が記憶される。 引続き第1表の場合の点数に相当する入力デー
タが割付けられる数値関数Dh(m,n)が定義さ
れる定義領域42が設定され、引続きデータ領域
43a,43b,…が設定され、入力された各デ
ータがたとえば、 D0(0,0)=30 …(3) のように記憶される。これらのデータは入力処理
ごとに自動的に表データ領域25に割付けられ、
またBASIC言語の変数命令によつても割付けら
れる。またこれらの各データを読出すためのアク
セスは、前記定義領域38,40,42などに変
数名とともに、格納されている項目数によつて、
データ位置のアドレス値が演算される。 表データ領域25の領域44に示すデータは、
定義領域42において定義されるデータ行列の最
大列数C0(行方向、すなわち横方向の行列要素の
最大数)と、最大行数L0(列方向、すなわち縦方
向の行列要素の最大数)とによつて想定される領
域に、計算機1の操作による入力が行なわれてい
ない場合に割付けられるデータであり、、表デー
タ領域25の当該領域にこのデータがすべて格納
される。また領域45に示すデータは、データの
不存在を示すデータであり、第1図に示す欠測値
キー46を操作した際に格納される。 これらの数値データは、計算機1において用い
得る最大値/最大値の数値データであり、このよ
うな数値データを前記データの未入力/不存在を
示すために用いるのは以下の理由による。すなわ
ち、計算機1は、BASIC言語などに基づく特殊
コードを前記目的のために用いることもできるけ
れども、計算機1はBASIC言語などのプログラ
ム処理を可能にしており、そのため種々のコード
系を利用する。したがつてこのようなコード系に
可及的に制約を与えないようにするためである。。
またデータ処理において、計算機1のデータ処理
能力の最大値/最小値が発生することは殆どない
ことも挙げられる。 第4図は第1図示の計算機1の表の題名の入力
および列項目名の入力の手順を説明するフローチ
ヤートである。第1図〜第4図を参照して、本実
施例の動作について説明する。第4図ステツプa
1で、計算機1の表機能キー9を操作する。この
操作によつてステツプa2で、入力される複数の
表にそれぞれ付される番号を記憶するhレジスタ
27のカウント値hを、たとえば「0」に初期化
する。ステツプa3では、CPU13は、 “表タイトル”;h+1;“=?” のデータを、表示制御部15の表示バツフア16
に記憶し、表示部4に表示される。 ステツプa4では、計算機1のキー入力部14
からのキー入力を読込み、ステツプa5では、操
作されたキーがアルフアベツトや、カナなどを入
力する文字入力キー群5であるかどうかの判断を
行ない、否定であればステツプa6に移る。ステ
ツプa5の判断が肯定であれば、ステツプa7に
移り、前記キー入力されたキヤラクタコードがキ
ー入力バツフア47に取込まれ、さらにCGプロ
グラム領域22を用いて、当該コードをキヤラク
タパターンに展開し、ステツプa8で表示制御部
15に与え、表示部4に表示する。この後、再び
ステツプa4に処理は戻り、前述したステツプa
4〜a8を1サイクルとする処理を繰返し行な
う。このようにして、以降の処理で作成しようと
する表の題名「セイセキヒヨウ」が、キー入力バ
ツフア47に格納され表示部4に表示される。 前記ステツプa5で判断結果が否定であると
き、ステツプa6に移り、操作されたキーが列指
示キー11であるかどうかの判断を行なう。判断
結果が否定であれば、処理はステツプa9に移
り、肯定であればステツプa10に移る。ステツ
プa10では、前記ステツプa7においてデータ
が格納されたキー入力バツフア47の記憶内容
を、前記ストリング関数ThS|(C)(実際には、h
=0,C=0)に割付け格納させる。このステツ
プa10以降の処理は、列項目名の入力に移る。 前記ステツプa6における判断が否定であれ
ば、ステツプa9に移り、操作されたキーが表機
能キー9であるかどうかの判断を行なう。判断結
果が否定であれば処理はステツプa3に戻り、前
述したような処理を行なう。ステツプa9におけ
る判断が肯定であれば、処理はステツプa11に
移り、カウント値hがたとえば9であるかどうか
の判断が行なわれる。すなわち、本実施例の計算
機1では、たとえば9個の表を作成できる機能を
有する。この表の個数は、勿論9個以上であつて
もよいし、以下であつてもよい。 ステツプa11における判断が否定であれば、
計算機1はさらに表を作成できることになり、ス
テツプa12でカウント値hを+1インクリメン
トし、処理をステツプa3に戻す。ステツプa1
1における判断結果が肯定であれば、これ以上の
表の作成は不可能であり、ステツプa13でカウ
ント値hを「0」に初期化し、表示部4に第1番
目の表の題名を表示させ、処理はステツプa3に
戻る。 前記ステツプa10に引続く処理は、列項目名
の入力であり、ステツプa14で列項目番号を表
わすCレジスタ33のカウント値Cを、たとえば
「0」に初期化する。ステツプa15では、上記
ステツプa3と類似のフオーマツトで、列項目名
を問う表表示を表示部4に表示させる。ステツプ
a16では、計算機1のキー入力部14からのキ
ー入力を読込む。ステツプa17では、文字入力
キー群5が操作されたかどうかの判断を行ない、
否定であればステツプa18に移り、肯定であれ
ばステツプa19,a20に移り、前記ステツプ
a7,a8と同様に、入力されたキヤラクタコー
ドをキー入力バツフア47に記憶した後、表示部
4に表示する。これ以降の処理はステツプa16
に移る。 ステツプa17で判断が否定のとき、ステツプ
a18で列指示キー11が操作されたかどうかの
判断を行ない、否定であればステツプa16に戻
り、前述の処理を繰返し行なう。肯定であれば、
ステツプa20に移り、キー入力バツフア47の
記憶内容が空白であるかどうかの判断を行なう。
判断結果が否定であれば、処理はステツプa22
に移り、ストリング関数ThS|(C+1)に、ス
トリング関数ThS|(C)の割付内容を割付ける。そ
の後、ステツプa23では現在のキー入力バツフ
ア47の記憶内容を、ストリング関数ThS|(C)に
割付け記憶させる。この後、ステツプa24でカ
ウント値Cは+1インクリメントされ、処理は再
びステツプa15に戻る。 前記ステツプa22〜a24の処理を要約すれ
ば、列項目名の入力を行なうたびごとに、それま
で前記ストリング関数ごとに記憶されている表の
題名は、順次アドレスの増加する方に隣接するス
トリング関数に順送りに転送され、C=0に相当
するストリング関数ThS|(0)に、最新の列項
目名が割当てられる。 前記ステツプa21の判断が肯定であれば、文
字入力キー群5を操作することなしに、列指示キ
ー11を操作したことになり、すなわち列項目名
の入力が当該表においては終了したことを示し、
この後、処理は第5図に示す行項目名入力を行な
う処理に移る。 第5図は第4図のフローチヤートの処理に引続
き行なわれる行項目名入力の処理を説明するフロ
ーチヤートである。第1図〜第5図を参照して、
行項目名入力の手順について説明する。第5図ス
テツプb1では、行項目名に付される番号を表す
Cカウンタ33のカウント値Lがたとえば「0」
に初期化され、ステツプb2では、 “ギヨウコウモク”;L;“=?” のデータが表示部4に表示される。 引続くステツプb3では、キー入力部14から
のキー入力が読取られ、ステツプb4,b5では
文字入力キー群5が操作されたか、または行指示
キー10が操作されたかの判断をそれぞれ行な
う。共に操作されていなければ、ステツプb3に
戻つて再びキー入力の読取り動作を行なう。ステ
ツプb4で判断結果が肯定であれば、ステツプb
6,b7に順次移り、第4図示のステツプa7,
a8で説明した手順と同一の手順で、取込まれた
キヤラクタコードに対応するキヤラクタが表示部
4に表示される。 ステツプb4の判断が否定であれば、ステツプ
b5に移り、ステツプb5の判断が肯定であれ
ば、入力すべき表の一行項目名の入力は終了して
次行の行項目名の入力を要求していることにな
る。このとき処理はステツプb8に移り、キー入
力バツフア47の記憶内容が空白であるかどうか
の判断を行なう。判断が肯定であれば、行項目名
の入力は終了しており、後述する第6図に示す表
データの入力処理に移る。ステツプb8の判断が
否定であれば、処理はステツプb9に移り、現在
キー入力バツフア47の記憶内容をストリング関
数DhS|(L)に記憶し、続くステツプb10でカウ
ント値Lを+1インクリメントする。 続いて処理はステツプb2に戻り、新たな行項
目の入力を行なうかどうかの表示を表示部4に表
示する。ここで所望の行項目名の入力が終了して
いれば、再び行指定キー10を操作し、このとき
処理はステツプb4,b5を経てステツプb8に
移り、キー入力バツフア47の記憶内容が空白で
あることが判断される。第6図を参照して後述す
る表データ入力の処理モードに移る。 第6図は上記第1表に示す題名「セイセキヒヨ
ウ」の点数である数値データを入力する手順を説
明するフローチヤートである。第1図〜第6図を
参照して、データ入力手順について説明する。第
6図ステツプd1で、入力されるデータの列方向
位置と行方向位置とを示すmカウンタ28および
nカウンタ29のカウント値m,nおよび、表番
号を示すhレジスタのカウント値hをたとえば
「0」にそれぞれ初期化する。ステツプd2では、
第3図の定義領域42において定義される数値関
数Dh(m,n)(実際にはh=m=n=0)の第
3図に示すデータ領域43を行方向最大値C0お
よび列方向最大値L0についてL0×C0だけ確保
し、領域44に示すデータ未入力状態を表す数値
データを格納する。 次にステツプd3では、前述した列項目名およ
び行項目名をそれぞれ表すストリング関数ThS|
(C),DhS|(L)について、 DhS|(m);THS|(n);“=?” …(A) を表示部4に表示し、ステツプd4でキー入力部
14で操作されたキーを読込む。 ステツプd5,d6,d7では、得られたキー
入力が数値入力キー群6であるか、または入替キ
ー12であるか、または列指示キー11であるか
の判断をそれぞれ行なう。ステツプd5で判断が
肯定であれば、ステツプd8で入力された数値を
キー入力バツフア47に格納し、ステツプd9で
この数値を表示部4で表示する。このような数値
データの入力が終了すると、表示部4に表示され
ている表の第1行第1列に、たとえば“63”の表
示がなされることになる。 ステツプd5の判断が否定であり、ステツプd
6の判断が肯定すれば、当該表の数値データの入
力が終了し、後述するような行列入替処理を行な
うことを要求していることになり、ステツプd1
0で後述するこの処理を行ない、ステツプd4に
戻る。 ステツプd6の判断が否定であり、ステツプd
7の判断が肯定であれば、当該行のデータ入力に
おいて、一列データの入力が終了し、次列目の入
力を要求していることになり、処理はステツプd
11に移る。ステツプd11ではキー入力バツフ
ア47の記憶内容が、データ関数Dh(m,n)
(現時点ではh=m=n=0)に割付けられ、ス
テツプd12では、データが入力された表の列数
nが、前記ステツプd2で定めた最大列数(行方
向、すなわち横方向の行列要素の最大数であり、
後述の第2表の行列では、C0=3)になつてい
るかどうかを判断する。すなわち該行の全列に亘
るデータ入力が終了したかどうかを判断する。判
断結果が否定であれば、さらに次列目のデータ入
力が可能となり、ステツプd13で列数を示すカ
ウント値nを+1インクリメントし、処理をステ
ツプd3に戻す。 前記ステツプd12で判断結果が肯定であれ
ば、当該行の全列に亘るデータ入力が終了したこ
とになり、処理はステツプd14に移り、現在デ
ータ入力作業中の表の行数を表すカウント値m
が、前記ステツプd2で定めた最大行数L0(列方
向、すなわち縦方向の行列要素の最大数であり、
後述の第2表の行列では、L0=6)と等しいか
どうかを判断する。等しければデータ入力処理
は、終了する。等しくなければさらに次行目の入
力が可能であり、ステツプd15でカウント値m
を+1インクリメントし、処理を次行に進め、ス
テツプd16でカウント値nをたとえば「0」に
初期化し、当該行の第1列目の入力ができる状態
とする。このようにしたのち、処理はステツプd
3に戻される。 前記ステツプd7において、判断結果が否定で
あれば、操作者はデータの入力操作ではない操作
を行なつていることになり、処理はステツプd1
7,d18,d19,d20に順次的に移り、そ
れぞれ操作されたキーがカーソルキー群8のう
ち、右方キー48であるか、または下方キー49
であるか、または上方キー50であるか、または
左方キー51であるかをそれぞれ順次的に判断す
る。操作されたキーがカーソルキー群8でもない
場合、処理はステツプd4に戻される。 これらの判断処理ステツプd17〜d20にお
いて、それぞれ判断結果が肯定であれば、処理は
それぞれステツプd21,d22,d23,d2
4に移り、行方向(すなわち横方向)の列の位置
を示すカウント値nを+1インクリメントし、ま
た列方向(すなわち縦方向の行の位置を示すカウ
ント値mを+1インクリメントし、またこのカウ
ント値mを−1デクリメントし、前記カウント値
nを−1デクリメントする。これらステツプd2
1〜d24の処理は、表示部4においてカーソル
52を、カーソルキー群8によつて示される任意
の方向に移動させた表示を得るために行なわれ
る。 前記ステツプd21〜d24以降の処理は、共
通にステツプd25に移り、まず列数を表すカウ
ント値nが(C0+1)等しいかどうかの判断を
行なう。これは表示部4におけるカーソル52
が、現時点で表示される表を行方向に超えたかど
かの判断である。この判断が成立すれば、ステツ
プd26でカウント値nを−1デクリメントし、
カーソル52を表外に出さずステツプd27に移
る。前記ステツプd25の判断結が否定であれ
ば、ステツプd26の処理を行なうことなく、ス
テツプd27に移る。 ステツプd27では、入力中の表で表示部4の
カーソル52がこの表を列方向に超えた位置に表
示されるかどうかを判断する。判断結果が肯定で
あれば、ステツプd28でカウント値mを−1デ
クリメントし、カーソル52を表外に出さずステ
ツプd29に移る。前記判断が否定であれば、ス
テツプd28の処理を行なうことなく、ステツプ
d29に移る。 ステツプd29では、カウント値nが負である
かどうかの判断を行なう。これは、表示部4にお
けるカーソルが、前記表を左方に越える位置に表
示されるかどうかの判断である。判断結果が肯定
であればステツプd30でカウント値nを0と
し、ステツプd31に移る。前記判断が否定であ
れば、ステツプd30を行なうことなく、ステツ
プd31に移る。 ステツプd31ではカウント値mが負であるか
どうかの判断を行なう。これは前記表示部4のカ
ーソルが表を上方に超えて表示されるかどうかの
判断である。判断結果が肯定であれば、ステツプ
d32でカウント値mを0とし、処理がステツプ
d4に移る。上記判断が否定であれば、ステツプ
d32の処理を行なうことなく、処理はステツプ
d4に移される。 このようにして上記第4図〜第6図の処理を行
なうことによつて、作成すべき表の題名、列項目
名、行項目名、および各データを入力することが
できる。このようにして、上記第1表を作成する
ことができる。 第7図は本発明の一実施例の作成された表の
行・列を入替える処理手順を示すフローチヤート
である。第1図〜第7図を参照して、この入替え
処理について説明する。前記第6図を参照して説
明したデータ関数Dh(m,n)は、カウント値
m,nによる2変数のデータ関数であつたが、第
1表の数値データ部分のみを各行列要素毎に、最
上行において最左列から右方へ、引続き第2行に
ついて最左列から右方に、順次行列要素を計数し
て一連の番号を与え、この番号を変数とする1変
数のデータ関数Dh(a)を、下記のように定義する。 Dh(a)≡Dh(m,n) …(4) ここで、 a=(m−1)C0+n このようして、前記データ関数Dh(m,n)に
1変数のデータ関数Dh(a)が1:1に対応する。
このような1変数のデータ関数Dh(a)を用いて、
上記第1表の数値データ部分のみを表示すると、
下記の第2表が得られる。
[Table] From the top address side of the table data area 25,
A definition area 38 is set in which the string function ThS|(C) to which the table title and column item name of each table are assigned, and the numerical value of the number of column items (actually, the number of column items + 1) are defined and assigned. Ru. Below, C register 33
Using the count value C as a parameter, column item areas 39a to 39e are set in which the column names shown in Table 1 are stored as T0S|(0)="Suugaku"...(1). Subsequently, a definition area 40 is set, and a string function DhS|(L) to which row item name data such as "Aoki" in Table 1 is assigned is stored. Hereinafter, the line item name area 41a,
41b, 41c, . . . are set, and the line item names are stored, for example, D0S|(0)=“Aoki” . . . (2). Subsequently, the definition area 42 in which the numerical function Dh (m, n) to which input data corresponding to the points in the case of Table 1 is assigned is defined is set, and subsequently the data areas 43a, 43b, ... are set and inputted. Each data is stored as, for example, D0(0,0)=30...(3). These data are automatically allocated to the table data area 25 for each input process,
It can also be allocated by variable commands in the BASIC language. Furthermore, access to read each of these data is performed according to the number of items stored in the definition areas 38, 40, 42, etc. along with the variable names.
The address value of the data location is calculated. The data shown in the area 44 of the table data area 25 is
The maximum number of columns C0 (the maximum number of matrix elements in the row direction, that is, the horizontal direction) and the maximum number of rows L0 (the maximum number of matrix elements in the column direction, that is, the vertical direction) of the data matrix defined in the definition area 42. Therefore, this data is allocated when no input is made by operating the computer 1 in the assumed area, and all of this data is stored in the corresponding area of the table data area 25. Further, the data shown in the area 45 is data indicating the absence of data, and is stored when the missing value key 46 shown in FIG. 1 is operated. These numerical data are maximum value/maximum value numerical data that can be used in the calculator 1, and the reason why such numerical data is used to indicate non-input/absence of the data is as follows. That is, although the computer 1 can use special codes based on the BASIC language or the like for the above purpose, the computer 1 is capable of processing programs such as the BASIC language, and thus uses various code systems. Therefore, the aim is to place as few restrictions as possible on such a code system. .
Furthermore, in data processing, the maximum/minimum value of the data processing capacity of the computer 1 almost never occurs. FIG. 4 is a flowchart illustrating the procedure for inputting table titles and column item names in the calculator 1 shown in the first figure. The operation of this embodiment will be described with reference to FIGS. 1 to 4. Figure 4 Step a
1, operate the table function key 9 of the calculator 1. By this operation, in step a2, the count value h of the h register 27, which stores the numbers assigned to each of the plurality of input tables, is initialized to, for example, "0". In step a3, the CPU 13 transfers the data “Table title”; h+1; “=?” to the display buffer 16 of the display control unit 15.
and displayed on the display section 4. In step a4, the key input unit 14 of the computer 1
At step a5, it is determined whether the operated key is the character input key group 5 for inputting alphabets, kana, etc., and if the answer is negative, the process moves to step a6. If the judgment in step a5 is affirmative, the process moves to step a7, where the key-input character code is taken into the key-input buffer 47, and the code is developed into a character pattern using the CG program area 22. Then, in step a8, it is given to the display control section 15 and displayed on the display section 4. After this, the process returns to step a4 again, and the process returns to step a4 described above.
The process with steps 4 to a8 as one cycle is repeated. In this way, the title of the table to be created in the subsequent process, "Seiseki Hiyo", is stored in the key input buffer 47 and displayed on the display section 4. If the result of the determination at step a5 is negative, the process moves to step a6, where it is determined whether the operated key is the column designation key 11 or not. If the judgment result is negative, the process moves to step a9, and if the judgment result is affirmative, the process moves to step a10. In step a10, the contents of the key input buffer 47 in which data was stored in step a7 are converted to the string function ThS|(C) (actually, h
= 0, C = 0). The processing from step a10 onwards moves to input of column item names. If the determination at step a6 is negative, the process moves to step a9, where it is determined whether the operated key is the front function key 9 or not. If the result of the determination is negative, the process returns to step a3, and the process described above is performed. If the determination at step a9 is affirmative, the process moves to step a11, where it is determined whether the count value h is, for example, 9. That is, the computer 1 of this embodiment has a function of creating, for example, nine tables. Of course, the number of items in this table may be greater than or equal to nine, or may be less than nine. If the judgment at step a11 is negative,
Calculator 1 is now able to create another table, increments the count value h by +1 at step a12, and returns the process to step a3. step a1
If the judgment result in step 1 is affirmative, it is impossible to create any more tables, and in step a13 the count value h is initialized to "0" and the title of the first table is displayed on the display section 4. , the process returns to step a3. The process subsequent to step a10 is to input the column item name, and in step a14, the count value C of the C register 33 representing the column item number is initialized to, for example, "0". At step a15, a table display asking for column item names is displayed on the display section 4 in a format similar to step a3. At step a16, key inputs from the key input section 14 of the computer 1 are read. In step a17, it is determined whether or not the character input key group 5 has been operated.
If negative, the process moves to step a18, and if affirmative, the process moves to steps a19 and a20, where the input character code is stored in the key input buffer 47 and then displayed on the display section 4, similarly to steps a7 and a8. do. The subsequent processing is step a16.
Move to. If the determination in step a17 is negative, it is determined in step a18 whether the column designation key 11 has been operated or not, and if negative, the process returns to step a16 and the above-described process is repeated. If affirmative,
Proceeding to step a20, it is determined whether the stored contents of the key input buffer 47 are blank.
If the judgment result is negative, the process proceeds to step a22.
, the allocation contents of the string function ThS|(C) are assigned to the string function ThS|(C+1). Thereafter, in step a23, the current memory contents of the key input buffer 47 are allocated and stored in the string function ThS|(C). Thereafter, the count value C is incremented by +1 at step a24, and the process returns to step a15 again. To summarize the processing in steps a22 to a24, each time a column item name is input, the table title stored for each string function is sequentially changed to the adjacent string function whose address increases. The latest column item name is assigned to the string function ThS|(0) corresponding to C=0. If the judgment in step a21 is affirmative, it means that the column instruction key 11 was operated without operating the character input key group 5, which means that the input of the column item name has ended in the table. ,
Thereafter, the process moves to a process for inputting line item names as shown in FIG. FIG. 5 is a flowchart illustrating the process of inputting line item names, which is performed subsequent to the process in the flowchart of FIG. With reference to Figures 1 to 5,
The procedure for inputting line item names will be explained. In step b1 of FIG. 5, the count value L of the C counter 33 representing the number attached to the line item name is, for example, "0".
In step b2, data such as "L";"=?" is displayed on the display section 4. In the subsequent step b3, the key input from the key input unit 14 is read, and in steps b4 and b5, it is determined whether the character input key group 5 or the line instruction key 10 has been operated, respectively. If both keys have not been operated, the process returns to step b3 and the key input reading operation is performed again. If the judgment result in step b4 is affirmative, step b
Steps 6 and b7 are sequentially moved to steps a7 and b7 shown in FIG.
The character corresponding to the character code taken in is displayed on the display section 4 in the same procedure as described in a8. If the judgment at step b4 is negative, the process moves to step b5, and if the judgment at step b5 is affirmative, the input of the first line item name of the table to be input is completed and the input of the next line item name is requested. This means that At this time, the process moves to step b8, and it is determined whether the stored contents of the key input buffer 47 are blank. If the determination is affirmative, input of line item names has been completed, and the process moves on to input processing of table data shown in FIG. 6, which will be described later. If the determination at step b8 is negative, the process moves to step b9, where the contents of the current key input buffer 47 are stored in the string function DhS|(L), and at the following step b10, the count value L is incremented by +1. Subsequently, the process returns to step b2, and a message indicating whether or not to input a new line item is displayed on the display section 4. If the input of the desired line item name has been completed, the line specification key 10 is operated again, and at this time the process moves to step b8 via steps b4 and b5, and the memory contents of the key input buffer 47 are blank. Something is determined. The process moves to a tabular data input processing mode, which will be described later with reference to FIG. FIG. 6 is a flowchart illustrating the procedure for inputting numerical data, which is the score for the title "Seiseki Hiyo" shown in Table 1 above. The data input procedure will be explained with reference to FIGS. 1 to 6. At step d1 in FIG. 6, the count values m and n of the m counter 28 and the n counter 29 indicating the column direction position and row direction position of the input data and the count value h of the h register indicating the table number are set to, for example, " Initialize each to 0. In step d2,
The data area 43 shown in FIG. 3 of the numerical function Dh (m, n) (actually h=m=n=0) defined in the definition area 42 of FIG. Only L0×C0 is secured for the value L0, and numerical data representing a data-uninput state shown in area 44 is stored. Next, in step d3, a string function ThS|
Regarding (C), DhS|(L), DhS|(m); THS|(n); “=?” …(A) is displayed on the display section 4, and the key input section 14 is operated in step d4. Load the key. In steps d5, d6, and d7, it is determined whether the obtained key input is the numerical input key group 6, the exchange key 12, or the column instruction key 11, respectively. If the determination at step d5 is affirmative, the input numerical value is stored in the key input buffer 47 at step d8, and this numerical value is displayed on the display section 4 at step d9. When inputting such numerical data is completed, "63", for example, is displayed in the first row and first column of the table displayed on the display section 4. If the judgment at step d5 is negative, step d
If the judgment in step 6 is affirmative, it means that the input of numerical data in the table has been completed and a request is made to perform matrix permutation processing as described later, and the process proceeds to step d1.
This process, which will be described later, is carried out at step 0, and the process returns to step d4. If the judgment at step d6 is negative, step d
If the judgment in step 7 is affirmative, it means that the input of one column of data in the data input of the row concerned has been completed and the input of the next column is requested, and the process returns to step d.
Move on to 11. In step d11, the memory contents of the key input buffer 47 are changed to the data function Dh(m,n).
(currently h = m = n = 0), and in step d12, the number n of columns in the table into which data has been input is changed to the maximum number of columns (matrix elements in the row direction, that is, in the horizontal direction) determined in step d2. is the maximum number of
In the matrix of Table 2, which will be described later, it is determined whether C0 = 3). That is, it is determined whether data input for all columns of the row has been completed. If the judgment result is negative, it becomes possible to input data for the next column, and in step d13, the count value n indicating the number of columns is incremented by +1, and the process returns to step d3. If the judgment result in step d12 is affirmative, it means that data input for all columns of the row has been completed, and the process moves to step d14, where a count value m representing the number of rows in the table currently undergoing data input work is input.
is the maximum number of rows L0 determined in step d2 (the maximum number of matrix elements in the column direction, that is, the vertical direction,
In the matrix of Table 2, which will be described later, it is determined whether it is equal to L0=6). If they are equal, the data input process ends. If they are not equal, it is possible to input the next line, and in step d15 the count value m
is incremented by +1, the process advances to the next row, and in step d16 the count value n is initialized to, for example, "0", making it possible to input the first column of the row. After doing this, the process goes to step d.
Returned to 3. If the judgment result in step d7 is negative, it means that the operator is performing an operation other than data input operation, and the process proceeds to step d1.
7, d18, d19, and d20 in sequence, and the operated key is either the right key 48 or the down key 49 of the cursor key group 8.
, the upper key 50, or the left key 51. If the operated key is not in the cursor key group 8, the process returns to step d4. In these judgment processing steps d17 to d20, if the judgment result is affirmative, the processing proceeds to steps d21, d22, d23, and d2, respectively.
4, the count value n indicating the column position in the row direction (that is, the horizontal direction) is incremented by +1, and the count value m indicating the column position in the column direction (that is, the vertical direction) is incremented by +1, and this count value m is decremented by -1, and the count value n is decremented by -1.These steps d2
Processes 1 to d24 are performed to obtain a display in which the cursor 52 is moved in an arbitrary direction indicated by the cursor key group 8 on the display section 4. The processes from steps d21 to d24 commonly proceed to step d25, where it is first determined whether the count value n representing the number of columns is equal to (C0+1). This is the cursor 52 on the display section 4.
It is determined whether the table exceeds the currently displayed table in the row direction. If this judgment is established, the count value n is decremented by -1 in step d26, and
The process moves to step d27 without bringing the cursor 52 out of the way. If the result of the judgment at step d25 is negative, the process moves to step d27 without performing the process of step d26. In step d27, it is determined whether or not the cursor 52 on the display section 4 is displayed at a position beyond the table being input in the column direction. If the result of the judgment is affirmative, the count value m is decremented by -1 in step d28, and the process moves to step d29 without moving the cursor 52 out of sight. If the above judgment is negative, the process moves to step d29 without performing the process of step d28. In step d29, it is determined whether the count value n is negative. This is a determination as to whether the cursor on the display section 4 is displayed at a position beyond the table to the left. If the judgment result is affirmative, the count value n is set to 0 in step d30, and the process moves to step d31. If the above judgment is negative, the process moves to step d31 without performing step d30. In step d31, it is determined whether the count value m is negative. This is a determination as to whether or not the cursor on the display section 4 is displayed above the table. If the judgment result is affirmative, the count value m is set to 0 in step d32, and the process moves to step d4. If the above judgment is negative, the process moves to step d4 without performing the process of step d32. By performing the processes shown in FIGS. 4 to 6 in this manner, the title, column item name, row item name, and each data of the table to be created can be input. In this way, Table 1 above can be created. FIG. 7 is a flowchart showing a processing procedure for exchanging rows and columns of a created table according to an embodiment of the present invention. This replacement process will be explained with reference to FIGS. 1 to 7. The data function Dh(m, n) explained with reference to FIG. , in the top row from the leftmost column to the right, and then in the second row from the leftmost column to the right, sequentially count the matrix elements and give a series of numbers, and use this number as a variable to create a one-variable data function Dh (a) is defined as follows. Dh(a)≡Dh(m,n)...(4) Here, a=(m-1)C0+n In this way, the data function Dh(m,n) has a one-variable data function Dh(a) corresponds to 1:1.
Using such a one-variable data function Dh(a),
If you display only the numerical data part of Table 1 above,
The following Table 2 is obtained.

【表】 本実施例の目的は、上記第2表の行・列を入替
え、下記第3表のデータ行列を生成させることで
ある。
[Table] The purpose of this embodiment is to transpose the rows and columns of Table 2 above to generate the data matrix shown in Table 3 below.

【表】 第7図ステツプe1で第1図示の入替えキー1
2を操作し、この操作によつてステツプe2でカ
ウント値「1」に初期化する。 ステツプe3では、Dh(1)に割当てられている
数値データ(第1表の例に従えば「63」)を記憶
部18のXレジスタ31に格納する。ここで前記
データ関数Dh(a)は、前記第1表に示される対応
する数値データとともに、後述する入替え処理が
終了した場合に論理値「1」となり、完了してい
ない場合には論理値「0」となる入替え完了フラ
グも割付けられている。すなわち現時点では入替
え処理は起動されたばかりであり、すべてのカウ
ント値aのデータ関数Dh(a)に関する前記入替え
完了フラグは、すべて論理値「0」であり、前記
第1表に示す数値データとともに、このフラグの
内容がこのステツプe3において、Xレジスタ3
1に格納される。 ステツプe4では、前記データ関数Dh(a)に割
当てられている切替え完了フラグが、論理値
「1」であるかどうかの判断を行なう。現時点で
はこのフラグは論理値「0」であり、処理はステ
ツプe5に移り、このデータ関数Dh(1)の入替え
完了フラグを論理値「1」にセツトする。ステツ
プe6では、論理値「1」の入替え完了フラグを
含むデータをXレジスタ31に再び記憶する。 ステツプe7では前記カウント値aに関して上
記第2表から第3表への入替え処理を実現できる
新たなカウント値a′を下式に基づいて算出する。 a′={(a−1)−〔a−1/C0〕C0}L0 +{〔a−1/C0〕+1}…(5) 第5式によつてカウント値a(本実施例ではa
=1,2,…,18)に対応するデータ関数Dh(a)
のデータを、第5式によつて算出されるa′(第3
表中の数値1,2,…,18にその数値を示す)
を、対応させるものである。この対応関係は下記
の第4表に示される。 前述の第5式において、〔a−1/c0〕の(1)の意味 は、a−1/C0の演算結果の値を超えない最大の整 数であり、たとえばa−1=4、c0=3であれば
〔a−1/c0〕は1となり、a−1=8、c0=3であ れば2となる。
[Table] Replace key 1 shown in Figure 1 at step e1 in Figure 7
2, and by this operation, the count value is initialized to "1" in step e2. At step e3, the numerical data assigned to Dh(1) ("63" according to the example in Table 1) is stored in the X register 31 of the storage section 18. Here, the data function Dh(a), together with the corresponding numerical data shown in Table 1, has a logical value of "1" when the replacement process described later is completed, and a logical value of "1" when it is not completed. A replacement completion flag of "0" is also assigned. In other words, at this moment, the replacement process has just been started, and the replacement completion flags regarding the data function Dh(a) of all count values a are all logical values "0", and together with the numerical data shown in Table 1 above, , the contents of this flag are stored in the X register 3 in step e3.
It is stored in 1. In step e4, it is determined whether the switching completion flag assigned to the data function Dh(a) has a logical value of "1". At this moment, this flag has a logical value of "0", and the process moves to step e5, where the replacement completion flag of this data function Dh(1) is set to a logical value of "1". At step e6, data including the replacement completion flag of logical value "1" is stored in the X register 31 again. In step e7, a new count value a' that can realize the process of replacing the count value a from the second table to the third table is calculated based on the following formula. a'={(a-1)-[a-1/C0]C0}L0+{[a-1/C0]+1}...(5) The count value a (in this example, a
= 1, 2, ..., 18) corresponding data function Dh(a)
data, a′ (third
The numbers are shown in numbers 1, 2, ..., 18 in the table)
This corresponds to This correspondence is shown in Table 4 below. In the fifth equation above, the meaning of (1) of [a-1/c0] is the largest integer that does not exceed the value of the operation result of a-1/C0, for example, a-1=4, c0= If it is 3, [a-1/c0] becomes 1, and if a-1=8 and c0=3, it becomes 2.

【表】 前記ステツプe2で示したように、a=1と設
定されているとき、上記第5式および第4表か
ら、a′=1が演算される。したがつてステツプe
8でDh(a′)(a′=1)の入替え完了フラグは、す
でにステツプe5において「1」に設定されてお
り、したがつてDh(1)は、第3表にいうa′=1の
位置に固定されたままの状態で、処理はステツプ
e9に移る。 ステツプe9では、前記カウント値aが+1イ
ンクリメメントされ、ステツプe10でこのカウ
ント値aが第1表の数値データの要素数S|(18)を越
えているかどうかが判断される。現時点ではこの
判断は否定となり、処理はステツプe3に戻る。 ステツプe3では、Dh(2)のデータがXレジス
タ31に記憶され、ステツプe5でデータ関係
Dh(2)の入替え完了フラグが「1」にセツトされ
る。以下、前述の説明と同様にステツプe6,e
7の処理がなされ、上記第5式および第4表か
ら、a=5からはa′=8が演算される。したがつ
てステツプe8でデータ関数Dh(a′)(a′=8)の
入替え完了フラグが「1」であるかどうかの判断
が行なわれ、現時点は否定となり、処理はステツ
プe11に移り、データ関数Dh(a′)の入替え完
了フラグを「1」にセツトする。 ステツプe12では、データ関数Dh(a′)(a′=
8)の入替え完了フラグの内容も含むデータと、
前記ステツプe6においてデータ関数Dh(2)の入
替え完了フラグを含むデータが転送されているX
レジスタのデータと、相互にデータの交換を行な
う。したがつてデータ関数Dh(a′)(a′=7)に
は、データ関数Dh(2)のデータが与えられる。す
なわちデータ関数Dh(2)は、第3表のa′=7の配
置位置に割付けられる。またここでXレジスタ3
1には、転置行列のデータ関数Dh(7)のデータが
記憶されていることになる。そこで転置行列の配
列態様におけるデータ関数Dh(a′)の行列要素
に、前記レジスタの数値データを設定することに
よつて、転置行列のデータ行列を発生させること
ができる。 この後、処理はステツプe7に戻り、データ関
数Dh(7)に対して上記第5式および第4表から明
らかなようにデータ関数Dh(a′)(a′=3)が対応
づけられる。すなわち第3表に示すようにデータ
関数Dh(7)は、a′=3で示す配置位置に割当てら
れる。以下、ステツプe7,e8,e11,e1
2を1サイクルとする処理を繰返し行なうことに
よつて、上記第4表の「4→2」の処理が行なわ
れる段階に到達する。すなわちこのときステツプ
e7においてa′=2が演算される。この時点では
上記第2表において第3表のように入替え処理が
行なわれていないのは、データ関数Dh(18)のみと
なる。 ステツプe8ではデータ関数Dh(a′)(a′=2)
の入替え完了フラグが、「1」であるかどうかの
判断が行なわれる。このときa=1に関する処理
ですでにデータ関数Dh(1)の入替え完了フラグは、
ステツプe5において「1」にセツトされてお
り、したがつてステツプe8の判断は肯定とな
り、処理はステツプe9に移る。ステツプe9で
はカウント値の値が+1インクリメントされ、a
=3となつて、ステツプe12に移り、この判断
は否定となり、処理はステツプe3に移る。 ステツプe3ではデータ関数Dh(3)の内容が、
既に「1」にセツトされている入替え完了フラグ
の内容とともに、Xレジスタ31に転送される。
ステツプe4では判断結果が肯定となり、処理は
ステツプe9に移る。以下同様に、ステツプe
9,e10,e3,e4を1サイクルとする処理
が繰返し行なれ、カウント値aは順次+1インク
リメントされつつ、ステツプe9においてインク
リメントされた結果がa=19となる場合に到達す
る。このときステツプe10の判断は肯定とな
り、処理はステツプe13に移つて、任意のカウ
ント値aの入替え完了フラグが、すべて「0」に
リセツトされる。このようにして、第2表のデー
タ行列から第3表のデータ行列への行・列の入替
え処理が完了する。 以上のように本実施例によれば、第7図のフロ
ーチヤートに示す処理プログラムを用い、かつ
行・列の入替え用ワーキングレジスタであるXレ
ジスタ31のみを用いることによつて、前記行・
列の入替え処理を実現できる。すなわちこのよう
な入替えプログラムを用いる電子計算機1におけ
る入替えプログラムは格段に簡素化され、また従
来技術で述べたようにむやみに大きな記憶容量の
メモリを準備する必要がなく、構成を格段に簡略
化することができる。 効 果 以上のように本発明に従えば、行列状の配列態
様を有するデータ分の行・列の配置位置を入替え
る処理を行なうにあたつて簡素なプログラムと、
単一個のレジスタとを用いることによつて実現で
きる。したがつてこのようなデータ処理装置の構
成が格段に簡略化され、また操作性も格段に向上
する。 すなわち本発明によれば、元の行列を構成する
各行列要素を、記憶手段に1次元データとして記
憶しておき、第1の値aおよび第2の値a′を演算
するとともにレジスタ31への行列要素の入れ替
えを繰返すことによつて、その記憶段の記憶内容
を、転置行列の1次元データとして構成しなおす
ことができ、そのレジスタ31は、1つの行列要
素を記憶することができる記憶容量を有していれ
ばよく、また第1の値aおよび第2の値a′の演算
は比較的簡単であり、こうして元の行列から転置
行列を容易に求めることができるようになる。
[Table] As shown in step e2 above, when a=1 is set, a'=1 is calculated from the fifth equation and Table 4 above. Therefore, step e
The replacement completion flag of Dh(a') (a'=1) in step e5 has already been set to "1" in step e5, so Dh(1) is set to a'=1 in Table 3. The process moves to step e9 while the position remains fixed. At step e9, the count value a is incremented by +1, and at step e10, it is determined whether this count value a exceeds the number of elements S|(18) of the numerical data in Table 1. At this point, this determination is negative, and the process returns to step e3. At step e3, the data of Dh(2) is stored in the X register 31, and at step e5, the data relationship is
The replacement completion flag of Dh(2) is set to "1". Hereinafter, steps e6 and e are similar to the above explanation.
7 is performed, and a'=8 is calculated from a=5 from the fifth equation and Table 4 above. Therefore, in step e8, it is determined whether the replacement completion flag of the data function Dh(a') (a'=8) is "1", and the result is negative at this time, and the process moves to step e11, where the data Set the replacement completion flag of function Dh(a') to "1". In step e12, the data function Dh(a') (a'=
8) Data including the contents of the replacement completion flag,
X where data including the replacement completion flag of data function Dh(2) is transferred in step e6
Data is exchanged with the data in the register. Therefore, the data of the data function Dh(2) is given to the data function Dh(a') (a'=7). That is, the data function Dh(2) is assigned to the location a'=7 in Table 3. Also here, X register 3
1 stores the data of the data function Dh(7) of the transposed matrix. Therefore, the data matrix of the transposed matrix can be generated by setting the numerical data of the register to the matrix element of the data function Dh(a') in the arrangement form of the transposed matrix. Thereafter, the process returns to step e7, and the data function Dh(7) is associated with the data function Dh(a') (a'=3), as is clear from equation 5 and Table 4 above. That is, as shown in Table 3, the data function Dh(7) is assigned to the location indicated by a'=3. Below, steps e7, e8, e11, e1
By repeating the process in which 2 is one cycle, a stage is reached where the process of "4→2" in Table 4 above is performed. That is, at this time, a'=2 is calculated in step e7. At this point, only the data function Dh(18) in Table 2 has not been replaced as shown in Table 3. At step e8, data function Dh(a') (a'=2)
It is determined whether the replacement completion flag of is "1". At this time, the replacement completion flag of the data function Dh(1) has already been set in the process regarding a=1.
It is set to "1" at step e5, so the determination at step e8 is affirmative, and the process moves to step e9. At step e9, the count value is incremented by +1, and a
=3, the process moves to step e12, this judgment becomes negative, and the process moves to step e3. In step e3, the contents of the data function Dh(3) are
It is transferred to the X register 31 together with the contents of the replacement completion flag, which has already been set to "1".
At step e4, the determination result is affirmative, and the process moves to step e9. Similarly, step e
9, e10, e3, and e4 are repeated as one cycle, and the count value a is sequentially incremented by +1 until the count value a is reached when the incremented result at step e9 becomes a=19. At this time, the judgment at step e10 becomes affirmative, and the process moves to step e13, where all the replacement completion flags for the arbitrary count value a are reset to "0". In this way, the row/column swapping process from the data matrix in Table 2 to the data matrix in Table 3 is completed. As described above, according to this embodiment, by using the processing program shown in the flowchart of FIG. 7 and using only the X register 31, which is a working register for exchanging rows and columns,
Column swapping processing can be realized. In other words, the replacement program in the electronic computer 1 that uses such a replacement program is greatly simplified, and there is no need to prepare a memory with an unnecessarily large storage capacity as described in the prior art, and the configuration is significantly simplified. be able to. Effects As described above, according to the present invention, a simple program and a
This can be realized by using a single register. Therefore, the configuration of such a data processing device is greatly simplified, and the operability is also greatly improved. That is, according to the present invention, each matrix element constituting the original matrix is stored as one-dimensional data in the storage means, and the first value a and the second value a' are calculated and stored in the register 31. By repeatedly exchanging matrix elements, the storage contents of the storage stage can be reconfigured as one-dimensional data of a transposed matrix, and the register 31 has a storage capacity that can store one matrix element. , and the calculation of the first value a and the second value a' is relatively simple, thus making it possible to easily obtain the transposed matrix from the original matrix.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の一実施例の計算機1の平面
図、第2図は計算機1の電気的構成を示すブロツ
ク図、第3図は表データ領域25のデータ割付け
状態を示す図、第4図は計算機1における表の題
名と列項目名入力の手順を示すフローチヤート、
第5図は行項目名入力の手順を示すフローチヤー
ト、第6図は表のデータ入力処理を示すフローチ
ヤート、第7図は表の行・列の入替え処理を示す
フローチヤートである。 1…計算機、4…表示部、5…文字入力キー
群、6…数値入力キー群、9…表機能キー、10
…行指示キー、11…列指示キー、12…入替え
キー、14…キー入力部、25…表データ領域、
31…Xレジスタ、39…列項目名領域、41…
行項目名領域、43…データ領域、47…キー入
力バツフア。
FIG. 1 is a plan view of a computer 1 according to an embodiment of the present invention, FIG. 2 is a block diagram showing the electrical configuration of the computer 1, FIG. 3 is a diagram showing the data allocation state of the table data area 25, and FIG. The figure is a flowchart showing the procedure for inputting table titles and column item names in calculator 1.
FIG. 5 is a flowchart showing the procedure for inputting row item names, FIG. 6 is a flowchart showing table data input processing, and FIG. 7 is a flowchart showing table row/column replacement processing. 1...Calculator, 4...Display section, 5...Character input key group, 6...Numeric input key group, 9...Table function key, 10
... Row direction key, 11 ... Column direction key, 12 ... Replace key, 14 ... Key input section, 25 ... Table data area,
31...X register, 39...column item name area, 41...
Line item name area, 43...data area, 47...key input buffer.

Claims (1)

【特許請求の範囲】 1 (a) 最大列数C0、最大行数L0である元の行
列を構成する各行列要素を、各行を順次的にか
つ行方向に順次的に1次元データとして記憶す
る記憶手段と、 (b) 前記記憶手段に記憶されている行列要素によ
つて構成される行列を表示する表示手段と、 (c) レジスタ31と、 (d) 第m行第第n列の行列要素をレジスタ31に
記憶し、その第m行第n列の行列要素に対応す
る第1の値aを、 a=(m−1)C0+n として求め、 次に第2の値a′を、 a′={(a−1)−[a−1/C0〕C0]L0 +{[a−1/C0]+1} として求め、 第2の値a′に対応する記憶手段に記憶されて
いる行列要素と、レジスタ31に記憶してある
行列要素とを入れ替え、 その入れ替え後に、レジスタ31に記憶され
た行列要素に関して、第2の値a′を求めて記憶
手段に記憶されている第1の値aに対応する行
列要素とを入れ替え、このような入れ替える動
作を繰り返して転置行列を構成する行列要素を
1次元データとして作用する転置行列作成手段
とを含むことを特徴とする転置行列の作成装
置。
[Scope of Claims] 1 (a) Each matrix element constituting an original matrix having a maximum number of columns C0 and a maximum number of rows L0 is stored as one-dimensional data, each row sequentially and sequentially in the row direction. (b) display means for displaying a matrix constituted by matrix elements stored in the storage means; (c) a register 31; (d) a matrix in the m-th row and n-th column. The element is stored in the register 31, the first value a corresponding to the matrix element in the mth row and nth column is determined as a=(m-1)C0+n, and the second value a' is then a ' = {(a-1)-[a-1/C0]C0]L0 +{[a-1/C0]+1}, and the matrix stored in the storage means corresponding to the second value a' The element and the matrix element stored in the register 31 are swapped, and after the swap, a second value a' is calculated for the matrix element stored in the register 31, and the first value stored in the storage means is calculated. A transposed matrix creating device, comprising a transposed matrix creating means for exchanging the matrix elements corresponding to a and repeating such an exchanging operation to act as one-dimensional data on the matrix elements constituting the transposed matrix.
JP61181701A 1986-06-17 1986-07-31 Data processor Granted JPS6336475A (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP61181701A JPS6336475A (en) 1986-07-31 1986-07-31 Data processor
DE8787108562T DE3776598D1 (en) 1986-06-17 1987-06-13 DATA PROCESSING SYSTEM.
EP87108562A EP0253138B1 (en) 1986-06-17 1987-06-13 Data processing device
US07/464,702 US5043916A (en) 1986-06-17 1990-01-16 Data processing device for processing and displaying table data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP61181701A JPS6336475A (en) 1986-07-31 1986-07-31 Data processor

Publications (2)

Publication Number Publication Date
JPS6336475A JPS6336475A (en) 1988-02-17
JPH0586579B2 true JPH0586579B2 (en) 1993-12-13

Family

ID=16105346

Family Applications (1)

Application Number Title Priority Date Filing Date
JP61181701A Granted JPS6336475A (en) 1986-06-17 1986-07-31 Data processor

Country Status (1)

Country Link
JP (1) JPS6336475A (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3138289B2 (en) * 1991-07-08 2001-02-26 シャープ株式会社 Electronic equipment with matrix calculation and display functions

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61181702A (en) * 1985-01-18 1986-08-14 エムアーエヌ・ゲーハーハー・シーネンフエルケールステヒニク・ゲゼルシヤフト・ミト・ベシユレンクテル・ハフツング Wheel set for railway orlling stock

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61181702A (en) * 1985-01-18 1986-08-14 エムアーエヌ・ゲーハーハー・シーネンフエルケールステヒニク・ゲゼルシヤフト・ミト・ベシユレンクテル・ハフツング Wheel set for railway orlling stock

Also Published As

Publication number Publication date
JPS6336475A (en) 1988-02-17

Similar Documents

Publication Publication Date Title
JP2951664B2 (en) Touch panel device
JPH0586579B2 (en)
JPH0586580B2 (en)
JP3533758B2 (en) Scroll control device and display device
JP2738851B2 (en) Input data processing display method using multiple cursors
JPH0376491B2 (en)
CN1015137B (en) Character processor (temporary)
JPH08180118A (en) Table processor
JPH0445875B2 (en)
JPS61147371A (en) Conversational graphics processing system
JPS6336477A (en) Data processor
JP3091116B2 (en) XY coordinate display method
JP2645174B2 (en) Computer with field display function
JPH0368395B2 (en)
JPS6031675A (en) Table control system in simplified tabulation device
JP3006988B2 (en) Spreadsheet apparatus and data management method for spreadsheet apparatus
JPH02160287A (en) Cursor display circuit
JP2839306B2 (en) Attribute setting method in interactive graphic processing
JPH0734233B2 (en) How to create a graph
JPS61180283A (en) Word processor
JP2868125B2 (en) Cursor moving device
JPH08249126A (en) Input control device
JPH0743750B2 (en) Multi-table concatenation method in information processing equipment
JPH0731477B2 (en) Data display method
JPS63317818A (en) In-field document editing device

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees