Skip to content

Commit

Permalink
Merge branch 'mpd'
Browse files Browse the repository at this point in the history
  • Loading branch information
deseilligny committed Dec 26, 2024
2 parents 8a8a692 + d9a18a3 commit d00b6b2
Show file tree
Hide file tree
Showing 21 changed files with 528 additions and 965 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ T poly_eval( const Polynomials& poly, const T& x )
{
T val=poly[0];
T inv_x = T(1)/x;
for( DenseIndex i=1; i<poly.size(); ++i ){
// for( DenseIndex i=1; i<poly.size(); ++i ){ MPD::MMVII
for( DenseIndex i=1; i<DenseIndex(poly.size()); ++i ){
val = val*inv_x + poly[i]; }

return numext::pow(x,(T)(poly.size()-1)) * val;
Expand Down
11 changes: 9 additions & 2 deletions MMVII/include/MMVII_nums.h
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,7 @@ template <class Type> class cPolynom
{
public :
typedef std::vector<Type> tCoeffs;
typedef cPtxd<Type,2> tCompl;
cPolynom(const tCoeffs &);
cPolynom(const cPolynom &);
cPolynom(size_t aDegre);
Expand All @@ -1007,13 +1008,19 @@ template <class Type> class cPolynom
static cPolynom<Type> RandomPolyg(std::vector<Type> & aVRoots,int aNbRoot,int aNbNoRoot,Type Interv,Type MinDist);


Type Value(const Type & aVal) const;
Type Value(const Type & aVal) const;
tCompl Value(const tCompl & aVal) const;
/// return som(|a_k x^k|) , used for some bounding stuffs
Type AbsValue(const Type & aVal) const;


cPolynom<Type> operator * (const cPolynom<Type> & aP2) const;
cPolynom<Type> operator + (const cPolynom<Type> & aP2) const;
cPolynom<Type> operator - (const cPolynom<Type> & aP2) const;
cPolynom<Type> operator * (const Type & aVal) const;
std::vector<Type> RealRoots(const Type & aTol,int ItMax);
cPolynom<Type> Deriv() const;

std::vector<Type> RealRoots(const Type & aTol,int ItMax) const;


Type& operator [] (size_t aK) {return mVCoeffs[aK];}
Expand Down
13 changes: 9 additions & 4 deletions MMVII/src/Appli/cMMVII_CalcSet.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#define WITH_MMV1_FUNCTION false

#include "MMVII_2Include_Serial_Tpl.h"
#include "MMVII_DeclareAllCmd.h"
#include "MMVII_Sensor.h"
Expand Down Expand Up @@ -90,7 +92,10 @@ static void OneBenchEditSet
const std::string & ExpSet // Expect set
)
{
// StdOut() << "OneBenchEditSet " << anOp << std::endl;
#if (!WITH_MMV1_FUNCTION)
aNumAskedOut = 0;
aRealNumOut = 2;
#endif

cMMVII_Appli & anAp = cMMVII_Appli::CurrentAppli();
std::string aDirI = anAp.InputDirTestMMVII() + "Files/" ;
Expand Down Expand Up @@ -196,15 +201,15 @@ int cAppli_EditSet::ExecuteBench(cParamExeBench & aParam)
aK, // Change test condition : Use or Not Dir Project
"+=", // operator for mpdi
false, // If true, Previous OutPut is moved on input, else Input is purged at end of process
".*txt", // Pattern of used files
"F.*txt", // Pattern of used files
0, // Required num version
2, // Real Num Version
10, // Number of element expected (become obsolet with expected set)
"", // Interval modifying the pattern if != ""
C09 // Ground truth, what the string should be
); //
OneBenchEditSet(aK,"+=",false,".*txt" ,1,1,10,"",C09);
OneBenchEditSet(aK,"+=",false,".*txt" ,2,2,10,"",C09);
OneBenchEditSet(aK,"+=",false,"F.*txt" ,1,1,10,"",C09);
OneBenchEditSet(aK,"+=",false,"F.*txt" ,2,2,10,"",C09);
OneBenchEditSet(aK,"+=",false,"F[02468].txt",2,2,5,"","02468");
// here we init from previous
OneBenchEditSet(aK,"+=",true ,"F[3-5].txt" ,2,2,7,"","0234568"); // 0234568
Expand Down
77 changes: 0 additions & 77 deletions MMVII/src/Bench/BenchGlob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1056,88 +1056,11 @@ int cAppli_MPDTest::Exe()
return EXIT_SUCCESS;
}
TTT ();
#if 1
{
StdOut() << "T0:" << cName2Calc<double>::CalcFromName("toto",10,true) << std::endl;
StdOut() << "T1:" << cName2Calc<double>::CalcFromName("EqDist_Dist_Rad3_Dec1_XY1",10) << std::endl;
return EXIT_SUCCESS;
}
#else
if (mMMV1_GenCodeTestCam)
{
//StdOut() << "kkk=[" << mTopDirMMVII <<"]" << std::endl;
MMV1_GenerateCodeTestCam();
return EXIT_SUCCESS;
}
{
// Si on le met a 10h => reveil a 6h20
double t = 8.0;
//sleep(3600.0 * t);
sleepcp(3600.0 * t * 1000);
std::string aName= "/home/mpd/Bureau/Perso1/Musik/Bach/bach-goldberg-variations-bwv-988-glenn-gould-1981.mp3";
aName = "cvlc " + aName;
StdOut() << system(aName.c_str()) << std::endl;;
}
{
cPt3dr * anAdr = nullptr;
StdOut () << "ADDDDDr " << anAdr << "\n";
StdOut () << "ADDDDDrx " << &(anAdr->x()) << "\n";
StdOut () << "ADDDDDry " << &(anAdr->y()) << "\n";
StdOut () << "ADDDDDrz " << &(anAdr->z()) << "\n";
ShowAdr(anAdr->y());
}
{
double aV= 3.3333;
printf("VVVVV=%05.2f\n",aV);
}
if ((UN>DEUX) && PrintAndTrue("aaaa"))
{
PrintAndTrue("bbbb");
}
PrintAndTrue("ccccc");
cRotation3D<double>::RandomRot();
/*
cSparseVect<float> aSV;
for (const auto & aP : aSV)
{
StdOut() << aP.mI << std::endl;
}
*/
/*
cIm2D<tU_INT1> aIm(cPt2di(3,3));
aIm.DIm().SetV(cPt2di(0,0),13);
// aIm.DIm().SetV(cPt2di(0,0),1000);
// aIm.DIm().SetV(cPt2di(-1,0),1);
// new cIm2D<tU_INT1>(cPt2di(3,3));
cDataIm2D<tU_INT1> & aDIm = aIm.DIm();
tU_INT1* aPtr = aDIm.RawDataLin();
StdOut() << "aIm=" << int(aPtr[0]) << std::endl;
aPtr[0] = 14;
StdOut() << "aIm=" << (int)aDIm.GetV(cPt2di(0,0)) << std::endl;
// aPtr[-1] = 0;
*/
/*
TestVectBool();
cMMVII_Ofs aOs1("toto1.txt");
cMMVII_Ofs aOs2("toto2.txt");
cMultipleOfs amOs; // (aOs1.Ofs(),aOs2.Ofs());
amOs.Add(aOs1.Ofs());
amOs.Add(aOs2.Ofs());
amOs << "1+1=" << 1+1 << "\n";
cMMVII_Ofs aFile("toto.txt");
std::ostream & anOFS = aFile.Ofs();
anOFS << "TEST OFFFSSSSSSSSSSSS\n";
*/
return EXIT_SUCCESS;
#endif
}

