Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • f99a844
  • /
  • lib
  • /
  • OxFunctionsT1AdapterVnlLeastSquares.h
Raw File Download
Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge Iframe embedding
swh:1:cnt:c5e9ef3eaa030cb318e7bd425564df47cb2be72c
directory badge Iframe embedding
swh:1:dir:7f21c9a4b7dfafd29925be862d8bd559b684364d
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
OxFunctionsT1AdapterVnlLeastSquares.h
/*!
 * \file OxFunctionsT1AdapterVnlLeastSquares.h
 * \author Konrad Werys
 * \date 2018/07/30
 */

#ifndef Tomato_OXFUNCTIONST1ADAPTERVNLLEASTSQUARES_H
#define Tomato_OXFUNCTIONST1ADAPTERVNLLEASTSQUARES_H

#include <vnl/vnl_least_squares_function.h>

#include "OxFunctionsT1.h"

namespace Ox {

    class FunctionsT1AdapterVnlLeastSquares : public vnl_least_squares_function {

    public:

        // least squares function problem formulation
        void f(vnl_vector<double> const& params, vnl_vector<double> &residuals){

            //_FunctionsT1->copyToParameters(params.data_block());
            _FunctionsT1->calcLSResiduals(params.data_block(), residuals.data_block());
        }

        // least squares function gradient
        void gradf (vnl_vector< double > const &params, vnl_matrix< double > &jacobianVNL){

            //_FunctionsT1->copyToParameters(params.data_block());
            _FunctionsT1->calcLSJacobian(params.data_block(), jacobianVNL.data_block());
        }

        void setFunctionsT1(FunctionsT1<double>* _FunctionsT1){
            this->_FunctionsT1 = _FunctionsT1;
        };

        // getters
        FunctionsT1<double>* getFunctionsT1(){
            return _FunctionsT1;
        };

        /**
         * constructor
         */
        FunctionsT1AdapterVnlLeastSquares(int nDims, int nSamples, UseGradient UseGradientVariable) : vnl_least_squares_function (nDims, nSamples, UseGradientVariable){
            _FunctionsT1 = 0; // nullpointer
        };

        /**
         * copy constructor
         * @param old
         */
        FunctionsT1AdapterVnlLeastSquares(const FunctionsT1AdapterVnlLeastSquares &old) : vnl_least_squares_function(old){
            _FunctionsT1 = old._FunctionsT1;
        }

    private:

        FunctionsT1<double>* _FunctionsT1;
    };

} // namespace Ox

#endif //Tomato_OXFUNCTIONST1ADAPTERVNLLEASTSQUARES_H

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API

back to top