push_swap/include/app/cost.h

33 lines
1.3 KiB
C
Raw Normal View History

2024-01-13 18:50:17 +01:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* cost.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/12 21:13:51 by maiboyer #+# #+# */
2024-01-23 13:19:18 +01:00
/* Updated: 2024/01/17 15:32:25 by maiboyer ### ########.fr */
2024-01-13 18:50:17 +01:00
/* */
/* ************************************************************************** */
#ifndef COST_H
2024-01-23 13:19:18 +01:00
# define COST_H
2024-01-13 18:50:17 +01:00
2024-01-29 22:45:54 +01:00
2024-01-23 13:19:18 +01:00
# include "app/state.h"
# include "app/types/type_cost.h"
# include "me/types.h"
2024-01-13 18:50:17 +01:00
2024-01-23 13:19:18 +01:00
t_cost alloc_cost(t_state *s);
void free_cost(t_cost self);
t_cost *calculate_cost(t_state *s);
void cost_for_index(t_state *s, t_usize index);
2024-01-13 18:50:17 +01:00
typedef struct s_cost_iter_state
{
2024-01-23 13:19:18 +01:00
t_cost *current_minimum;
t_usize max_index;
} t_cost_iter_state;
2024-01-13 18:50:17 +01:00
#endif /* COST_H */