MrepAtom.hpp

00001 // This file is part of the imaging2 class library.
00002 //
00003 // University of Innsbruck, Infmath Imaging, 2009.
00004 // http://infmath.uibk.ac.at
00005 //
00006 // All rights reserved.
00007 
00008 
00009 #ifndef MREPATOM_H
00010 #define MREPATOM_H
00011 
00012 
00013 namespace imaging
00014 {
00016   class MrepAtom
00017   {
00018     static const float_t RADIUS_COEFFICIENT = 5.0;
00019     float_t _radius;
00020     size_t _start_atom;
00021     size_t _connection;
00022 
00023   public:
00024     MrepAtom() : _radius(1.0), _start_atom(0), _connection(0) {}
00025 
00026     MrepAtom(float_t radius, size_t start_atom, size_t connection) :
00027         _radius(radius), _start_atom(start_atom), _connection(connection)
00028     {}
00029 
00030     void assign(float_t radius, size_t start_atom, size_t connection)
00031     {
00032       _radius = radius;
00033       _start_atom = start_atom;
00034       _connection = connection;
00035 
00036     }
00037 
00038     void set_radius(float_t radius) { _radius = radius; }
00039     void set_start_atom(size_t start_atom) { _start_atom = start_atom; }
00040     void set_connection(size_t connection) { _connection = connection; }
00041     
00042     float_t radius() const { return _radius; }
00043     size_t start_atom() const { return _start_atom; }
00044     size_t connection() const { return _connection; }
00045 
00046     void exponential(ublas::vector<float_t>::const_iterator & vector, MrepAtom & shape) const
00047     {
00048       shape._radius = _radius * exp(*vector); ++vector;
00049       // shape._radius = _radius + *vector; ++vector;
00050       shape._start_atom = _start_atom;
00051       shape._connection = _connection;
00052     }
00053 
00054     void logarithm(const MrepAtom & shape, ublas::vector<float_t>::iterator & vector) const
00055     {
00056       *vector = log( shape._radius /_radius ); ++vector;
00057       // *vector = shape._radius - _radius; ++vector;
00058     }
00059 
00060     size_t dimension() const { return 1; }
00061   };
00062 
00063   //   template <class T>
00064   //   std::ostream& operator<<(std::ostream & os, const MRepAtomS<T> & m_rep)
00065   //   {
00066   //     os << "MRepAtomS";
00067   //
00068   //     os << "\n";
00069   //
00070   //     os << "  radius: " << m_rep._radius << "\n";
00071   //
00072   //     os << std::endl;
00073   //
00074   //     return os;
00075   //   }
00076 
00077 }
00078 
00079 
00080 #endif
00081 
00082 
00083 

Generated on Tue Feb 10 10:01:30 2009 for imaging2 by  doxygen 1.5.5