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
16 extern "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);
51  void Map_MatrixXd_delete (struct C_Map_MatrixXd *m);
52  void Map_MatrixXd_set_zero (struct C_Map_MatrixXd *m);
53  void Map_MatrixXd_copy (struct C_Map_MatrixXd *dst,
54  const struct C_Map_MatrixXd *src);
56  const struct C_MatrixXd *src);
58  int i, int j, double coeff);
59  double Map_MatrixXd_get_coeff (const struct C_Map_MatrixXd *m,
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);
65  void Map_MatrixXd_multiply (const struct C_Map_MatrixXd *m1,
66  const struct C_Map_MatrixXd *m2,
67  struct C_Map_MatrixXd *result);
68 
69 #ifdef __cplusplus
70 } // end extern "C"
71 #endif
C_MatrixXd
Definition: binary_library.h:22
MatrixXd_print
void MatrixXd_print(const struct C_MatrixXd *m)
MatrixXd_get_coeff
double MatrixXd_get_coeff(const struct C_MatrixXd *m, int i, int j)
MatrixXd_set_coeff
void MatrixXd_set_coeff(struct C_MatrixXd *m, int i, int j, double coeff)
Definition: binary_library.cpp:107
Map_MatrixXd_set_zero
void Map_MatrixXd_set_zero(struct C_Map_MatrixXd *m)
Definition: binary_library.cpp:147
Map_MatrixXd_new
struct C_Map_MatrixXd * Map_MatrixXd_new(double *array, int rows, int cols)
Definition: binary_library.cpp:137
MatrixXd_delete
void MatrixXd_delete(struct C_MatrixXd *m)
Definition: binary_library.cpp:77
m1
Matrix3d m1
Definition: IOFormat.cpp:2
MatrixXd_new
struct C_MatrixXd * MatrixXd_new(int rows, int cols)
Definition: binary_library.cpp:72
Map_MatrixXd_delete
void Map_MatrixXd_delete(struct C_Map_MatrixXd *m)
Definition: binary_library.cpp:142
result
Values result
Definition: OdometryOptimize.cpp:8
rows
int rows
Definition: Tutorial_commainit_02.cpp:1
MatrixXd_copy
void MatrixXd_copy(struct C_MatrixXd *dst, const struct C_MatrixXd *src)
Map_MatrixXd_add
void Map_MatrixXd_add(const struct C_Map_MatrixXd *m1, const struct C_Map_MatrixXd *m2, struct C_Map_MatrixXd *result)
m2
MatrixType m2(n_dims)
MatrixXd_multiply
void MatrixXd_multiply(const struct C_MatrixXd *m1, const struct C_MatrixXd *m2, struct C_MatrixXd *result)
j
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2
MatrixXd_data
double * MatrixXd_data(struct C_MatrixXd *m)
Definition: binary_library.cpp:82
Map_MatrixXd_print
void Map_MatrixXd_print(const struct C_Map_MatrixXd *m)
m
Matrix3f m
Definition: AngleAxis_mimic_euler.cpp:1
MatrixXd_resize
void MatrixXd_resize(struct C_MatrixXd *m, int rows, int cols)
Definition: binary_library.cpp:92
Map_MatrixXd_multiply
void Map_MatrixXd_multiply(const struct C_Map_MatrixXd *m1, const struct C_Map_MatrixXd *m2, struct C_Map_MatrixXd *result)
MatrixXd_copy_map
void MatrixXd_copy_map(struct C_MatrixXd *dst, const struct C_Map_MatrixXd *src)
array
Definition: numpy.h:821
MatrixXd_add
void MatrixXd_add(const struct C_MatrixXd *m1, const struct C_MatrixXd *m2, struct C_MatrixXd *result)
Map_MatrixXd_copy_matrix
void Map_MatrixXd_copy_matrix(struct C_Map_MatrixXd *dst, const struct C_MatrixXd *src)
Map_MatrixXd_set_coeff
void Map_MatrixXd_set_coeff(struct C_Map_MatrixXd *m, int i, int j, double coeff)
Definition: binary_library.cpp:162
MatrixXd_set_zero
void MatrixXd_set_zero(struct C_MatrixXd *m)
Definition: binary_library.cpp:87
cols
int cols
Definition: Tutorial_commainit_02.cpp:1
i
int i
Definition: BiCGSTAB_step_by_step.cpp:9
C_Map_MatrixXd
Definition: binary_library.h:23
Map_MatrixXd_get_coeff
double Map_MatrixXd_get_coeff(const struct C_Map_MatrixXd *m, int i, int j)
Map_MatrixXd_copy
void Map_MatrixXd_copy(struct C_Map_MatrixXd *dst, const struct C_Map_MatrixXd *src)


gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:12