成分の最大値抽出
Namespace: FVIL.DataAssembly: FVILbasic (in FVILbasic.dll) Version: 3.1.0.0 (3.1.0.17)
Syntax
C# |
---|
public virtual double max_elem() |
Visual Basic |
---|
Public Overridable Function max_elem As Double |
Return Value
Type: Double現在の行列の成分のうち、最大の値を返します。
現在の行列の内容は更新されません。
Remarks
生成に失敗した場合は例外を発行します。 例外の原因と発生位置を特定するには、発行された例外クラスの ErrorCode メンバと Function メンバを参照してください。
エラーコード:
値 | ErrorCode メンバ | 内容 |
---|---|---|
51 | FVIL.ErrorCode.LICENSE_ERROR | ライセンスがありません。 |
1 | FVIL.ErrorCode.FAILED_TO_ALLOCATE | メモリの確保に失敗しました。 |
11 | FVIL.ErrorCode.INVALID_PARAMETER | パラメータが不正です。 |
12 | FVIL.ErrorCode.INVALID_OBJECT | メモリが確保されていません。 |
29 | FVIL.ErrorCode.NOT_CALCULABLE | 計算できません。 |
関連する FIE 関数:
fnFIE_mat_max
Examples
ソースコード:
【関数の出力】
C# | Copy |
---|---|
// $Revision: 1.2 $ using System; using System.Collections.Generic; using System.Text; using fvalgcli; // FvPluginXXXX attribute requires fvalgcli namespace User.SampleCode { public partial class Matrix { /// <summary> /// 成分の最大値抽出. /// </summary> [FvPluginExecute] public void max_elem() { int rows = 3; int columns = 3; // 1) インスタンスの準備. FVIL.Data.CFviMatrix mat = new FVIL.Data.CFviMatrix(rows, columns); // 2) 行列の要素の設定. mat[0, 0] = -0.1; mat[0, 1] = 0.2; mat[0, 2] = -0.3; mat[1, 0] = 1.1; mat[1, 1] = -1.2; mat[1, 2] = 1.3; mat[2, 0] = -2.1; mat[2, 1] = 2.2; mat[2, 2] = -2.3; // 3) 計算実行. double result = mat.max_elem(); // 確認) 処理結果の出力. Console.Write("CFviMatrix.max_elem\n"); Console.Write("max_elem : {0}\n", result); } } } |
Visual Basic | Copy |
---|---|
' $Revision: 1.1 $ Imports System.Collections.Generic Imports System.Text Imports fvalgcli ' FvPluginXXXX attribute requires fvalgcli Namespace SampleCode Public Partial Class Matrix ''' <summary> ''' 成分の最大値抽出. ''' </summary> <FvPluginExecute> _ Public Sub max_elem() Dim rows As Integer = 3 Dim columns As Integer = 3 ' 1) インスタンスの準備. Dim mat As New FVIL.Data.CFviMatrix(rows, columns) ' 2) 行列の要素の設定. mat(0, 0) = -0.1 mat(0, 1) = 0.2 mat(0, 2) = -0.3 mat(1, 0) = 1.1 mat(1, 1) = -1.2 mat(1, 2) = 1.3 mat(2, 0) = -2.1 mat(2, 1) = 2.2 mat(2, 2) = -2.3 ' 3) 計算実行. Dim result As Double = mat.max_elem() ' 確認) 処理結果の出力. Console.Write("CFviMatrix.max_elem" & vbLf) Console.Write("max_elem : {0}" & vbLf, result) End Sub End Class End Namespace |
CFviMatrix.max_elem max_elem : 2.2
Exceptions
Exception | Condition |
---|---|
FVIL..::..CFviException | この例外の原因については、上記のエラーコード表をご参照ください。 |