Matrix.HasInverse Propriété
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Obtient une valeur qui indique si cette Matrix structure est inversée.
public:
property bool HasInverse { bool get(); };
public bool HasInverse { get; }
member this.HasInverse : bool
Public ReadOnly Property HasInverse As Boolean
Valeur de propriété
true si l’objet Matrix a une inverse ; sinon, false. La valeur par défaut est true.
Exemples
L’exemple suivant vérifie si un Matrix élément est inversé. S’il est inversé, il Matrix est inversé.
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.");
}
}