tMMVII_UnikPApli Alloc_MPDTest(const std::vector<std::string> & aVArgs,const cSpecMMVII_Appli & aSpec)
Expand Down
8 changes: 0 additions & 8 deletions MMVII/src/MMV1/DenseMapCorresp.cpp

This file was deleted.

22 changes: 20 additions & 2 deletions MMVII/src/MMV1/ExportHomMMV1.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
#define WITH_MMV1_FUNCTION false

#if (WITH_MMV1_FUNCTION)
#include "V1VII.h"
#endif

#include "MMVII_util.h"
#include "MMVII_MeasuresIm.h"

namespace MMVII
{

#if (WITH_MMV1_FUNCTION)
cHomogCpleIm ToMMVII(const cNupletPtsHomologues & aNUp)
{

Expand Down Expand Up @@ -75,13 +82,24 @@ void cImportHomV1::GetHom(cSetHomogCpleIm & aPackV2,const std::string & aNameIm
/* */
/* ************************************************* */

cInterfImportHom::~cInterfImportHom()
cInterfImportHom * cInterfImportHom::CreateImportV1(const std::string&aDir,const std::string&aSubDir,const std::string&aExt)
{
return new cImportHomV1(aDir,aSubDir,aExt);
}
#else

cInterfImportHom * cInterfImportHom::CreateImportV1(const std::string&aDir,const std::string&aSubDir,const std::string&aExt)
{
return new cImportHomV1(aDir,aSubDir,aExt);
MMVII_INTERNAL_ERROR("No CreateImportV1 ");
return nullptr;
}
cInterfImportHom::~cInterfImportHom()
{
}

#endif




};
25 changes: 18 additions & 7 deletions MMVII/src/MMV1/ExportMeasuresImGCPMMV1.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#define WITH_MMV1_FUNCTION false

#if (WITH_MMV1_FUNCTION)
#include "V1VII.h"
#endif

#include "MMVII_util.h"
#include "MMVII_MeasuresIm.h"

Expand All @@ -10,6 +15,8 @@ namespace MMVII
/* */
/* ************************************************* */

#if (WITH_MMV1_FUNCTION)

void ImportMesImV1(std::list<cSetMesPtOf1Im> & aResult,const std::string & aNameFileMesImV1)
{
aResult.clear();
Expand All @@ -36,20 +43,24 @@ cSetMesGCP ImportMesGCPV1(const std::string & aNameFileMesGCPV1,const std::strin
cMes1GCP aMesV2(ToMMVII(aMesV1.Pt()),aMesV1.NamePt(),1.0);

aMesV2.SetSigma2(ToMMVII(aMesV1.Incertitude()));
/*
aMesV2.Sigma2() = {0,0,0,0,0,0};
(aMesV2.Sigma2())[cMes1GCP::IndXX] = Square(aMesV1.Incertitude().x);
(aMesV2.Sigma2())[cMes1GCP::IndYY] = Square(aMesV1.Incertitude().y);
(aMesV2.Sigma2())[cMes1GCP::IndZZ] = Square(aMesV1.Incertitude().z);
*/

aResult.AddMeasure(aMesV2);
}

return aResult;
}

#else
void ImportMesImV1(std::list<cSetMesPtOf1Im> & aResult,const std::string & aNameFileMesImV1)
{
MMVII_INTERNAL_ERROR("No ImportMesImV1 ");
}
cSetMesGCP ImportMesGCPV1(const std::string & aNameFileMesGCPV1,const std::string & aNameSet)
{
MMVII_INTERNAL_ERROR("No ImportMesGCPV1");
return cSetMesGCP (aNameSet);
}
#endif



Expand Down
23 changes: 22 additions & 1 deletion MMVII/src/MMV1/ExportSensorMMV1.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
#define WITH_MMV1_FUNCTION false

#if (WITH_MMV1_FUNCTION)
#include "V1VII.h"
#include "MMVII_util.h"
#endif

#include "MMVII_MMV1Compat.h"

namespace MMVII
{

#if (WITH_MMV1_FUNCTION)
/* ************************************************* */
/* */
/* cExportV1StenopeCalInterne */
Expand Down Expand Up @@ -154,5 +160,20 @@ cExportV1StenopeCalInterne::cExportV1StenopeCalInterne
if ((aNbLayer>0) && (aNbPointPerDim>0))
DoCorresp(mCorresp,aCamV1,aNbPointPerDim,aNbLayer,aDS);
}
#else
cExportV1StenopeCalInterne::cExportV1StenopeCalInterne
(
bool isForCalib,
const std::string& aFile,
int aNbPointPerDim,
int aNbLayer,
tREAL8 aDS,
const std::string& aFileInterneCalib
) :
mPose (cIsometry3D<tREAL8>::Identity())
{
MMVII_INTERNAL_ERROR("Reading of MMV1 Camera is deprecated");
}
#endif

};
16 changes: 6 additions & 10 deletions MMVII/src/MMV1/FluxPtsMMV1.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#define WITH_MMV1_FUNCTION false

#include "V1VII.h"
#include "MMVII_Geom2D.h"

Expand Down Expand Up @@ -35,6 +37,10 @@ Neighbourhood DiscNeich(const tREAL8 & aRay)

void FluxToV2Points(tResFlux & aRes,Flux_Pts aFlux)
{
//StdOut() << "FluxToV2PointsFluxToV2PointsFluxToV2PointsuuuuuuuuuuuuFluxToV2PointsFluxToV2PointsFluxToV2PointsFluxToV2PointsFluxToV2Points\n";
//getchar();


aRes.clear();
Liste_Pts<int,int> aLV1(2);

Expand Down Expand Up @@ -80,7 +86,6 @@ void GetPts_Ellipse(tResFlux & aRes,const cPt2dr & aC,double aRayA,double aRayB
}



void GetPts_Line(tResFlux & aRes,const cPt2dr & aP1,const cPt2dr &aP2,tREAL8 aDil)
{
Flux_Pts aFlux = line(ToMMV1(ToI(aP1)),ToMMV1(ToI(aP2)));
Expand All @@ -95,15 +100,6 @@ void GetPts_Line(tResFlux & aRes,const cPt2dr & aP1,const cPt2dr &aP2)
}


/*
void Txxxxxxxxx()
{
Flux_Pts disc(Pt2dr,REAL,bool front = true);
Neighbourhood
}
*/


};

Expand Down
Loading

0 comments on commit d00b6b2

Please sign in to comment.