aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/grids.h
blob: f1581b3346b63605db424628d1efd4851ab5137d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#pragma once

#include <stddef.h>
#include <stdbool.h>

typedef struct {
    size_t x;
    size_t y;
    size_t size;
    size_t* data;
} grid_t;

grid_t* create_grid(const size_t x, const size_t y);
void set_grid(grid_t* grid, const double val);
grid_t* copy_grid(const grid_t* grid);
void free_grid(grid_t* grid);
bool grid_equal(const grid_t* grid1, const grid_t* grid2);
bool grid_allclose(const grid_t* grid1, const grid_t* grid2, const size_t max_error);