Skip to content

Commit

Permalink
Avnt pull
Browse files Browse the repository at this point in the history
  • Loading branch information
deseilligny committed May 20, 2021
1 parent 7378653 commit 6e289a3
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
24 changes: 20 additions & 4 deletions MMVII/include/MMVII_Mappings.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,16 @@
namespace MMVII
{
template <class Type,const int Dim> class cDataBoundedSet ;
template <class Type,const int DimIn,const int DimOut> class cMapping;
template <class Type,const int DimIn,const int DimOut> class cDataMapping;
template <class Type,const int Dim> class cDataInvertibleMapping ;// : public cDataMapping<Type,Dim,Dim>
template <class Type,const int Dim> class cDataIterInvertMapping ;// : public cDataInvertibleMapping<Type,Dim>
template <class Type,const int Dim> class cDataIIMFromMap ; // : public cDataIterInvertMapping<Type,Dim>

template <class Type,const int Dim> class cMappingIdentity ; // : public cDataMapping<Type,Dim,Dim>
template <class Type,const int DimIn,const int DimOut> class cDataMapCalcSymbDer ;// : public cDataMapping<Type,DimIn,DimOut>
template <class cMapElem,class cIMapElem> class cInvertMappingFromElem ;// : public cDataInvertibleMapping<typename cMapElem::TheType,cMapElem::TheDim>
{

/** \file MMVII_Mappings.h
\brief contain interface class for continuous mapping
Expand Down Expand Up @@ -448,13 +457,19 @@ template <class cMapElem,class cIMapElem> class cInvertMappingFromElem : public
};

/**
We have a set of function F1, .. Fp R^k => R ^n
We have a set of function F1, .. Fp R^k => R ^n, we want to estimate F as a linear combination:
F = Sum Al Fl
We have samples Km , Nm
We want to solve by lest square : F (Km) = Nm
We want to solve by lest square :
Sum Al Fl (Km) = Nm
The computation is not optimized (not parallized) as it would add a complexity important for
a probable low gain :
* there is not so many samples
* we dont compute the derivative
* the filling of matrix is however a cost not parallized
*/


template <class Type,const int DimIn,const int DimOut> class cLeastSqComputeMaps
{
public :
Expand All @@ -464,6 +479,7 @@ template <class Type,const int DimIn,const int DimOut> class cLeastSqComputeMap
typedef std::vector<tPtOut> tVecOut;

cLeastSqComputeMaps(size_t aNbFunc);
/// Add obs
void AddObs(const tPtIn & aPt,const tPtOut & aValue,const tPtOut & aPds);
void AddObs(const tPtIn & aPt,const tPtOut & aValue,const Type & aPds);
void AddObs(const tPtIn & aPt,const tPtOut & aValue);
Expand Down
14 changes: 14 additions & 0 deletions MMVII/src/Mappings/cLeastSqComputeMaps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,19 @@ template <class Type,const int DimIn,const int DimOut>
AddObs(aPtIn,aValue,1.0);
}

/* ============================================= */
/* cLeastSqCompMapCalcSymb<Type> */
/* ============================================= */


template <class Type,const int DimIn,const int DimOut>
class cLeastSqCompMapCalcSymb : public cLeastSqCompMapCalcSymb<Type,DimIn,DimOut>
{
public :
typedef typename NS_SymbolicDerivative::cCalculator<Type> tCalc;
};
/*
*/

/* ===================================================== */
/* ===== INSTANTIATION ===== */
Expand All @@ -56,6 +69,7 @@ template <class Type,const int DimIn,const int DimOut>
template class cLeastSqComputeMaps<TYPE,DIMIN,DIMOUT>;

INSTANTIATE_LSQMAP(tREAL8,3,2)
INSTANTIATE_LSQMAP(tREAL8,2,2)

/*
#define INSTANTIATE_OPMulMatVect(T1,T2)\
Expand Down

0 comments on commit 6e289a3

Please sign in to comment.