関数unit_matrix マニュアル

(The documentation of function unit_matrix)

Last Update: 2021/12/6


◆機能・用途(Purpose)

単位行列をstruct matrix型構造体として作成する。
Create a unit matrix as a struct matrix-type structure.


◆形式(Format)

#include <matrix/initialize.h>
inline struct matrix unit_matrix(const int size)


◆引数(Arguments)

size 作成する行列のサイズ。
The size of the matrix to create.


◆戻り値(Return value)

size×sizeの単位行列を表す構造体。 戻り値の各メンバの値は以下のようになる。
A structure which represents a unit matrix of size×size. The values of members of the return value are as follows.

戻り値のメンバ
Member of the return value
値
Value
rowmax 引数sizeの値。
The value of argument size.
columnmax 引数sizeの値。
The value of argument size.
main size×sizeの2次元配列。 各\(i\)に対してmain[i][i]=1、 各\((i,j)\)の組(\(i\neq j\))に対してmain[i][j]=0とする。
A 2-D array of rowmax×columnmax, with the values main[i][i]\(=1\) for each \(i\), and main[i][j]\(=0\) for each combination of \((i,j)\) where \(i\neq j\).
allocated ’y’


◆使用例(Example)

struct matrix A=unit_matrix(3);