"Fossies" - the Fresh Open Source Software Archive

Member "gama-2.05/lib/gnu_gama/local/local_linearization.h" (10 May 2019, 3545 Bytes) of package /linux/privat/gama-2.05.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "local_linearization.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2     GNU Gama -- adjustment of geodetic networks
    3     Copyright (C) 2001, 2011  Ales Cepek <cepek@fsv.cvut.cz>
    4                   2011  Vaclav Petras <wenzeslaus@gmail.com>
    5                   2013  Ales Cepek <cepek@gnu.org>
    6 
    7     This file is part of the GNU Gama C++ library.
    8 
    9     This library is free software; you can redistribute it and/or modify
   10     it under the terms of the GNU General Public License as published by
   11     the Free Software Foundation; either version 3 of the License, or
   12     (at your option) any later version.
   13 
   14     This library is distributed in the hope that it will be useful,
   15     but WITHOUT ANY WARRANTY; without even the implied warranty of
   16     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   17     GNU General Public License for more details.
   18 
   19     You should have received a copy of the GNU General Public License
   20     along with this library; if not, write to the Free Software
   21     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
   22 */
   23 
   24 /** \file local_linearization.h
   25  * \brief #GNU_gama::local::LocalLinearization class header file
   26  *
   27  * \author Ales Cepek
   28  * \author Vaclav Petras (acyclic visitor pattern)
   29  */
   30 
   31 #ifndef gama_local_LocalLinearization_GNU_gama_local_Local_Linearization
   32 #define gama_local_LocalLinearization_GNU_gama_local_Local_Linearization
   33 
   34 #include <gnu_gama/local/observation.h>
   35 #include <gnu_gama/local/gamadata.h>
   36 
   37 namespace GNU_gama { namespace local {
   38 
   39   /** Local linearization class implemented as a visitor. */
   40   class LocalLinearization : public AllObservationsVisitor
   41     {
   42 
   43     public:
   44 
   45       LocalLinearization(PointData& pd, double /*m*/)
   46     : max_size(6), PD(pd), maxn(0) //, m0(m) ... unused
   47       {}
   48 
   49       int  unknowns() const { return maxn; }
   50 
   51       void  visit(Direction *element)  { direction(element); }
   52       void  visit(Distance *element)   { distance(element); }
   53       void  visit(Angle *element)      { angle(element); }
   54       void  visit(H_Diff *element)     { h_diff(element); }
   55       void  visit(S_Distance *element) { s_distance(element); }
   56       void  visit(Z_Angle *element)    { z_angle(element); }
   57       void  visit(X *element)          { x(element); }
   58       void  visit(Y *element)          { y(element); }
   59       void  visit(Z *element)          { z(element); }
   60       void  visit(Xdiff *element)      { xdiff(element); }
   61       void  visit(Ydiff *element)      { ydiff(element); }
   62       void  visit(Zdiff *element)      { zdiff(element); }
   63       void  visit(Azimuth *element)    { azimuth(element); }
   64 
   65       const   long    max_size; ///< maximal number of coefficients
   66       mutable double  rhs;
   67       mutable double  coeff[6];
   68       mutable long    index[6];
   69       mutable long    size;
   70 
   71     private:
   72 
   73       PointData&           PD;
   74       mutable int          maxn;
   75       // double               m0; ... unused
   76 
   77       void direction  (const Direction  *obs) const;
   78       void distance   (const Distance   *obs) const;
   79       void angle      (const Angle      *obs) const;
   80       void h_diff     (const H_Diff     *obs) const;
   81       void s_distance (const S_Distance *obs) const;
   82       void z_angle    (const Z_Angle    *obs) const;
   83       void x          (const X          *obs) const;
   84       void y          (const Y          *obs) const;
   85       void z          (const Z          *obs) const;
   86       void xdiff      (const Xdiff      *obs) const;
   87       void ydiff      (const Ydiff      *obs) const;
   88       void zdiff      (const Zdiff      *obs) const;
   89       void azimuth    (const Azimuth    *obs) const;
   90     };
   91 
   92 }}
   93 
   94 #endif