行列のLU分解
Namespace: fvalgcliAssembly: fvalgcli (in fvalgcli.dll) Version: 3.1.0.0 (3.1.0.11)
Syntax
C# |
---|
public static int fnFIE_mat_lu( FMATRIX_PTR a, INT_PTR pivot ) |
Visual Basic |
---|
Public Shared Function fnFIE_mat_lu ( a As FMATRIX_PTR, pivot As INT_PTR ) As Integer |
Parameters
- a
- Type: fvalgcli..::..FMATRIX_PTR
入力時、分解する入力MxN行列A。
出力時、三角分解 の因子LとU。 Lの単位対角要素は格納されません。
- pivot
- Type: fvalgcli..::..INT_PTR
軸選択用添字。min(M,N)の領域が必要です。 0 ≦i<min(M,N) に対して、行i は 行pivot[i] と交換されています。
Return Value
Type: Int32以下のエラーコードを返します。
エラーコード:
f_err | 内容 |
---|---|
F_ERR_NONE | 正常終了 |
F_ERR_NOMEMORY | メモリ不足エラー |
F_ERR_CALC_IMPOSSIBLE | 計算不能エラー |
F_ERR_INVALID_PARAM | パラメータ異常 |
F_ERR_NO_LICENCE | ライセンスエラー、または未初期化エラー |
Examples
C# | Copy |
---|---|
// $Revision: 1.1 $ using System; using System.Collections.Generic; using System.Text; using fvalgcli; namespace TC { public partial class FIE { [FvPluginExecute] public void fnFIE_mat_lu() { FMATRIX_PTR a = FMATRIX_PTR.Zero; INT_PTR pivot = INT_PTR.Zero; try { int status = (int)f_err.F_ERR_NONE; a = api.fnFIE_mat_aalloc(4, 3); a[0, 0] = 1.0; a[0, 1] = 2.0; a[0, 2] = 3.0; a[1, 0] = 4.0; a[1, 1] = 5.0; a[1, 2] = 6.0; a[2, 0] = 7.0; a[2, 1] = 8.0; a[2, 2] = 9.0; a[3, 0] = 10.0; a[3, 1] = 11.0; a[3, 2] = 13.0; pivot = INT_PTR.alloc(3); Assert.IsTrue(a != FMATRIX_PTR.Zero, "エラーが発生しました。"); status = api.fnFIE_mat_lu(a, pivot); Assert.IsTrue(status == (int)f_err.F_ERR_NONE, "エラーが発生しました。({0})", (f_err)status); } catch (System.Exception ex) { Assert.Fail(ex.Message); } finally { a.Dispose(); pivot.Dispose(); } } } } |
Visual Basic | Copy |
---|---|
' $Revision: 1.1 $ Imports System.Collections.Generic Imports System.Text Imports fvalgcli Public Partial Class FIE <FvPluginExecute> _ Public Sub fnFIE_mat_lu() Dim a As FMATRIX_PTR = FMATRIX_PTR.Zero Dim pivot As INT_PTR = INT_PTR.Zero Try Dim status As Integer = CInt(f_err.F_ERR_NONE) a = api.fnFIE_mat_aalloc(4, 3) a(0, 0) = 1.0 a(0, 1) = 2.0 a(0, 2) = 3.0 a(1, 0) = 4.0 a(1, 1) = 5.0 a(1, 2) = 6.0 a(2, 0) = 7.0 a(2, 1) = 8.0 a(2, 2) = 9.0 a(3, 0) = 10.0 a(3, 1) = 11.0 a(3, 2) = 13.0 pivot = INT_PTR.alloc(3) Assert.IsTrue(a <> FMATRIX_PTR.Zero, "エラーが発生しました。") status = api.fnFIE_mat_lu(a, pivot) Assert.IsTrue(status = CInt(f_err.F_ERR_NONE), "エラーが発生しました。({0})", CType(status, f_err)) Catch ex As System.Exception Assert.Fail(ex.Message) Finally a.Dispose() pivot.Dispose() End Try End Sub End Class |