Compare commits

..

3 Commits

Author SHA1 Message Date
04a8712b0f
read_csv doesn't work 2024-10-04 01:03:39 +02:00
808d971af6
modify .gitignore 2024-10-04 01:03:13 +02:00
6863d20530
add csv files 2024-10-04 01:02:38 +02:00
12 changed files with 242 additions and 80 deletions

55
.gitignore vendored
View File

@ -1,54 +1 @@
# ---> C
# Prerequisites
*.d
# Object files
*.o
*.ko
*.obj
*.elf
# Linker output
*.ilk
*.map
*.exp
# Precompiled Headers
*.gch
*.pch
# Libraries
*.lib
*.a
*.la
*.lo
# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib
# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex
# Debug files
*.dSYM/
*.su
*.idb
*.pdb
# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf
*.x64

24
csv/24n.csv Normal file
View File

@ -0,0 +1,24 @@
0;1;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
1;0;1;1;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
0;1;0;1;1;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
0;1;1;0;1;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
0;0;1;1;0;1;1;1;1;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
0;0;0;0;1;0;1;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
0;0;0;0;1;1;0;0;0;0;0;1;0;0;0;0;0;0;0;0;0;0;0;0
0;0;0;0;1;0;0;0;1;1;1;0;0;0;0;0;0;0;0;0;0;0;0;0
0;0;0;0;1;0;0;1;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
0;0;0;0;0;0;0;1;0;0;1;0;0;0;0;0;0;0;0;0;0;0;0;0
0;0;0;0;0;0;0;1;0;1;0;0;0;1;0;0;1;0;0;0;0;0;0;0
0;0;0;0;0;0;1;0;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 1 0
3 1 1 0 1 0
4 1 1 1 0 1
5 0 0 0 1 0

5
csv/empty.csv Normal file
View File

@ -0,0 +1,5 @@
0;0;0;0;0
0;0;0;0;0
0;0;0;0;0
0;0;0;0;0
0;0;0;0;0
1 0 0 0 0 0
2 0 0 0 0 0
3 0 0 0 0 0
4 0 0 0 0 0
5 0 0 0 0 0

5
csv/graph.csv Normal file
View File

@ -0,0 +1,5 @@
0;0;1;0;0
0;0;1;0;0
1;1;0;1;1
0;0;1;0;1
0;0;1;1;0
1 0 0 1 0 0
2 0 0 1 0 0
3 1 1 0 1 1
4 0 0 1 0 1
5 0 0 1 1 0

View File

