matrix.h

Go to the documentation of this file.
00001 /**********************************************************************
00002 matrix.h - Operations on arbitrary-sized matrix.
00003  
00004 Copyright (C) 1998-2001 by OpenEye Scientific Software, Inc.
00005 Some portions Copyright (C) 2001-2005 by Geoffrey R. Hutchison
00006  
00007 This file is part of the Open Babel project.
00008 For more information, see <http://openbabel.sourceforge.net/>
00009  
00010 This program is free software; you can redistribute it and/or modify
00011 it under the terms of the GNU General Public License as published by
00012 the Free Software Foundation version 2 of the License.
00013  
00014 This program is distributed in the hope that it will be useful,
00015 but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 GNU General Public License for more details.
00018 ***********************************************************************/
00019 
00020 #ifndef OB_MATRIX_H
00021 #define OB_MATRIX_H
00022 #include <openbabel/babelconfig.h>
00023 #include <vector>
00024 #include <math.h>
00025 
00026 namespace OpenBabel
00027 {
00028 
00029 /*
00030  * vector<vector<double> > m : m[row][col] gives appropriate row/col entry
00031  * double **m                : m[row][col] gives appropriate row/col entry
00032  * double *m                 : m[(row * numCols) + col] gives appropriate row/col entry
00033  */
00034 
00035 void print_matrix(std::vector<std::vector<double> > &m);
00036 void print_matrix_f (double  *m, int rows, int cols);
00037 void print_matrix_ff(double **m, int rows, int cols);
00038 
00039 bool mult_matrix(std::vector<std::vector<double> > &c, std::vector<std::vector<double> > &a, std::vector<std::vector<double> > &b);
00040 bool mult_matrix_f (double  *c, double  *a, double  *b, int rows, int cols);
00041 bool mult_matrix_ff(double **c, double **a, double **b, int rows, int cols);
00042 
00043 bool invert_matrix(std::vector<std::vector<double> > &m, double &det);
00044 bool invert_matrix_f (double  *m, double &det, int rows, int cols);
00045 bool invert_matrix_ff(double **m, double &det, int rows, int cols);
00046 
00047 bool convert_matrix_f (std::vector<std::vector<double> > &src, double  *dst);
00048 bool convert_matrix_ff(std::vector<std::vector<double> > &src, double **dst);
00049 bool convert_matrix_f (double  *src, std::vector<std::vector<double> > &dst, int rows, int cols);
00050 bool convert_matrix_ff(double **src, std::vector<std::vector<double> > &dst, int rows, int cols);
00051 bool convert_matrix_ff_f(double **src, double  *dst, int rows, int cols);
00052 bool convert_matrix_f_ff(double  *src, double **dst, int rows, int cols);
00053 
00054 }
00055 
00056 #endif // OB_MATRIX_H
00057