インスタンスの比較(不等価)
Namespace: FVIL.DataAssembly: FVILbasic (in FVILbasic.dll) Version: 3.1.0.0 (3.1.0.17)
Syntax
C# |
---|
public static bool operator !=( CFviMatrix ope1, CFviMatrix ope2 ) |
Visual Basic |
---|
Public Shared Operator <> ( ope1 As CFviMatrix, ope2 As CFviMatrix ) As Boolean |
Parameters
- ope1
- Type: FVIL.Data..::..CFviMatrix
比較対象のインスタンス(左辺値)
- ope2
- Type: FVIL.Data..::..CFviMatrix
比較対象のインスタンス(右辺値)
Return Value
Type: Boolean引数に指定された2つのインスタンスの内容を比較します。 内容が同一の場合は false を返します。異なる場合は true を返します。 何れか一方が null の場合は true を返します。
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 Inequality() { int rows = 3; int columns = 3; // 1) インスタンスの準備. FVIL.Data.CFviMatrix mat = new FVIL.Data.CFviMatrix(rows, columns); FVIL.Data.CFviMatrix mat2 = new FVIL.Data.CFviMatrix(rows, columns); // 2) 行列の要素の設定. mat[0, 0] = 1.0; mat[0, 1] = 3.0; mat[0, 2] = 3.0; mat[1, 0] = 4.0; mat[1, 1] = -2.0; mat[1, 2] = 1.0; mat[2, 0] = 2.0; mat[2, 1] = 5.0; mat[2, 2] = -1.0; mat2.CopyFrom(mat); bool result = false; // 3) 計算実行. if (mat != mat2) result = false; else result = true; // 確認) 処理結果の出力. if (result) Console.Write("CFviMatrix.Inequality -> Success.\n"); else Console.Write("CFviMatrix.Inequality -> Failed.\n"); } } } |
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 Inequality() Dim rows As Integer = 3 Dim columns As Integer = 3 ' 1) インスタンスの準備. Dim mat As New FVIL.Data.CFviMatrix(rows, columns) Dim mat2 As New FVIL.Data.CFviMatrix(rows, columns) ' 2) 行列の要素の設定. mat(0, 0) = 1.0 mat(0, 1) = 3.0 mat(0, 2) = 3.0 mat(1, 0) = 4.0 mat(1, 1) = -2.0 mat(1, 2) = 1.0 mat(2, 0) = 2.0 mat(2, 1) = 5.0 mat(2, 2) = -1.0 mat2.CopyFrom(mat) Dim result As Boolean = False ' 3) 計算実行. If mat IsNot mat2 Then result = False Else result = True End If ' 確認) 処理結果の出力. If result Then Console.Write("CFviMatrix.Inequality -> Success." & vbLf) Else Console.Write("CFviMatrix.Inequality -> Failed." & vbLf) End If End Sub End Class End Namespace |
CFviMatrix.Inequality -> Success.