関数columnvector_swap_by_pivot マニュアル

(The documentation of function columnvector_swap_by_pivot)

Last Update: 2021/12/6


◆機能・用途(Purpose)

連立方程式をLU分解で解くために左辺の係数行列の行を交換したのに合わせて 右辺の列ベクトルの成分を交換する。
Swap the column vector components in the right hand side of a simultaneous equation, corresponding to swappings of rows of the coefficient matrix in the left hand side for solving the equation by an LU decomposition.

連立方程式\(\myvector{A}\myvector{x}=\myvector{b}\) (\(\myvector{A}\):係数行列、\(\myvector{x}\):未知数ベクトル、 \(\myvector{b}\):既知定数ベクトル)をLU分解で解く場合、 ピボット選択のために\(\myvector{A}\)の行の交換が行われる。 これに合わせて\(\myvector{b}\)の行の交換も必要であり、 それを行うのがこの関数である。
Let us consider to solve a simultaneous equation \(\myvector{A}\myvector{x}=\myvector{b}\) by an LU decomposition, where \(\myvector{A}\) is a coefficient matrix, \(\myvector{x}\) is a vector of unknowns, and \(\myvector{b}\) is a vector of known constants. To solve the equation, rows of \(\myvector{A}\) are swapped as the pivod selection. Correcponding to it, the rows of \(\myvector{b}\) must be swapped, which is done by this function.


◆形式(Format)

#include <matrix/inverse.h>
inline struct columnvector columnvector_swap_by_pivot
(const struct columnvector original,const int ∗pivot)


◆引数(Arguments)

original 元の(成分を交換する前の)連立方程式の右辺を表す列ベクトル。
The original column vector before swapping the components, which represents the right hand side of a simultaneous equation.
pivot 連立方程式の左辺の係数行列に対して行った行の交換の情報。 行交換後の係数行列の第\(i\)行成分が もともと存在していた行番号をpivot[i]とする。
Information of the row swappings applied to the coefficient matrix in the left hand side of the simultaneous equation; pivot[i] is defined such that the \(i\)th row after the row swapping was originally located at the pivot[i]th row.


◆戻り値(Return value)

originalの第pivot[i]成分を第\(i\)成分とする列ベクトル。
A column vector whose \(i\)th component is the pivot[i]th component of original.


◆使用例(Example)

struct matrix A;
struct columnvector b;
struct LU A_LU=LU_decomposition(A);
struct columnvector bb=columnvector_swap_by_pivot(b,A_LU.pivot);