mpfr_mat.h – matrices of MPFR floating-point numbers¶
Memory management¶
-
void
mpfr_mat_init
(mpfr_mat_t mat, slong rows, slong cols, mpfr_prec_t prec)¶ Initialises a matrix with the given number of rows and columns and the given precision for use. The precision is the exact precision of the entries.
-
void
mpfr_mat_clear
(mpfr_mat_t mat)¶ Clears the given matrix.
Basic manipulation¶
-
__mpfr_struct *
mpfr_mat_entry
(const mpfr_mat_t mat, slong i, slong j)¶ Return a reference to the entry at row \(i\) and column \(j\) of the given matrix. The values \(i\) and \(j\) must be within the bounds for the matrix. The reference can be used to either return or set the given entry.
-
void
mpfr_mat_swap
(mpfr_mat_t mat1, mpfr_mat_t mat2)¶ Efficiently swap matrices
mat1
andmat2
.
-
void
mpfr_mat_set
(mpfr_mat_t mat1, const mpfr_mat_t mat2)¶ Set
mat1
to the value ofmat2
.
-
void
mpfr_mat_zero
(mpfr_mat_t mat)¶ Set
mat
to the zero matrix.
Comparison¶
-
int
mpfr_mat_equal
(const mpfr_mat_t mat1, const mpfr_mat_t mat2)¶ Return \(1\) if the two given matrices are equal, otherwise return \(0\).