@ -3,12 +3,13 @@
#include <stdlib.h>
void random_adjacency(const uint64_t row_length, const uint64_t column_length, uint64_t matrix[row_length][column_length]) {
srand(time(NULL));
for (uint8_t row_index=0; row_index < row_length; row_index++) {
for (uint8_t column_index=0; column_index < column_length; column_index++) {
if(column_index == row_index) {
matrix[row_index][column_index] = 1;
matrix[row_index][column_index] = 0;
continue;
}
matrix[row_index][column_index] = rand()%2;

View File

@ -3,6 +3,8 @@
#include <stdint.h>
void random_adjacency(const uint64_t row_length, const uint64_t column_length, uint64_t matrix[row_length][column_length]);
void random_adjacency(const uint64_t row_length,
const uint64_t column_length,
uint64_t matrix[row_length][column_length]);
#endif

62
main.c
View File

@ -1,16 +1,60 @@
#include "graph.h"
#include "matrix.h"
#include <stdint.h>
#include <stdio.h>
#include <time.h>
void benchmark() {
const uint64_t row_length1 = 100;
const uint64_t column_length1 = 100;
uint64_t matrix1[row_length1][column_length1];
const uint64_t row_length2 = 100;
const uint64_t column_length2 = 100;
uint64_t matrix2[row_length2][column_length2];
uint64_t new_matrix[row_length1][column_length2];
double elapsed_time = 0.0;
const uint64_t iterations = 10000;
clock_t start_time;
for (uint64_t i = 0; i < iterations; i++) {
random_adjacency(row_length1, column_length1, matrix1);
random_adjacency(row_length2, column_length2, matrix2);
start_time = clock();
matrix_multiply_basic(row_length1, column_length1, matrix1,
row_length2, column_length2, matrix2,
new_matrix);
elapsed_time += (double)(clock() - start_time) / CLOCKS_PER_SEC;
}
printf("%lu iterations of matrix_multiply_basic took roughly %f seconds\n", iterations, elapsed_time);
printf("1 iteration of matrix_multiply_basic took on average roughly %f seconds\n", elapsed_time/iterations);
}
void test() {
const uint64_t row_length1 = 5;
const uint64_t column_length1 = 5;
uint64_t matrix1[row_length1][column_length1];
read_csv("csv/graph.csv", row_length1, column_length1, matrix1);
// print_matrix(row_length1, column_length1, matrix1);
// uint64_t new_matrix[row_length1][column_length1];
//
// matrix_multiply_basic(row_length1, column_length1, matrix1,
// row_length1, column_length1, matrix1,
// new_matrix);
//
// print_matrix(row_length1, column_length1, new_matrix);
}
int main(void) {
const uint64_t row_length = 5;
const uint64_t column_length = 5;
uint64_t matrix1[row_length][column_length];
uint64_t matrix2[row_length*2][column_length*2];
random_adjacency(row_length, column_length, matrix1);
random_adjacency(row_length*2, column_length*2, matrix2);
print_matrix(row_length, column_length, matrix1);
test();
// benchmark();
}

View File

@ -1,9 +1,10 @@
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void print_matrix(const uint64_t row_length, const uint64_t column_length,
const uint64_t matrix[row_length][column_length]) {
void print_matrix(const uint64_t row_length, const uint64_t column_length, const uint64_t matrix[row_length][column_length]) {
for (uint64_t column_index=0; column_index < column_length; column_index++) {
for (uint64_t row_index=0; row_index < row_length; row_index++) {
printf("%lu ", matrix[row_index][column_index]);
@ -12,15 +13,77 @@ void print_matrix(const uint64_t row_length, const uint64_t column_length,
}
}
int matrix_multiply_basic(const uint64_t row_length1,
const uint64_t column_length1,
const uint64_t matrix1[row_length1][column_length1],
const uint64_t row_length2,
const uint64_t column_length2,
const uint64_t matrix2[row_length2][column_length2],
int matrix_multiply_basic(const uint64_t row_length1, const uint64_t column_length1, const uint64_t matrix1[row_length1][column_length1],
const uint64_t row_length2, const uint64_t column_length2, const uint64_t matrix2[row_length2][column_length2],
uint64_t output_matrix[row_length1][column_length2]) {
int ret = 0;
if (row_length1 != column_length2) {
return 1;
}
return ret;
for (uint64_t i = 0; i < row_length1; i++) {
for(uint64_t j = 0; j < column_length2; j++) {
uint64_t sum = 0;
for (uint64_t k = 0; k <row_length1; k++) {
sum += matrix1[i][k] * matrix2[k][j];
}
output_matrix[i][j] = sum;
}
}
return 0;
}
int read_csv(const char *file_name, const uint64_t row_length, const uint64_t column_length, uint64_t output_matrix[row_length][column_length]) {
FILE *file_ptr;
uint32_t bufsize = row_length*2; // have to account for delimiters
char file_line[bufsize];
uint64_t row_index = 0;
uint64_t column_index = 0;
file_ptr = fopen(file_name, "r");
if (file_ptr == NULL) {
printf("Unable to open csv\n");
return 1;
}
for (column_index = 0; column_index < column_length; column_index++) {
printf("row_index: %lu\n", column_index);
if (fgets(file_line, bufsize, file_ptr) == NULL) {
break;
}
char *bruh = strtok(file_line, ";,");
for(row_index = 0; row_index < row_length; row_index++) {
if (bruh == NULL) {
printf("Fuck You!!!");
continue;
}
printf("column_index: %lu, bruh: %lu\n", row_index, strtoul(bruh, NULL, 0));
bruh = strtok(NULL, ";,");
}
printf("\n");
}
// while (fgets(file_line, bufsize, file_ptr)) {
// row_index = 0;
// char *bruh = strtok(file_line, ";,");
//
// while (bruh) {
// output_matrix[row_index][column_index] = strtoul(bruh, NULL, 0);
// printf("column_index: %lu, bruh: %s\n", row_index, bruh);
// bruh = strtok(NULL, ";,");
// row_index++;
// }
//
// printf("row_index: %lu\n", column_index);
// column_index++;
// }
fclose(file_ptr);
return 0;
}

View File

@ -3,12 +3,16 @@
#include <stdint.h>
void print_matrix(const uint64_t row_length, const uint64_t column_length,
void print_matrix(const uint64_t row_length,
const uint64_t column_length,
const uint64_t matrix[row_length][column_length]);
// Takes three matrices, the first two will be multiplied and restult will be written to output_matrix.
// Matrix requirements are as specified in the parameters.
// Function return 0 on success and 1 on failure.
/*
First two matrices will be multiplied and
restult will be written to output_matrix.
Matrix requirements are as specified in the parameters.
Function return 0 on success and 1 on failure.
*/
int matrix_multiply_basic(const uint64_t row_length1,
const uint64_t column_length1,
const uint64_t matrix1[row_length1][column_length1],
@ -17,4 +21,9 @@ int matrix_multiply_basic(const uint64_t row_length1,
const uint64_t matrix2[row_length2][column_length2],
uint64_t output_matrix[row_length1][column_length2]);
int read_csv(char *file_name,
uint64_t row_length,
uint64_t column_length,
uint64_t output_matrix[row_length][column_length]);
#endif