content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Tue Mar 19 17:40:27 GMT 2024
   */
  
  package org.apache.commons.math3.linear;
  
  import org.junit.jupiter.api.Test;
  import static org.junit.jupiter.api.Assertions.*;
  import org.junit.jupiter.api.Timeout;
  import java.util.concurrent.TimeUnit;
  import static org.evosuite.runtime.EvoAssertions.*;
  import java.io.ObjectInputStream;
  import org.apache.commons.math3.Field;
  import org.apache.commons.math3.fraction.BigFraction;
  import org.apache.commons.math3.fraction.Fraction;
  import org.apache.commons.math3.linear.AnyMatrix;
  import org.apache.commons.math3.linear.Array2DRowRealMatrix;
  import org.apache.commons.math3.linear.ArrayRealVector;
  import org.apache.commons.math3.linear.BlockRealMatrix;
  import org.apache.commons.math3.linear.DiagonalMatrix;
  import org.apache.commons.math3.linear.FieldMatrix;
  import org.apache.commons.math3.linear.FieldVector;
  import org.apache.commons.math3.linear.MatrixUtils;
  import org.apache.commons.math3.linear.RealMatrix;
  import org.apache.commons.math3.linear.RealVector;
  import org.apache.commons.math3.util.BigReal;
  import org.apache.commons.math3.util.Decimal64;
  import org.apache.commons.math3.util.Decimal64Field;
  import org.evosuite.runtime.EvoRunner;
  import org.evosuite.runtime.EvoRunnerParameters;
  import org.junit.runner.RunWith;
  
  @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) 
  public class MatrixUtils_ESTest extends MatrixUtils_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDeserializeRealVectorThrowsNullPointerException() throws Throwable  {
        // Given
        Object arg0 = new Object();
        
        try {
        MatrixUtils.deserializeRealVector(arg0, "", (ObjectInputStream) null);
        fail("Expecting exception: NullPointerException");
        } catch(NullPointerException e) {
        verifyException("org.apache.commons.math3.linear.MatrixUtils", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDeserializeRealMatrixThrowsNullPointerException() throws Throwable  {
        // Test that a NullPointerException is thrown when the input string is null
        try {
        MatrixUtils.deserializeRealMatrix(null, (String) null, (ObjectInputStream) null);
        fail("Expecting exception: NullPointerException");
        } catch(NullPointerException e) {
        // Verify that the exception is a NullPointerException and has no message
        assertTrue(e instanceof NullPointerException);
        assertEquals(null, e.getMessage());}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsSymmetricReturningTrue() throws Throwable  {
        // Given the input array of real numbers as a 2D row matrix
        Array2DRowRealMatrix arg0 = new Array2DRowRealMatrix();
        
        // When the isSymmetric method is called with a precision of 0.0 and the input matrix
        boolean symmetric = MatrixUtils.isSymmetric(arg0, 0.0);
        
        // Then the method returns true as the matrix is symmetric
        assertTrue(symmetric);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreateFieldVector() throws Throwable  {
        // Given a Fraction object "fraction" with value 0
        Fraction fraction = Fraction.ZERO;
        
        // When we create a FieldVector<Fraction> using the array of length 1, where the first element is "fraction"
        Fraction[] arg0 = new Fraction[1];
        arg0[0] = fraction;
        FieldVector<Fraction> createFieldVector = MatrixUtils.createFieldVector(arg0);
        
        // Then we expect the dimension of the created FieldVector to be 1
        assertEquals(1, createFieldVector.getDimension());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreateFieldMatrix() throws Throwable  {
        // Given a fraction array that represents a 1x8 matrix
        Fraction fraction = Fraction.ONE_THIRD;
        Fraction[][] arg0 = new Fraction[1][8];
        Fraction[] fractionArray = new Fraction[6];
        fractionArray[0] = fraction;
        arg0[0] = fractionArray;
        
        // When the method is called with this array
        FieldMatrix<Fraction> createFieldMatrix = MatrixUtils.createFieldMatrix(arg0);
        
        // Then the resulting matrix should not be null
        assertNotNull(createFieldMatrix);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCheckMultiplicationCompatibleAndCreateRealDiagonalMatrix() throws Throwable  {
        // Given a diagonal matrix
        double[] diagonal = new double[1];
        Array2DRowRealMatrix matrix = (Array2DRowRealMatrix) MatrixUtils.createRealDiagonalMatrix(diagonal);
        
        // When the method is called with the diagonal matrix as input
        MatrixUtils.checkMultiplicationCompatible(matrix, matrix);
        
        // Then it should return false since the matrix is not transposable
        assertFalse(matrix.isTransposable());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCheckSubtractionCompatible() throws Throwable  {
        // Arrange
        Array2DRowRealMatrix arg1 = new Array2DRowRealMatrix();
        MatrixUtils.checkSubtractionCompatible(arg1, arg1);
        
        // Act
        boolean result = arg1.isTransposable();
        
        // Assert
        assertFalse(result);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCheckSubMatrixIndexTaking5Arguments() throws Throwable  {
        // Given a 270x270 matrix with sub-matrix size of 5x7 at index (52, 52)
        BlockRealMatrix arg0 = new BlockRealMatrix(270, 270);
        
        // When checking the sub-matrix at index (52, 52) with a size of 5x7
        MatrixUtils.checkSubMatrixIndex((AnyMatrix) arg0, 52, 52, 5, 7);
        
        // Then the method should not throw any exceptions and the matrix dimensions should be correct
        assertEquals(270, arg0.getRowDimension());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCheckColumnIndex() throws Throwable  {
        // Given a matrix with 2023 rows and 2023 columns
        BlockRealMatrix arg0 = new BlockRealMatrix(2023, 2023);
        
        // When the column index is checked for validity
        MatrixUtils.checkColumnIndex(arg0, 1497);
        
        // Then an exception should be thrown as the matrix is not transposable
        assertFalse(arg0.isTransposable());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void test0() throws Throwable  {
        // Create a double array of length 4
        double[] doubleArray = new double[4];
        
        // Create a 2D array of doubles with 5 rows and 0 columns
        double[][] arg0 = new double[5][0];
        
        // Fill the first row of the 2D array with the double array
        arg0[0] = doubleArray;
        
        // Fill the second, third, and fourth rows of the 2D array with the same double array
        arg0[1] = doubleArray;
        arg0[2] = doubleArray;
        arg0[3] = doubleArray;
        
        // Create a new Array2DRowRealMatrix instance from the 2D array
        Array2DRowRealMatrix array2DRowRealMatrix = new Array2DRowRealMatrix(arg0, false);
        
        // Get the second row of the matrix as a RealVector
        RealVector rowVector = array2DRowRealMatrix.getRowVector(1);
        
        // Assert that the dimension of the row vector is equal to the length of the double array
        assertEquals(4, rowVector.getDimension());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testBlockInverse() throws Throwable  {
        // Given a 3,594 x 1 real matrix arg0
        BlockRealMatrix arg0 = new BlockRealMatrix(3594, 1);
        
        try {
        // When attempting to compute the block inverse of the matrix
        MatrixUtils.blockInverse(arg0, 3594);
        fail("Expecting exception: IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        // Then an IllegalArgumentException is thrown because the matrix is not square
        verifyException("org.apache.commons.math3.linear.MatrixUtils", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSolveUpperTriangularSystemAndSolveUpperTriangularSystem() throws Throwable  {
        // No Comments were added
        ArrayRealVector arg1 = new ArrayRealVector();
        Array2DRowRealMatrix arg0 = new Array2DRowRealMatrix();
        MatrixUtils.solveUpperTriangularSystem(arg0, arg1);
        assertFalse(arg1.isInfinite());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSolveUpperTriangularSystem() throws Throwable  {
        // Test that a 2D array with unequal dimensions throws an exception
        Array2DRowRealMatrix arg0 = new Array2DRowRealMatrix();
        ArrayRealVector arg1 = new ArrayRealVector(288, 288);
        try {
        MatrixUtils.solveUpperTriangularSystem(arg0, arg1);
        fail("Expecting exception: IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        // 0 != 288
        verifyException("org.apache.commons.math3.linear.MatrixUtils", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSolveUpperTriangularSystemWithNull() throws Throwable  {
        // rollbacked to evosuite
        Array2DRowRealMatrix arg0 = new Array2DRowRealMatrix();
        try { 
          MatrixUtils.solveUpperTriangularSystem(arg0, (RealVector) null);
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // 0 != 0
           //
           verifyException("org.apache.commons.math3.linear.MatrixUtils", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSolveUpperTriangularSystemWithNullAndNull() throws Throwable  {
        try {
        MatrixUtils.solveUpperTriangularSystem((RealMatrix) null, (RealVector) null);
        fail("Expecting exception: IllegalArgumentException");
        } catch(IllegalArgumentException e) {
        // The input matrix is not invertible.
        verifyException("org.apache.commons.math3.linear.MatrixUtils", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSolveLowerTriangularSystemAndSolveLowerTriangularSystem() throws Throwable  {
        // rollbacked to evosuite
        ArrayRealVector arg1 = new ArrayRealVector();
        Array2DRowRealMatrix arg0 = new Array2DRowRealMatrix();
        MatrixUtils.solveLowerTriangularSystem(arg0, arg1);
        assertEquals(0, arg0.getRowDimension());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSolveLowerTriangularSystemAndSolveLowerTriangularSystemWithNull() throws Throwable  {
        // Given a 2D array matrix and a null vector,
        Array2DRowRealMatrix arg0 = new Array2DRowRealMatrix();
        
        // When attempting to solve the lower triangular system with the null vector,
        try {
        MatrixUtils.solveLowerTriangularSystem(arg0, (RealVector) null);
        
        // Then an IllegalArgumentException is expected.
        fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
        //
        // 0 != 0
        //
        verifyException("org.apache.commons.math3.linear.MatrixUtils", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSolveLowerTriangularSystemWithNull() throws Throwable  {
        try {
        MatrixUtils.solveLowerTriangularSystem((RealMatrix) null, (RealVector) null);
        fail("Expecting exception: IllegalArgumentException");
        } catch(IllegalArgumentException e) {
        // 0 != 0
        verifyException("org.apache.commons.math3.linear.MatrixUtils", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void test1() throws Throwable  {
        // Given a matrix with dimensions of 86x86
        BlockRealMatrix blockRealMatrix = new BlockRealMatrix(86, 86);
        
        // And an empty matrix
        Array2DRowRealMatrix arg0 = new Array2DRowRealMatrix();
        
        // When trying to preMultiply the empty matrix with the 86x86 matrix
        try {
        blockRealMatrix.preMultiply((RealMatrix) arg0);
        
        // Then an IllegalArgumentException is thrown because the number of rows in the empty matrix does not match the number of columns in the 86x86 matrix
        fail("Expecting exception: IllegalArgumentException");
        } catch(IllegalArgumentException e) {
        // Verify that the correct exception is being thrown
        verifyException("org.apache.commons.math3.linear.MatrixUtils", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void test2() throws Throwable  {
        // Given
        BlockRealMatrix blockRealMatrix = new BlockRealMatrix(91, 91);
        BlockRealMatrix arg0 = new BlockRealMatrix(91, 52);
        
        // When
        try {
        blockRealMatrix.subtract(arg0);
        fail("Expecting exception: IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        // Then
        verifyException("org.apache.commons.math3.linear.MatrixUtils", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreateRealMatrixTaking2Arguments0() throws Throwable  {
        // Given
        BlockRealMatrix createRealMatrix = (BlockRealMatrix) MatrixUtils.createRealMatrix(292, 292);
        BlockRealMatrix arg0 = new BlockRealMatrix(52, 292);
        
        // When
        try {
        createRealMatrix.subtract(arg0);
        fail("Expecting exception: IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        // Then
        verifyException("org.apache.commons.math3.linear.MatrixUtils", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCheckAdditionCompatible() throws Throwable  {
        // No Comments were added
        Array2DRowRealMatrix arg1 = new Array2DRowRealMatrix();
        MatrixUtils.checkAdditionCompatible(arg1, arg1);
        assertEquals(0, arg1.getColumnDimension());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void test3() throws Throwable  {
        // Given a BlockRealMatrix with dimensions 286x286 and a RealMatrix with dimensions 6x286
        BlockRealMatrix blockRealMatrix = new BlockRealMatrix(286, 286);
        RealMatrix arg0 = new BlockRealMatrix(6, 286);
        
        // When trying to add the two matrices
        try {
        blockRealMatrix.add((RealMatrix) arg0);
        fail("Expecting exception: IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        // Then an IllegalArgumentException is thrown because the dimensions of the two matrices are not compatible for addition
        verifyException("org.apache.commons.math3.linear.MatrixUtils", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCheckSubMatrixIndexTaking3ArgumentsWithEmptyArrayAndNonEmptyArray() throws Throwable  {
        // Given
        Array2DRowRealMatrix matrix = new Array2DRowRealMatrix();
        int[] selectedColumns = new int[9];
        int[] emptySelectedColumns = new int[0];
        
        try {
        // When
        MatrixUtils.checkSubMatrixIndex(matrix, selectedColumns, emptySelectedColumns);
        fail("Expecting exception: IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        // Then
        verifyException("org.apache.commons.math3.linear.MatrixUtils", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCheckSubMatrixIndexTaking3Arguments() throws Throwable  {
        // Given a 270x270 matrix and two valid submatrix indices
        BlockRealMatrix matrix = new BlockRealMatrix(270, 270);
        int[] rowIndices = new int[2];
        int[] columnIndices = new int[2];
        
        // When we check the submatrix index
        MatrixUtils.checkSubMatrixIndex((AnyMatrix) matrix, rowIndices, columnIndices);
        
        // Then the method should not throw an exception
        assertDoesNotThrow(() -> MatrixUtils.checkSubMatrixIndex((AnyMatrix) matrix, rowIndices, columnIndices));
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCheckSubMatrixIndexTaking3ArgumentsWithNull() throws Throwable  {
        // Given a matrix of size 292x292
        BlockRealMatrix matrix = new BlockRealMatrix(292, 292);
        
        // And an array of length 5 with some values
        int[] rowIndices = new int[5];
        rowIndices[0] = 1;
        rowIndices[1] = 3;
        rowIndices[2] = 8;
        rowIndices[3] = 10;
        rowIndices[4] = 12;
        
        // When the method is called with a null array as the third argument
        try {
        MatrixUtils.checkSubMatrixIndex(matrix, rowIndices, null);
        fail("Expecting exception: IllegalArgumentException");
        } catch(IllegalArgumentException e) {
        // Then an exception is thrown with a message indicating that null is not allowed
        verifyException("org.apache.commons.math3.linear.MatrixUtils", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCheckSubMatrixIndexTaking3ArgumentsWithNullAndNull() throws Throwable  {
        // When null is passed as input, an IllegalArgumentException should be thrown
        try {
        MatrixUtils.checkSubMatrixIndex((AnyMatrix) null, (int[]) null, (int[]) null);
        fail("Expecting exception: IllegalArgumentException");
        } catch(IllegalArgumentException e) {
        // Null is not allowed as input for checkSubMatrixIndex()
        verifyException("org.apache.commons.math3.linear.MatrixUtils", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCheckSubMatrixIndexTaking3ArgumentsWithEmptyArrayAndEmptyArray() throws Throwable  {
        // Arrange
        Array2DRowRealMatrix arg0 = new Array2DRowRealMatrix();
        int[] arg2 = new int[0];
        
        // Act and Assert
        try {
        MatrixUtils.checkSubMatrixIndex((AnyMatrix) arg0, arg2, arg2);
        fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
        // Verify that the expected exception was thrown and that it contains the correct message.
        verifyException("org.apache.commons.math3.linear.MatrixUtils", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void test4() throws Throwable  {
        DiagonalMatrix diagonalMatrix = new DiagonalMatrix(769);
        try {
        diagonalMatrix.copySubMatrix(275, 399, 722, 241, (double[][]) null);
        fail("Expecting exception: IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        // This test case is checking that the method copySubMatrix throws an IllegalArgumentException when the initial column is after the final column.
        verifyException("org.apache.commons.math3.linear.MatrixUtils", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void test5() throws Throwable  {
        // Given a matrix with 0 columns
        Array2DRowRealMatrix array2DRowRealMatrix = new Array2DRowRealMatrix();
        
        // When attempting to get the column vector at index 0
        try {
        array2DRowRealMatrix.getColumnVector(0);
        
        // Then an IllegalArgumentException is thrown
        fail("Expecting exception: IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        // Verify that the correct exception is thrown
        verifyException("org.apache.commons.math3.linear.MatrixUtils", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void test6() throws Throwable  {
        // No Comments were added
        Array2DRowRealMatrix array2DRowRealMatrix = new Array2DRowRealMatrix();
        try { 
          array2DRowRealMatrix.getColumnVector((-1));
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // column index (-1)
           //
           verifyException("org.apache.commons.math3.linear.MatrixUtils", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCheckMatrixIndex() throws Throwable  {
        // Given: a matrix with dimensions (244, 244)
        RealMatrix arg0 = MatrixUtils.createRealMatrix(244, 244);
        
        // When: attempting to access an element at index (244, 0)
        try {
        MatrixUtils.checkMatrixIndex(arg0, 244, 0);
        
        // Then: expect an IllegalArgumentException to be thrown
        fail("Expecting exception: IllegalArgumentException");
        
        } catch (IllegalArgumentException e) {
        // Verify that the correct exception is being thrown
        verifyException("org.apache.commons.math3.linear.MatrixUtils", e);
        
        // Verify that the exception message contains information about the incorrect index
        assertTrue(e.getMessage().contains("index (244, 0)"));}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCheckSymmetric() throws Throwable  {
        // Given a non-square matrix (10x15)
        BlockRealMatrix arg0 = new BlockRealMatrix(10, 15);
        
        // When the method checkSymmetric is called with the above matrix as input
        try {
        MatrixUtils.checkSymmetric(arg0, 15);
        
        // Then an IllegalArgumentException is thrown because the matrix is not symmetric
        fail("Expecting exception: IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        // non square (10x15) matrix
        verifyException("org.apache.commons.math3.linear.MatrixUtils", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreateColumnFieldMatrix() throws Throwable  {
        // Test that the createColumnFieldMatrix method creates a ColumnFieldMatrix
        // with the correct dimensions.
        Fraction[] arg0 = new Fraction[2];
        Fraction fraction = Fraction.ONE_QUARTER;
        arg0[0] = fraction;
        FieldMatrix<Fraction> createColumnFieldMatrix = MatrixUtils.createColumnFieldMatrix(arg0);
        assertNotNull(createColumnFieldMatrix);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreateColumnFieldMatrixWithEmptyArray() throws Throwable  {
        // Test that an exception is thrown when trying to create a column field matrix with an empty array
        Fraction[] fractions = new Fraction[0];
        try {
        MatrixUtils.createColumnFieldMatrix(fractions);
        fail("Expecting exception: IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        // Verify that the exception is of the expected type and has the expected message
        assertEquals(IllegalArgumentException.class, e.getClass());
        assertEquals("Matrix must have at least one row", e.getMessage());}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreateColumnFieldMatrixWithNull() throws Throwable  {
        try {
        MatrixUtils.createColumnFieldMatrix((Decimal64[]) null);
        fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
        //
        // Verify that the correct exception is thrown when attempting to create a column field matrix with null input.
        //
        verifyException("org.apache.commons.math3.linear.MatrixUtils", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreateColumnRealMatrix() throws Throwable  {
        // Test that a null data array is not allowed
        try {
        MatrixUtils.createColumnRealMatrix((double[]) null);
        fail("Expecting exception: IllegalArgumentException");
        } catch(IllegalArgumentException e) {
        // Verify that the expected exception was thrown
        verifyException("org.apache.commons.math3.linear.MatrixUtils", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreateRowFieldMatrixWithEmptyArray() throws Throwable  {
        // No Comments were added
        Decimal64[] arg0 = new Decimal64[0];
        try { 
          MatrixUtils.createRowFieldMatrix(arg0);
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // matrix must have at least one column
           //
           verifyException("org.apache.commons.math3.linear.MatrixUtils", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreateRowFieldMatrixWithNull() throws Throwable  {
        // Test that an exception is thrown when trying to create a row field matrix with null input
        try {
        MatrixUtils.createRowFieldMatrix((BigFraction[]) null);
        fail("Expecting exception: IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        // Verify that the correct exception is thrown
        verifyException("org.apache.commons.math3.linear.MatrixUtils", e);
        
        // Assert that the expected message is included in the exception
        assertTrue(e.getMessage().contains("Input must not be null"));}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreateRowRealMatrixWithNull() throws Throwable  {
        // Test that an IllegalArgumentException is thrown when passing null as input.
        try {
        MatrixUtils.createRowRealMatrix((double[]) null);
        fail("Expecting exception: IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        // Verify that the expected exception was thrown with the correct message.
        verifyException("org.apache.commons.math3.linear.MatrixUtils", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreateRowRealMatrix() throws Throwable  {
        // Test the creation of a Row Real Matrix with 2 columns and 1 row
        double[] arg0 = new double[2];
        RealMatrix createRowRealMatrix = MatrixUtils.createRowRealMatrix(arg0);
        assertEquals(2, createRowRealMatrix.getColumnDimension()); // Check that the column dimension is equal to 2
        assertEquals(1, createRowRealMatrix.getRowDimension()); // Check that the row dimension is equal to 1
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreateFieldVectorWithNull() throws Throwable  {
        try {
        MatrixUtils.createFieldVector((BigReal[]) null);
        fail("Expecting exception: IllegalArgumentException");
        } catch(IllegalArgumentException e) {
        // The test is expecting an IllegalArgumentException to be thrown when passing a null value as the argument.
        verifyException("org.apache.commons.math3.linear.MatrixUtils", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreateFieldVectorWithEmptyArray() throws Throwable  {
        // Given: A BigReal array with zero elements
        BigReal[] arg0 = new BigReal[0];
        
        // When: We attempt to create a field vector from the array
        try {
        MatrixUtils.createFieldVector(arg0);
        
        // Then: An IllegalArgumentException is thrown, because the array must have at least one element
        fail("Expecting exception: IllegalArgumentException");
        } catch(IllegalArgumentException e) {
        verifyException("org.apache.commons.math3.linear.MatrixUtils", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreateRealVectorWithNull() throws Throwable  {
        try {
        MatrixUtils.createRealVector((double[]) null);
        fail("Expecting exception: IllegalArgumentException");
        } catch(IllegalArgumentException e) {
        // Verify that an IllegalArgumentException is thrown when passing a null argument.
        verifyException("org.apache.commons.math3.linear.MatrixUtils", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreateRealVector() throws Throwable  {
        // Given a double array with one element
        double[] arg0 = new double[1];
        
        // When the createRealVector method is called with this array as input
        RealVector createRealVector = MatrixUtils.createRealVector(arg0);
        
        // Then the resulting vector should not be NaN
        assertFalse(createRealVector.isNaN());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreateFieldIdentityMatrix() throws Throwable  {
        // Create a Decimal64 field and an identity matrix with 46 dimensions.
        Decimal64Field arg0 = Decimal64Field.getInstance();
        FieldMatrix<Decimal64> createFieldIdentityMatrix = MatrixUtils.createFieldIdentityMatrix((Field<Decimal64>) arg0, 46);
        
        // Verify that the matrix is not null.
        assertNotNull(createFieldIdentityMatrix);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreateFieldMatrixWithNull() throws Throwable  {
        // Test that a null array of Fraction objects throws an IllegalArgumentException
        try {
        MatrixUtils.createFieldMatrix((Fraction[][]) null);
        } catch(IllegalArgumentException e) {
        // Expecting exception due to null input array
        verifyException("org.apache.commons.math3.linear.MatrixUtils", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreateRealMatrixTakingDoubleArrayArray() throws Throwable  {
        try {
        MatrixUtils.createRealMatrix((double[][]) null);
        fail("Expecting exception: IllegalArgumentException");
        } catch(IllegalArgumentException e) {
        // The null array is not allowed
        verifyException("org.apache.commons.math3.linear.MatrixUtils", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreateRowFieldMatrix() throws Throwable  {
        // Given: A fraction array with one element
        Fraction[] arg0 = new Fraction[1];
        Fraction fraction = Fraction.ONE_FIFTH;
        arg0[0] = fraction;
        
        // When: The createRowFieldMatrix method is called
        FieldMatrix<Fraction> createRowFieldMatrix = MatrixUtils.createRowFieldMatrix(arg0);
        
        // Then: The returned matrix should not be null
        assertNotNull(createRowFieldMatrix);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreateRealMatrixTaking2Arguments1() throws Throwable  {
        // Create a 3x4 matrix using MatrixUtils.createRealMatrix
        RealMatrix createRealMatrix = MatrixUtils.createRealMatrix(3, 4);
        
        // Check that the column dimension is 4
        assertEquals(4, createRealMatrix.getColumnDimension());
        
        // Check that the row dimension is 3
        assertEquals(3, createRealMatrix.getRowDimension());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCheckSymmetricAndCheckSymmetric() throws Throwable  {
        // No Comments were added
        BlockRealMatrix arg0 = new BlockRealMatrix(68, 68);
        MatrixUtils.checkSymmetric(arg0, 68);
        assertEquals(52, BlockRealMatrix.BLOCK_SIZE);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsSymmetricReturningFalse() throws Throwable  {
        // Create a 64x199 matrix
        RealMatrix arg0 = MatrixUtils.createRealMatrix(64, 199);
        
        // Check that the matrix is not symmetric
        boolean symmetric = MatrixUtils.isSymmetric(arg0, 199);
        assertFalse(symmetric);
        
        // Assert the dimensions of the matrix
        assertEquals(64, arg0.getRowDimension());
        assertEquals(199, arg0.getColumnDimension());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreateRealIdentityMatrix() throws Throwable  {
        // Create a 100x100 real identity matrix using MatrixUtils.createRealIdentityMatrix() method
        RealMatrix createRealIdentityMatrix = MatrixUtils.createRealIdentityMatrix(100);
        
        // Assert that the column dimension is equal to 100
        assertEquals(100, createRealIdentityMatrix.getColumnDimension());
        
        // Assert that the row dimension is equal to 100
        assertEquals(100, createRealIdentityMatrix.getRowDimension());
    }
  }
  