diff options
Diffstat (limited to 'vendor/libftm/src/mat/ftm_matscale.c')
| -rw-r--r-- | vendor/libftm/src/mat/ftm_matscale.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/vendor/libftm/src/mat/ftm_matscale.c b/vendor/libftm/src/mat/ftm_matscale.c new file mode 100644 index 0000000..8347e1a --- /dev/null +++ b/vendor/libftm/src/mat/ftm_matscale.c @@ -0,0 +1,28 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ftm_matscale.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/05/11 12:56:00 by charles #+# #+# */ +/* Updated: 2020/05/11 13:07:25 by charles ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libftm_mat.h" + +t_ftmmat *ftm_matscale(t_ftmmat *dst, float scalar) +{ + size_t i; + size_t size; + + size = dst->shape.x * dst->shape.y; + i = 0; + while (i < size) + { + dst->m[i] *= scalar; + i++; + } + return (dst); +} |
