diff --git a/src/arb/ComplexMat.jl b/src/arb/ComplexMat.jl index 21ee29d260..aabab65069 100644 --- a/src/arb/ComplexMat.jl +++ b/src/arb/ComplexMat.jl @@ -616,14 +616,6 @@ end # ################################################################################ -function swap_rows(x::ComplexMatrix, i::Int, j::Int) - _checkbounds(nrows(x), i) || throw(BoundsError()) - _checkbounds(nrows(x), j) || throw(BoundsError()) - z = deepcopy(x) - swap_rows!(z, i, j) - return z -end - function swap_rows!(x::ComplexMatrix, i::Int, j::Int) @ccall libflint.acb_mat_swap_rows(x::Ref{ComplexMatrix}, C_NULL::Ptr{Nothing}, (i - 1)::Int, (j - 1)::Int)::Nothing end diff --git a/src/arb/RealMat.jl b/src/arb/RealMat.jl index 5a8ffdcd45..b3aee3e2fe 100644 --- a/src/arb/RealMat.jl +++ b/src/arb/RealMat.jl @@ -562,14 +562,6 @@ end # ################################################################################ -function swap_rows(x::RealMatrix, i::Int, j::Int) - _checkbounds(nrows(x), i) || throw(BoundsError()) - _checkbounds(nrows(x), j) || throw(BoundsError()) - z = deepcopy(x) - swap_rows!(z, i, j) - return z -end - function swap_rows!(x::RealMatrix, i::Int, j::Int) @ccall libflint.arb_mat_swap_rows(x::Ref{RealMatrix}, C_NULL::Ptr{Nothing}, (i - 1)::Int, (j - 1)::Int)::Nothing end diff --git a/src/arb/acb_mat.jl b/src/arb/acb_mat.jl index bbe7a1c3b4..ac99fc1e50 100644 --- a/src/arb/acb_mat.jl +++ b/src/arb/acb_mat.jl @@ -617,14 +617,6 @@ end # ################################################################################ -function swap_rows(x::AcbMatrix, i::Int, j::Int) - _checkbounds(nrows(x), i) || throw(BoundsError()) - _checkbounds(nrows(x), j) || throw(BoundsError()) - z = deepcopy(x) - swap_rows!(z, i, j) - return z -end - function swap_rows!(x::AcbMatrix, i::Int, j::Int) @ccall libflint.acb_mat_swap_rows(x::Ref{AcbMatrix}, C_NULL::Ptr{Nothing}, (i - 1)::Int, (j - 1)::Int)::Nothing end diff --git a/src/arb/arb_mat.jl b/src/arb/arb_mat.jl index 0fbdb35a34..18edf2eb94 100644 --- a/src/arb/arb_mat.jl +++ b/src/arb/arb_mat.jl @@ -585,14 +585,6 @@ end # ################################################################################ -function swap_rows(x::ArbMatrix, i::Int, j::Int) - _checkbounds(nrows(x), i) || throw(BoundsError()) - _checkbounds(nrows(x), j) || throw(BoundsError()) - z = deepcopy(x) - swap_rows!(z, i, j) - return z -end - function swap_rows!(x::ArbMatrix, i::Int, j::Int) @ccall libflint.arb_mat_swap_rows(x::Ref{ArbMatrix}, C_NULL::Ptr{Nothing}, (i - 1)::Int, (j - 1)::Int)::Nothing end diff --git a/src/flint/fmpq_mat.jl b/src/flint/fmpq_mat.jl index 25af8c9dca..32757b92bf 100644 --- a/src/flint/fmpq_mat.jl +++ b/src/flint/fmpq_mat.jl @@ -223,37 +223,21 @@ function swap_rows!(x::QQMatrixOrPtr, i::Int, j::Int) return x end -function swap_rows(x::QQMatrix, i::Int, j::Int) - (1 <= i <= nrows(x) && 1 <= j <= nrows(x)) || throw(BoundsError()) - y = deepcopy(x) - return swap_rows!(y, i, j) -end - function swap_cols!(x::QQMatrixOrPtr, i::Int, j::Int) @ccall libflint.fmpq_mat_swap_cols(x::Ref{QQMatrix}, C_NULL::Ptr{Nothing}, (i - 1)::Int, (j - 1)::Int)::Nothing return x end -function swap_cols(x::QQMatrix, i::Int, j::Int) - (1 <= i <= ncols(x) && 1 <= j <= ncols(x)) || throw(BoundsError()) - y = deepcopy(x) - return swap_cols!(y, i, j) -end - function reverse_rows!(x::QQMatrixOrPtr) @ccall libflint.fmpq_mat_invert_rows(x::Ref{QQMatrix}, C_NULL::Ptr{Nothing})::Nothing return x end -reverse_rows(x::QQMatrix) = reverse_rows!(deepcopy(x)) - function reverse_cols!(x::QQMatrixOrPtr) @ccall libflint.fmpq_mat_invert_cols(x::Ref{QQMatrix}, C_NULL::Ptr{Nothing})::Nothing return x end -reverse_cols(x::QQMatrix) = reverse_cols!(deepcopy(x)) - ############################################################################### # # Binary operations diff --git a/src/flint/fmpz_mat.jl b/src/flint/fmpz_mat.jl index f94aa3c955..f479e9dff1 100644 --- a/src/flint/fmpz_mat.jl +++ b/src/flint/fmpz_mat.jl @@ -230,37 +230,21 @@ function swap_rows!(x::ZZMatrix, i::Int, j::Int) return x end -function swap_rows(x::ZZMatrix, i::Int, j::Int) - (1 <= i <= nrows(x) && 1 <= j <= nrows(x)) || throw(BoundsError()) - y = deepcopy(x) - return swap_rows!(y, i, j) -end - function swap_cols!(x::ZZMatrix, i::Int, j::Int) @ccall libflint.fmpz_mat_swap_cols(x::Ref{ZZMatrix}, C_NULL::Ptr{Nothing}, (i - 1)::Int, (j - 1)::Int)::Nothing return x end -function swap_cols(x::ZZMatrix, i::Int, j::Int) - (1 <= i <= ncols(x) && 1 <= j <= ncols(x)) || throw(BoundsError()) - y = deepcopy(x) - return swap_cols!(y, i, j) -end - function reverse_rows!(x::ZZMatrix) @ccall libflint.fmpz_mat_invert_rows(x::Ref{ZZMatrix}, C_NULL::Ptr{Nothing})::Nothing return x end -reverse_rows(x::ZZMatrix) = reverse_rows!(deepcopy(x)) - function reverse_cols!(x::ZZMatrix) @ccall libflint.fmpz_mat_invert_cols(x::Ref{ZZMatrix}, C_NULL::Ptr{Nothing})::Nothing return x end -reverse_cols(x::ZZMatrix) = reverse_cols!(deepcopy(x)) - ############################################################################### # # Binary operations diff --git a/src/flint/fmpz_mod_mat.jl b/src/flint/fmpz_mod_mat.jl index 0cfbbbf094..abd7314017 100644 --- a/src/flint/fmpz_mod_mat.jl +++ b/src/flint/fmpz_mod_mat.jl @@ -135,37 +135,21 @@ function swap_rows!(x::T, i::Int, j::Int) where T <: Zmod_fmpz_mat return x end -function swap_rows(x::T, i::Int, j::Int) where T <: Zmod_fmpz_mat - (1 <= i <= nrows(x) && 1 <= j <= nrows(x)) || throw(BoundsError()) - y = deepcopy(x) - return swap_rows!(y, i, j) -end - function swap_cols!(x::T, i::Int, j::Int) where T <: Zmod_fmpz_mat @ccall libflint.fmpz_mod_mat_swap_cols(x::Ref{T}, C_NULL::Ptr{Nothing}, (i - 1)::Int, (j - 1)::Int)::Nothing return x end -function swap_cols(x::T, i::Int, j::Int) where T <: Zmod_fmpz_mat - (1 <= i <= ncols(x) && 1 <= j <= ncols(x)) || throw(BoundsError()) - y = deepcopy(x) - return swap_cols!(y, i, j) -end - function reverse_rows!(x::T) where T <: Zmod_fmpz_mat @ccall libflint.fmpz_mod_mat_invert_rows(x::Ref{T}, C_NULL::Ptr{Nothing})::Nothing return x end -reverse_rows(x::T) where T <: Zmod_fmpz_mat = reverse_rows!(deepcopy(x)) - function reverse_cols!(x::T) where T <: Zmod_fmpz_mat @ccall libflint.fmpz_mod_mat_invert_cols(x::Ref{T}, C_NULL::Ptr{Nothing})::Nothing return x end -reverse_cols(x::T) where T <: Zmod_fmpz_mat = reverse_cols!(deepcopy(x)) - ################################################################################ # # Unary operators diff --git a/src/flint/fq_default_mat.jl b/src/flint/fq_default_mat.jl index 2ba977d72b..0ea16623ad 100644 --- a/src/flint/fq_default_mat.jl +++ b/src/flint/fq_default_mat.jl @@ -150,37 +150,21 @@ function swap_rows!(x::FqMatrix, i::Int, j::Int) return x end -function swap_rows(x::FqMatrix, i::Int, j::Int) - (1 <= i <= nrows(x) && 1 <= j <= nrows(x)) || throw(BoundsError()) - y = deepcopy(x) - return swap_rows!(y, i, j) -end - function swap_cols!(x::FqMatrix, i::Int, j::Int) @ccall libflint.fq_default_mat_swap_cols(x::Ref{FqMatrix}, C_NULL::Ptr{Nothing}, (i - 1)::Int, (j - 1)::Int, base_ring(x)::Ref{FqField})::Nothing return x end -function swap_cols(x::FqMatrix, i::Int, j::Int) - (1 <= i <= ncols(x) && 1 <= j <= ncols(x)) || throw(BoundsError()) - y = deepcopy(x) - return swap_cols!(y, i, j) -end - function reverse_rows!(x::FqMatrix) @ccall libflint.fq_default_mat_invert_rows(x::Ref{FqMatrix}, C_NULL::Ptr{Nothing}, base_ring(x)::Ref{FqField})::Nothing return x end -reverse_rows(x::FqMatrix) = reverse_rows!(deepcopy(x)) - function reverse_cols!(x::FqMatrix) @ccall libflint.fq_default_mat_invert_cols(x::Ref{FqMatrix}, C_NULL::Ptr{Nothing}, base_ring(x)::Ref{FqField})::Nothing return x end -reverse_cols(x::FqMatrix) = reverse_cols!(deepcopy(x)) - ################################################################################ # # Unary operators diff --git a/src/flint/fq_mat.jl b/src/flint/fq_mat.jl index 1aa8e6c76f..6f8d2e3d26 100644 --- a/src/flint/fq_mat.jl +++ b/src/flint/fq_mat.jl @@ -155,37 +155,21 @@ function swap_rows!(x::FqPolyRepMatrix, i::Int, j::Int) return x end -function swap_rows(x::FqPolyRepMatrix, i::Int, j::Int) - (1 <= i <= nrows(x) && 1 <= j <= nrows(x)) || throw(BoundsError()) - y = deepcopy(x) - return swap_rows!(y, i, j) -end - function swap_cols!(x::FqPolyRepMatrix, i::Int, j::Int) @ccall libflint.fq_mat_swap_cols(x::Ref{FqPolyRepMatrix}, C_NULL::Ptr{Nothing}, (i - 1)::Int, (j - 1)::Int, base_ring(x)::Ref{FqPolyRepField})::Nothing return x end -function swap_cols(x::FqPolyRepMatrix, i::Int, j::Int) - (1 <= i <= ncols(x) && 1 <= j <= ncols(x)) || throw(BoundsError()) - y = deepcopy(x) - return swap_cols!(y, i, j) -end - function reverse_rows!(x::FqPolyRepMatrix) @ccall libflint.fq_mat_invert_rows(x::Ref{FqPolyRepMatrix}, C_NULL::Ptr{Nothing}, base_ring(x)::Ref{FqPolyRepField})::Nothing return x end -reverse_rows(x::FqPolyRepMatrix) = reverse_rows!(deepcopy(x)) - function reverse_cols!(x::FqPolyRepMatrix) @ccall libflint.fq_mat_invert_cols(x::Ref{FqPolyRepMatrix}, C_NULL::Ptr{Nothing}, base_ring(x)::Ref{FqPolyRepField})::Nothing return x end -reverse_cols(x::FqPolyRepMatrix) = reverse_cols!(deepcopy(x)) - ################################################################################ # # Unary operators diff --git a/src/flint/fq_nmod_mat.jl b/src/flint/fq_nmod_mat.jl index 1832448c07..4ff8c7f868 100644 --- a/src/flint/fq_nmod_mat.jl +++ b/src/flint/fq_nmod_mat.jl @@ -143,37 +143,21 @@ function swap_rows!(x::fqPolyRepMatrix, i::Int, j::Int) return x end -function swap_rows(x::fqPolyRepMatrix, i::Int, j::Int) - (1 <= i <= nrows(x) && 1 <= j <= nrows(x)) || throw(BoundsError()) - y = deepcopy(x) - return swap_rows!(y, i, j) -end - function swap_cols!(x::fqPolyRepMatrix, i::Int, j::Int) @ccall libflint.fq_nmod_mat_swap_cols(x::Ref{fqPolyRepMatrix}, C_NULL::Ptr{Nothing}, (i - 1)::Int, (j - 1)::Int, base_ring(x)::Ref{fqPolyRepField})::Nothing return x end -function swap_cols(x::fqPolyRepMatrix, i::Int, j::Int) - (1 <= i <= ncols(x) && 1 <= j <= ncols(x)) || throw(BoundsError()) - y = deepcopy(x) - return swap_cols!(y, i, j) -end - function reverse_rows!(x::fqPolyRepMatrix) @ccall libflint.fq_nmod_mat_invert_rows(x::Ref{fqPolyRepMatrix}, C_NULL::Ptr{Nothing}, base_ring(x)::Ref{fqPolyRepField})::Nothing return x end -reverse_rows(x::fqPolyRepMatrix) = reverse_rows!(deepcopy(x)) - function reverse_cols!(x::fqPolyRepMatrix) @ccall libflint.fq_nmod_mat_invert_cols(x::Ref{fqPolyRepMatrix}, C_NULL::Ptr{Nothing}, base_ring(x)::Ref{fqPolyRepField})::Nothing return x end -reverse_cols(x::fqPolyRepMatrix) = reverse_cols!(deepcopy(x)) - ################################################################################ # # Unary operators diff --git a/src/flint/nmod_mat.jl b/src/flint/nmod_mat.jl index 9e608b5181..f2c71e119a 100644 --- a/src/flint/nmod_mat.jl +++ b/src/flint/nmod_mat.jl @@ -147,37 +147,21 @@ function swap_rows!(x::T, i::Int, j::Int) where T <: Zmodn_mat return x end -function swap_rows(x::T, i::Int, j::Int) where T <: Zmodn_mat - (1 <= i <= nrows(x) && 1 <= j <= nrows(x)) || throw(BoundsError()) - y = deepcopy(x) - return swap_rows!(y, i, j) -end - function swap_cols!(x::T, i::Int, j::Int) where T <: Zmodn_mat @ccall libflint.nmod_mat_swap_cols(x::Ref{T}, C_NULL::Ptr{Nothing}, (i - 1)::Int, (j - 1)::Int)::Nothing return x end -function swap_cols(x::T, i::Int, j::Int) where T <: Zmodn_mat - (1 <= i <= ncols(x) && 1 <= j <= ncols(x)) || throw(BoundsError()) - y = deepcopy(x) - return swap_cols!(y, i, j) -end - function reverse_rows!(x::T) where T <: Zmodn_mat @ccall libflint.nmod_mat_invert_rows(x::Ref{T}, C_NULL::Ptr{Nothing})::Nothing return x end -reverse_rows(x::T) where T <: Zmodn_mat = reverse_rows!(deepcopy(x)) - function reverse_cols!(x::T) where T <: Zmodn_mat @ccall libflint.nmod_mat_invert_cols(x::Ref{T}, C_NULL::Ptr{Nothing})::Nothing return x end -reverse_cols(x::T) where T <: Zmodn_mat = reverse_cols!(deepcopy(x)) - ################################################################################ # # Unary operators