TR-mbed 1.0
Loading...
Searching...
No Matches
binary_library.h
Go to the documentation of this file.
1// This file is part of Eigen, a lightweight C++ template library
2// for linear algebra.
3//
4// Copyright (C) 2009 Benoit Jacob <jacob.benoit.1@gmail.com>
5//
6// This Source Code Form is subject to the terms of the Mozilla
7// Public License v. 2.0. If a copy of the MPL was not distributed
8// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
10// This is a pure C header, no C++ here.
11// The functions declared here will be implemented in C++ but
12// we don't have to know, because thanks to the extern "C" syntax,
13// they will be compiled to C object code.
14
15#ifdef __cplusplus
16extern "C"
17{
18#endif
19
20 // just dummy empty structs to give different pointer types,
21 // instead of using void* which would be type unsafe
22 struct C_MatrixXd {};
23 struct C_Map_MatrixXd {};
24
25 // the C_MatrixXd class, wraps some of the functionality
26 // of Eigen::MatrixXd.
27 struct C_MatrixXd* MatrixXd_new(int rows, int cols);
28 void MatrixXd_delete (struct C_MatrixXd *m);
29 double* MatrixXd_data (struct C_MatrixXd *m);
30 void MatrixXd_set_zero (struct C_MatrixXd *m);
31 void MatrixXd_resize (struct C_MatrixXd *m, int rows, int cols);
32 void MatrixXd_copy (struct C_MatrixXd *dst,
33 const struct C_MatrixXd *src);
34 void MatrixXd_copy_map (struct C_MatrixXd *dst,
35 const struct C_Map_MatrixXd *src);
36 void MatrixXd_set_coeff (struct C_MatrixXd *m,
37 int i, int j, double coeff);
38 double MatrixXd_get_coeff (const struct C_MatrixXd *m,
39 int i, int j);
40 void MatrixXd_print (const struct C_MatrixXd *m);
41 void MatrixXd_add (const struct C_MatrixXd *m1,
42 const struct C_MatrixXd *m2,
43 struct C_MatrixXd *result);
44 void MatrixXd_multiply (const struct C_MatrixXd *m1,
45 const struct C_MatrixXd *m2,
46 struct C_MatrixXd *result);
47
48 // the C_Map_MatrixXd class, wraps some of the functionality
49 // of Eigen::Map<MatrixXd>
50 struct C_Map_MatrixXd* Map_MatrixXd_new(double *array, int rows, int cols);
54 const struct C_Map_MatrixXd *src);
56 const struct C_MatrixXd *src);
58 int i, int j, double coeff);
60 int i, int j);
61 void Map_MatrixXd_print (const struct C_Map_MatrixXd *m);
62 void Map_MatrixXd_add (const struct C_Map_MatrixXd *m1,
63 const struct C_Map_MatrixXd *m2,
64 struct C_Map_MatrixXd *result);
66 const struct C_Map_MatrixXd *m2,
67 struct C_Map_MatrixXd *result);
68
69#ifdef __cplusplus
70} // end extern "C"
71#endif
Matrix3f m
Definition AngleAxis_mimic_euler.cpp:1
int i
Definition BiCGSTAB_step_by_step.cpp:9
Matrix3d m1
Definition IOFormat.cpp:2
int array[24]
Definition Map_general_stride.cpp:1
MatrixType m2(n_dims)
int rows
Definition Tutorial_commainit_02.cpp:1
int cols
Definition Tutorial_commainit_02.cpp:1
void MatrixXd_multiply(const struct C_MatrixXd *m1, const struct C_MatrixXd *m2, struct C_MatrixXd *result)
void MatrixXd_add(const struct C_MatrixXd *m1, const struct C_MatrixXd *m2, struct C_MatrixXd *result)
struct C_MatrixXd * MatrixXd_new(int rows, int cols)
Definition binary_library.cpp:72
double Map_MatrixXd_get_coeff(const struct C_Map_MatrixXd *m, int i, int j)
double MatrixXd_get_coeff(const struct C_MatrixXd *m, int i, int j)
void Map_MatrixXd_copy(struct C_Map_MatrixXd *dst, const struct C_Map_MatrixXd *src)
void Map_MatrixXd_print(const struct C_Map_MatrixXd *m)
void MatrixXd_copy(struct C_MatrixXd *dst, const struct C_MatrixXd *src)
void MatrixXd_print(const struct C_MatrixXd *m)
void MatrixXd_resize(struct C_MatrixXd *m, int rows, int cols)
Definition binary_library.cpp:92
void Map_MatrixXd_set_zero(struct C_Map_MatrixXd *m)
Definition binary_library.cpp:147
void Map_MatrixXd_set_coeff(struct C_Map_MatrixXd *m, int i, int j, double coeff)
Definition binary_library.cpp:162
void Map_MatrixXd_copy_matrix(struct C_Map_MatrixXd *dst, const struct C_MatrixXd *src)
struct C_Map_MatrixXd * Map_MatrixXd_new(double *array, int rows, int cols)
Definition binary_library.cpp:137
void Map_MatrixXd_add(const struct C_Map_MatrixXd *m1, const struct C_Map_MatrixXd *m2, struct C_Map_MatrixXd *result)
void Map_MatrixXd_delete(struct C_Map_MatrixXd *m)
Definition binary_library.cpp:142
void MatrixXd_delete(struct C_MatrixXd *m)
Definition binary_library.cpp:77
void Map_MatrixXd_multiply(const struct C_Map_MatrixXd *m1, const struct C_Map_MatrixXd *m2, struct C_Map_MatrixXd *result)
void MatrixXd_copy_map(struct C_MatrixXd *dst, const struct C_Map_MatrixXd *src)
void MatrixXd_set_zero(struct C_MatrixXd *m)
Definition binary_library.cpp:87
double * MatrixXd_data(struct C_MatrixXd *m)
Definition binary_library.cpp:82
void MatrixXd_set_coeff(struct C_MatrixXd *m, int i, int j, double coeff)
Definition binary_library.cpp:107
Definition binary_library.h:23
Definition binary_library.h:22
std::ptrdiff_t j
Definition tut_arithmetic_redux_minmax.cpp:2