WOSSIMHelper.h 2.38 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------

#ifndef WOSSIMHELPER_H
#define WOSSIMHELPER_H

28
#ifdef OW_USE_OSSIM
Mathias Goldau's avatar
Mathias Goldau committed
29
    #include <algorithm>
30
//    #include <iostream>
Mathias Goldau's avatar
Mathias Goldau committed
31
    #include <vector>
32

Mathias Goldau's avatar
Mathias Goldau committed
33
    #include <matrix/newmat.h>
34

Mathias Goldau's avatar
Mathias Goldau committed
35
    #include <boost/shared_ptr.hpp>
36

Mathias Goldau's avatar
Mathias Goldau committed
37 38
    #include "WMatrix.h"
    #include "WValue.h"
39 40 41 42 43 44 45

    /**
     * Class with functions to use the GNU scientific library
     */
    class WOSSIMHelper
    {
    public:
Mathias Goldau's avatar
Mathias Goldau committed
46 47 48 49 50 51
      static boost::shared_ptr< NEWMAT::Matrix > OWMatrixToOSSIMMatrix( const WMatrix< double > &input );
      static WMatrix< double > OSSIMMatrixToOWMatrix( const NEWMAT::Matrix& input );
      static WMatrix< double > OSSIMDiagonalMatrixToOWMatrix( const NEWMAT::DiagonalMatrix& input );
      static WValue< double > OSSIMDiagonalMatrixToOWVector( const NEWMAT::DiagonalMatrix& input );
      // static gsl_vector* OWVectorToOSSIMVector( const WValue<double> &input );
      // static WValue<double> OSSIMVectorToOWVector( const gsl_vector* input );
52 53

      // computes the SVD of the Matrix A
Mathias Goldau's avatar
Mathias Goldau committed
54 55 56 57
      static void computeSVD( const WMatrix< double >& A,
                              WMatrix< double >& U,
                              WMatrix< double >& V,
                              WValue< double >& S );
58
      // computes the pseudo inverse of the Matrix A
Mathias Goldau's avatar
Mathias Goldau committed
59
      // static WMatrix<double> pseudoInverse( const WMatrix<double>& input );
60
    };
Mathias Goldau's avatar
Mathias Goldau committed
61 62
#endif  // OW_USE_OSSIM

63
#endif  // WOSSIMHELPER_H