linear_algebra.hpp

Go to the documentation of this file.
00001 // -*- mode: c++; indent-tabs-mode: nil; -*-
00002 //
00003 //The Biomolecule Toolkit (BTK) is a C++ library for use in the
00004 //modeling, analysis, and design of biological macromolecules.
00005 //Copyright (C) 2001-2006, Tim Robertson <kid50@users.sourceforge.net>,
00006 //                         Chris Saunders <ctsa@users.sourceforge.net>
00007 //
00008 //This program is free software; you can redistribute it and/or modify
00009 //it under the terms of the GNU Lesser General Public License as published
00010 //by the Free Software Foundation; either version 2.1 of the License, or (at
00011 //your option) any later version.
00012 //
00013 //This program is distributed in the hope that it will be useful,  but
00014 //WITHOUT ANY WARRANTY; without even the implied warranty of'
00015 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016 //Lesser General Public License for more details.
00017 //
00018 //You should have received a copy of the GNU Lesser General Public License
00019 //along with this program; if not, write to the Free Software Foundation,
00020 //Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00021 
00025 
00026 #ifndef BTK_MATH_LINEAR_ALGEBRA_HPP
00027 #define BTK_MATH_LINEAR_ALGEBRA_HPP
00028 
00029 #include <cmath>
00030 #include <iosfwd>
00031 #include <vector>
00032 
00033 #include <boost/numeric/ublas/symmetric.hpp>
00034 
00035 #include <btk/core/math/constants.hpp>
00036 #include <btk/core/math/btk_vector.hpp>
00037 #include <btk/core/math/btk_matrix.hpp>
00038 #include <btk/core/math/vector_math.hpp>
00039 
00040 namespace uBLAS = boost::numeric::ublas;
00041 
00042 namespace BTK {
00043 namespace MATH {
00044 
00054 typedef uBLAS::symmetric_matrix<double> BTKSymmetricMatrix;
00056 
00064 bool
00065 within_sqr_dist(BTKVector const & a,
00066                 BTKVector const & b,
00067                 double r_squared);
00068 
00070 inline
00071 double
00072 point_angle(BTKVector const & v1,
00073             BTKVector const & v2,
00074             BTKVector const & v3){
00075   return vector_angle(v1-v2,v3-v2);
00076 }
00077 
00078 
00084 double
00085 point_dihedral(BTKVector const & a,
00086                BTKVector const & b,
00087                BTKVector const & c,
00088                BTKVector const & d);
00089 
00102 BTKVector
00103 set_vector_from_dihedral(BTKVector const & v3,
00104                          BTKVector const & v2,
00105                          BTKVector const & v1,
00106                          double len34,
00107                          double ang234,
00108                          double dih1234);
00109 
00128 BTKVector
00129 set_vector_from_two_angles(BTKVector const & v3,
00130                            BTKVector const & v2,
00131                            BTKVector const & v1,
00132                            double len34,
00133                            double ang234,
00134                            double ang134);
00135 
00136 
00137 } // namespace MATH
00138 } // namespace BTK
00139 
00140 #endif // BTK_LINEAR_ALGEBRA_H

Generated on Sun Jul 15 20:46:25 2007 for BTK Core by  doxygen 1.5.1