<commit_before>#include<2D_element_arithmetic.h>

static int pow_test(matrix * m);
static int mul_div_test(matrix *m);
static int fill_matrix_test(matrix * m);
static int sum_matrix_test(matrix * m);
static int elem_row_test(void);
static int elem_column_test(void);

int main(void) {
    printf("Executing tests for 2D_element_arithmetic.c\n");

    int a[2][3] = {
        {1,2,3},
        {4,5,6}
    };

    matrix * m = initialise_matrix(2, 3);
    for(int i = 0; i < get_rows(m); i++) { 
        for(int j = 0; j < get_columns(m); j++) {
            set_matrix_member(m, i+1, j+1, a[i][j]);
        }
    }

    matrix * n = initialise_matrix(10, 10);
    pow_test(m);
    mul_div_test(m);
    fill_matrix_test(n);


    int b[3][3] = {
        {1,3,2},
        {4,2,5},
        {6,1,4}
    };

    matrix * o = initialise_matrix(3, 3);
    for(int i = 0; i < get_rows(o); i++) { 
        for(int j = 0; j < get_columns(o); j++) {
            set_matrix_member(o, i+1, j+1, b[i][j]);
        }
    }
    sum_matrix_test(o);
    sum_matrix_test(m);
    elem_row_test();
    elem_column_test();

    destroy_matrix(&o);
    destroy_matrix(&m);
    destroy_matrix(&n);
    return 0;

}

/* Tests whether all elements in the matrix are being squared */
static int pow_test(matrix * m) {
    printf("\nCubing all elements in the matrix\n");
    printf("Before \n");
    print_matrix(m);
    elem_matrix_operation(&pow_elem, m, 3);
    printf("After\n");
    print_matrix(m);

    printf("Applying the third root to all elements in the matrix\n");
    elem_matrix_operation(&sqroot_elem, m, 3);
    print_matrix(m);

    return 0;
}<commit_msg>Modify member entry for element tests to accomodate fixed val pts<commit_after>#include<2D_element_arithmetic.h>

static int pow_test(matrix * m);
static int mul_div_test(matrix *m);
static int fill_matrix_test(matrix * m);
static int sum_matrix_test(matrix * m);
static int elem_row_test(void);
static int elem_column_test(void);

int main(void) {
    printf("Executing tests for 2D_element_arithmetic.c\n");

    int a[2][3] = {
        {1,2,3},
        {4,5,6}
    };

    matrix * m = initialise_matrix(2, 3);
    for(int i = 0; i < get_rows(m); i++) { 
        for(int j = 0; j < get_columns(m); j++) {
            #ifdef FIXED
                elem val = fix16_from_int(a[i][j]);
            #else
                elem val = a[i][j];
            #endif
            set_matrix_member(m, i+1, j+1, val);
        }
    }

    matrix * n = initialise_matrix(10, 10);
    pow_test(m);
    mul_div_test(m);
    fill_matrix_test(n);


    int b[3][3] = {
        {1,3,2},
        {4,2,5},
        {6,1,4}
    };

    matrix * o = initialise_matrix(3, 3);
    for(int i = 0; i < get_rows(o); i++) { 
        for(int j = 0; j < get_columns(o); j++) {
            #ifdef FIXED
                elem val = fix16_from_int(b[i][j]);
            #else
                elem val = b[i][j];
            #endif
            set_matrix_member(o, i+1, j+1, val);
        }
    }
    sum_matrix_test(o);
    sum_matrix_test(m);
    elem_row_test();
    elem_column_test();

    destroy_matrix(&o);
    destroy_matrix(&m);
    destroy_matrix(&n);
    return 0;

}

/* Tests whether all elements in the matrix are being squared */
static int pow_test(matrix * m) {
    printf("\nCubing all elements in the matrix\n");
    printf("Before \n");
    print_matrix(m);
    elem_matrix_operation(&pow_elem, m, 3);
    printf("After\n");
    print_matrix(m);

    printf("Applying the third root to all elements in the matrix\n");
    elem_matrix_operation(&sqroot_elem, m, 3);
    print_matrix(m);

    return 0;
}
{'fraction_non_alphanumeric': 0.14977973568281938, 'fraction_numerical': 0.0236784140969163, 'mean_word_length': 2.5374878286270692, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '962294', 'n_tokens_mistral': 1383, 'n_tokens_neox': 1323, 'n_words': 306}