インスタンスの比較(等価)

Namespace: FVIL.Data
Assembly: 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つのインスタンスの内容を比較します。 内容が同一の場合は true を返します。異なる場合は false を返します。 何れか一方が null の場合は false を返します。

Examples

ソースコード:
C# Copy imageCopy
//    $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 Equality()
        {
            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 = true;
            else
                result = false;

            // 確認) 処理結果の出力.
            if (result)
                Console.Write("CFviMatrix.Equality -> Success.\n");
            else
                Console.Write("CFviMatrix.Equality -> Failed.\n");
        }
    }
}


Visual Basic Copy imageCopy
'    $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 Equality()
            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 Is mat2 Then
                result = True
            Else
                result = False
            End If

            ' 確認) 処理結果の出力.
            If result Then
                Console.Write("CFviMatrix.Equality -> Success." & vbLf)
            Else
                Console.Write("CFviMatrix.Equality -> Failed." & vbLf)
            End If
        End Sub
    End Class
End Namespace
【関数の出力】
	CFviMatrix.Equality -> Success.
	

See Also