Matrix.HasInverse 속성

정의

Matrix 구조체를 반전할 수 있는지 여부를 나타내는 값을 가져옵니다.

public:
 property bool HasInverse { bool get(); };
public bool HasInverse { get; }
member this.HasInverse : bool
Public ReadOnly Property HasInverse As Boolean

속성 값

Boolean

Matrix에 역이 있으면 true이고, 그렇지 않으면 false입니다. 기본값은 true입니다.

예제

다음 예제에서는 검사 여부는 Matrix 를 반전할 수입니다. 반전할 수 있으면는 Matrix 반전 됩니다.

private Matrix inverseExample()
{
    
    // Creating a Matrix structure.
    Matrix myMatrix = new Matrix(5, 10, 15, 20, 25, 30);
                
    // Checking if myMatrix is invertible.
    if (myMatrix.HasInverse)
    {

        // Invert myMatrix. myMatrix is now 
        // equal to (-0.4, 0.2 , 0.3, -0.1, 1, -2) 
        myMatrix.Invert();
        
        // Return the inverted matrix.
        return myMatrix;
    }
    else
    {
        throw new InvalidOperationException("The matrix is not invertible.");
    }
}

적용 대상