関数add_matrix マニュアル

(The documentation of function add_matrix)

Last Update: 2021/12/6


◆機能・用途(Purpose)

2つの行列の和を計算する。
Calculate the summation of two matrices.


◆形式(Format)

#include <matrix/operation.h>
inline struct matrix add_matrix(const struct matrix A,const struct matrix B)


◆引数(Arguments)

A 和の計算に用いる1つ目の行列\(\myvector{A}\)。
The first matrix \(\myvector{A}\) used in the summation.
B 和の計算に用いる2つ目の行列\(\myvector{B}\)。 サイズは\(\myvector{A}\)と等しくなければならない。
The second matrix \(\myvector{B}\) used in the summation, which must have the same size as \(\myvector{A}\).


◆戻り値(Return value)

行列\(\myvector{A}+\myvector{B}\)を表す構造体。 戻り値のメンバの値は以下のようになる。
A structure which represents a matrix \(\myvector{A}+\myvector{B}\). The values of members of the return value are as follows.

戻り値のメンバ
Member of the return value

Value
rowmax A.rowmax
columnmax A.columnmax
各\(i\), \(j\)に対するmain[i][j]
main[i][j] for each \(i\) and \(j\)
A.main[i][j]\(+\)B.main[i][j]
allocated ’y’


◆使用例(Example)

struct matrix A,B;
struct matrix C=add_matrix(A,B);