summaryrefslogtreecommitdiff
path: root/include/mat33.h
blob: 6f7b03ff779aaf852e0291c1aad525ad6efe3b57 (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
31
/* Copyright 2015 The ChromiumOS Authors
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef __CROS_EC_MAT_33_H

#define __CROS_EC_MAT_33_H

#include "math_util.h"
#include "util.h"
#include "vec3.h"

typedef float mat33_float_t[3][3];
typedef size_t sizev3_t[3];

void mat33_fp_init_zero(mat33_fp_t A);
void mat33_fp_init_diagonal(mat33_fp_t A, fp_t x);

void mat33_fp_scalar_mul(mat33_fp_t A, fp_t c);

void mat33_fp_swap_rows(mat33_fp_t A, const size_t i, const size_t j);

void mat33_fp_get_eigenbasis(mat33_fp_t S, fpv3_t eigenvals,
			     mat33_fp_t eigenvecs);

size_t mat33_fp_maxind(mat33_fp_t A, size_t k);

void mat33_fp_rotate(mat33_fp_t A, fp_t c, fp_t s,
		     size_t k, size_t l, size_t i, size_t j);
#endif  /* __CROS_EC_MAT_33_H */