using Rust nalgebra matrices of scalars in a finite field of prime order, I am trying to inverse such matrices; I though nalgebra would use my own Scalar
type division trait to perform the inversion with the try_inverse
function, but instead it returns the following error:
`the method `try_inverse` exists for struct `Matrix<Scalar, Const<12>, Const<12>, ArrayStorage<Scalar, 12, 12>>`, but its trait bounds were not satisfiedthe following trait bounds were not satisfied:`Scalar: ComplexField``<Scalar as SimdValue>::SimdBool = bool`which is required by `Scalar: ComplexField``<Scalar as SimdValue>::Element = Scalar`which is required by `Scalar: ComplexField``Scalar: nalgebra::Field`which is required by `Scalar: ComplexField``Scalar: num_traits::NumAssign`which is required by `Scalar: ComplexField``Scalar: num_traits::NumAssignOps`
seemingly requiring the scalars to be complex values and not finite field elements.The error came after:let mut inv_mat: Matrix<Scalar, U12, U12, ArrayStorage<Scalar, 12, 12>>; let mat = { let mut elem = random_scalar(rng); Matrix::repeat_generic(U12,U12,elem) }; inv_mat.try_inverse(mat);
Does anyone have a clue on what to do?
I tried to use the try_inverse
function for nalgebra's Matrix
type for matrices of elements in the Scalar
type for finite fields of prime order, and it seems that algebra only wants to work for matrices of complex numbers instead; though maybe I got a wrong impression?
EDIT: indeed nalgebra's ComplexField
type does not seem to be compatible with finite field operations.