blob: 54ad90080a1b5105693155f30e36dc6629535079 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ftm_matsub.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/05/11 12:56:00 by charles #+# #+# */
/* Updated: 2020/05/11 13:06:43 by charles ### ########.fr */
/* */
/* ************************************************************************** */
#include "libftm_mat.h"
t_ftmmat *ftm_matsub(t_ftmmat *dst, t_ftmmat *other)
{
size_t i;
size_t size;
if (dst->shape.x != other->shape.x || dst->shape.y != other->shape.y)
return (NULL);
size = dst->shape.x * dst->shape.y;
i = 0;
while (i < size)
{
dst->m[i] -= other->m[i];
i++;
}
return (dst);
}
|