binary_library.h
Go to the documentation of this file.
00001 // This file is part of Eigen, a lightweight C++ template library
00002 // for linear algebra.
00003 //
00004 // Copyright (C) 2009 Benoit Jacob <jacob.benoit.1@gmail.com>
00005 //
00006 // Eigen is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 3 of the License, or (at your option) any later version.
00010 //
00011 // Alternatively, you can redistribute it and/or
00012 // modify it under the terms of the GNU General Public License as
00013 // published by the Free Software Foundation; either version 2 of
00014 // the License, or (at your option) any later version.
00015 //
00016 // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY
00017 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00018 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the
00019 // GNU General Public License for more details.
00020 //
00021 // You should have received a copy of the GNU Lesser General Public
00022 // License and a copy of the GNU General Public License along with
00023 // Eigen. If not, see <http://www.gnu.org/licenses/>.
00024 
00025 // This is a pure C header, no C++ here.
00026 // The functions declared here will be implemented in C++ but
00027 // we don't have to know, because thanks to the extern "C" syntax,
00028 // they will be compiled to C object code.
00029 
00030 #ifdef __cplusplus
00031 extern "C"
00032 {
00033 #endif
00034 
00035   // just dummy empty structs to give different pointer types,
00036   // instead of using void* which would be type unsafe
00037   struct C_MatrixXd {};
00038   struct C_Map_MatrixXd {};
00039 
00040   // the C_MatrixXd class, wraps some of the functionality
00041   // of Eigen::MatrixXd.
00042   struct C_MatrixXd* MatrixXd_new(int rows, int cols);
00043   void    MatrixXd_delete     (struct C_MatrixXd *m);
00044   double* MatrixXd_data       (struct C_MatrixXd *m);
00045   void    MatrixXd_set_zero   (struct C_MatrixXd *m);
00046   void    MatrixXd_resize     (struct C_MatrixXd *m, int rows, int cols);
00047   void    MatrixXd_copy       (struct C_MatrixXd *dst,
00048                                const struct C_MatrixXd *src);
00049   void    MatrixXd_copy_map   (struct C_MatrixXd *dst,
00050                                const struct C_Map_MatrixXd *src);  
00051   void    MatrixXd_set_coeff  (struct C_MatrixXd *m,
00052                                int i, int j, double coeff);
00053   double  MatrixXd_get_coeff  (const struct C_MatrixXd *m,
00054                                int i, int j);
00055   void    MatrixXd_print      (const struct C_MatrixXd *m);
00056   void    MatrixXd_add        (const struct C_MatrixXd *m1,
00057                                const struct C_MatrixXd *m2,
00058                                struct C_MatrixXd *result);  
00059   void    MatrixXd_multiply   (const struct C_MatrixXd *m1,
00060                                const struct C_MatrixXd *m2,
00061                                struct C_MatrixXd *result);
00062   
00063   // the C_Map_MatrixXd class, wraps some of the functionality
00064   // of Eigen::Map<MatrixXd>
00065   struct C_Map_MatrixXd* Map_MatrixXd_new(double *array, int rows, int cols);
00066   void   Map_MatrixXd_delete     (struct C_Map_MatrixXd *m);
00067   void   Map_MatrixXd_set_zero   (struct C_Map_MatrixXd *m);
00068   void   Map_MatrixXd_copy       (struct C_Map_MatrixXd *dst,
00069                                   const struct C_Map_MatrixXd *src);
00070   void   Map_MatrixXd_copy_matrix(struct C_Map_MatrixXd *dst,
00071                                   const struct C_MatrixXd *src);  
00072   void   Map_MatrixXd_set_coeff  (struct C_Map_MatrixXd *m,
00073                                   int i, int j, double coeff);
00074   double Map_MatrixXd_get_coeff  (const struct C_Map_MatrixXd *m,
00075                                   int i, int j);
00076   void   Map_MatrixXd_print      (const struct C_Map_MatrixXd *m);
00077   void   Map_MatrixXd_add        (const struct C_Map_MatrixXd *m1,
00078                                   const struct C_Map_MatrixXd *m2,
00079                                   struct C_Map_MatrixXd *result);  
00080   void   Map_MatrixXd_multiply   (const struct C_Map_MatrixXd *m1,
00081                                   const struct C_Map_MatrixXd *m2,
00082                                   struct C_Map_MatrixXd *result);
00083 
00084 #ifdef __cplusplus
00085 } // end extern "C"
00086 #endif


re_vision
Author(s): Dorian Galvez-Lopez
autogenerated on Sun Jan 5 2014 11:30:47