Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 1ff261cf authored by BRAMAS Berenger's avatar BRAMAS Berenger
Browse files
parents 5aeb328b a47ac944
No related branches found
No related tags found
No related merge requests found
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
//#define PARTIALLY_PIVOTED_ACA //#define PARTIALLY_PIVOTED_ACA
/*! Choose \a RECOMPRESSED_ACA */ /*! Choose \a RECOMPRESSED_ACA */
//#define RECOMPRESSED_ACA #define RECOMPRESSED_ACA
template <class FReal, int ORDER = 14> template <class FReal, int ORDER = 14>
...@@ -48,7 +48,7 @@ protected: ...@@ -48,7 +48,7 @@ protected:
public: public:
FACABlock() FACABlock()
: block(nullptr), U(nullptr), VT(nullptr), nbRows(0), nbCols(0), level(0), rank(0), accuracy(FMath::pow(10.0,static_cast<FReal>(-ORDER))) { : block(nullptr), U(nullptr), VT(nullptr), nbRows(0), nbCols(0), level(0), rank(0), accuracy(FMath::pow(FReal(10.0),static_cast<FReal>(-ORDER))) {
} }
// ctor // ctor
......
...@@ -110,7 +110,7 @@ protected: ...@@ -110,7 +110,7 @@ protected:
public: public:
FSVDBlock() FSVDBlock()
: block(nullptr), U(nullptr), S(nullptr), VT(nullptr), nbRows(0), nbCols(0), level(0), rank(0), accuracy(FMath::pow(10.0,static_cast<FReal>(-ORDER))) { : block(nullptr), U(nullptr), S(nullptr), VT(nullptr), nbRows(0), nbCols(0), level(0), rank(0), accuracy(FMath::pow(FReal(10.0),static_cast<FReal>(-ORDER))) {
} }
// ctor // ctor
......
...@@ -36,11 +36,11 @@ ...@@ -36,11 +36,11 @@
#include <memory> #include <memory>
template <class FReal, class MatrixClass> template <class FReal, class MatrixClass>
void CheckRank(const FClusterTree<double>& ctree, MatrixClass& matrix, void CheckRank(const FClusterTree<FReal>& ctree, MatrixClass& matrix,
const char outputdir[], const char configName[], const int height){ const char outputdir[], const char configName[], const int height){
typedef FDenseBlock<FReal> LeafClass; typedef FDenseBlock<FReal> LeafClass;
typedef FSVDBlock<FReal,7> CellClass; typedef FACABlock<FReal,7> CellClass;
typedef FStaticDiagonalBisection<FReal, LeafClass, CellClass> GridClass; typedef FStaticDiagonalBisection<FReal, LeafClass, CellClass> GridClass;
const int dim = matrix.getDim(); const int dim = matrix.getDim();
...@@ -94,13 +94,20 @@ int main(int argc, char** argv){ ...@@ -94,13 +94,20 @@ int main(int argc, char** argv){
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
const char* outputdir = FParameters::getStr(argc, argv, SvgOutParam.options, "/tmp/"); const char* outputdir = FParameters::getStr(argc, argv, SvgOutParam.options, "/tmp/");
const char* distanceFilename = FParameters::getStr(argc, argv, FParameterDefinitions::InputFileOne.options, "../Addons/HMat/Data/unitCube1000.bin"); //const char* distanceFilename = FParameters::getStr(argc, argv, FParameterDefinitions::InputFileOne.options, "../Addons/HMat/Data/unitCube1000.bin");
const char* matrixFilename = FParameters::getStr(argc, argv, FParameterDefinitions::InputFileTwow.options, "../Addons/HMat/Data/unitCube1000_ONE_OVER_R.bin"); //const char* matrixFilename = FParameters::getStr(argc, argv, FParameterDefinitions::InputFileTwow.options, "../Addons/HMat/Data/unitCube1000_ONE_OVER_R.bin");
const char* distanceFilename = FParameters::getStr(argc, argv, FParameterDefinitions::InputFileOne.options, "../Addons/HMat/Data/unitSphere1000.bin");
const char* matrixFilename = FParameters::getStr(argc, argv, FParameterDefinitions::InputFileTwow.options, "../Addons/HMat/Data/unitSphere1000_GAUSS100.bin");
typedef double FReal;
//const char* distanceFilename = FParameters::getStr(argc, argv, FParameterDefinitions::InputFileOne.options, "../Addons/HMat/Data/first_reads_1k-fmr-dissw.bin");
//const char* matrixFilename = FParameters::getStr(argc, argv, FParameterDefinitions::InputFileTwow.options, "../Addons/HMat/Data/first_reads_1k-fmr-covar.bin");
//typedef float FReal;
const int height = FParameters::getValue(argc, argv, FParameterDefinitions::OctreeHeight.options, 4); const int height = FParameters::getValue(argc, argv, FParameterDefinitions::OctreeHeight.options, 4);
std::cout << "Check until height = " << height << "\n"; std::cout << "Check until height = " << height << "\n";
typedef double FReal;
typedef FMatDensePerm<FReal> MatrixClass; typedef FMatDensePerm<FReal> MatrixClass;
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
...@@ -126,6 +133,17 @@ int main(int argc, char** argv){ ...@@ -126,6 +133,17 @@ int main(int argc, char** argv){
MatrixClass matrix(matrixFilename); MatrixClass matrix(matrixFilename);
const int matrixDim = matrix.getDim(); const int matrixDim = matrix.getDim();
// Display covariance matrix
const FSize displaySize = 10;
std::cout<<"\nC=["<<std::endl;
for ( int i=0; i<displaySize; ++i) {
for ( int j=0; j<displaySize; ++j)
std::cout << matrix.getVal(i,j) << " ";
std::cout<< std::endl;
}
std::cout<<"]"<<std::endl;
FAssertLF(distanceValuesDim == matrixDim); FAssertLF(distanceValuesDim == matrixDim);
std::cout << "Matrices dim = " << matrixDim << "\n"; std::cout << "Matrices dim = " << matrixDim << "\n";
...@@ -135,7 +153,7 @@ int main(int argc, char** argv){ ...@@ -135,7 +153,7 @@ int main(int argc, char** argv){
std::cout << "Test FMaxDistCut\n"; std::cout << "Test FMaxDistCut\n";
FMaxDistCut<FReal> partitioner(matrixDim, distanceValues.get()); FMaxDistCut<FReal> partitioner(matrixDim, distanceValues.get());
FClusterTree<double> tclusters; FClusterTree<FReal> tclusters;
partitioner.fillClusterTree(&tclusters); partitioner.fillClusterTree(&tclusters);
tclusters.checkData(); tclusters.checkData();
CheckRank<FReal, MatrixClass>(tclusters, matrix, outputdir, "FMaxDistCut", height); CheckRank<FReal, MatrixClass>(tclusters, matrix, outputdir, "FMaxDistCut", height);
...@@ -145,7 +163,7 @@ int main(int argc, char** argv){ ...@@ -145,7 +163,7 @@ int main(int argc, char** argv){
std::cout << "Test FGraphThreshold\n"; std::cout << "Test FGraphThreshold\n";
FGraphThreshold<FReal> partitioner(matrixDim, distanceValues.get(), FGraphThreshold<FReal>::GetDefaultRadius(matrixDim, distanceValues.get())); FGraphThreshold<FReal> partitioner(matrixDim, distanceValues.get(), FGraphThreshold<FReal>::GetDefaultRadius(matrixDim, distanceValues.get()));
FClusterTree<double> tclusters; FClusterTree<FReal> tclusters;
partitioner.fillClusterTree(&tclusters); partitioner.fillClusterTree(&tclusters);
tclusters.checkData(); tclusters.checkData();
CheckRank<FReal, MatrixClass>(tclusters, matrix, outputdir, "FGraphThreshold", height); CheckRank<FReal, MatrixClass>(tclusters, matrix, outputdir, "FGraphThreshold", height);
...@@ -153,7 +171,7 @@ int main(int argc, char** argv){ ...@@ -153,7 +171,7 @@ int main(int argc, char** argv){
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
{ {
std::cout << "Test FCCLTreeCluster\n"; std::cout << "Test FCCLTreeCluster\n";
FCCLTreeCluster<FReal> partitioner(matrixDim, distanceValues.get(), CCL::CCL_TM_MAXIMUM); FCCLTreeCluster<double> partitioner(matrixDim, distanceValues.get(), CCL::CCL_TM_MAXIMUM);
FClusterTree<double> tclusters; FClusterTree<double> tclusters;
partitioner.fillClusterTree(&tclusters); partitioner.fillClusterTree(&tclusters);
......
...@@ -30,21 +30,26 @@ int main(int argc, char** argv){ ...@@ -30,21 +30,26 @@ int main(int argc, char** argv){
FHelpDescribeAndExit(argc, argv,"Test the bisection.",SvgOutParam,DimParam,FParameterDefinitions::OctreeHeight); FHelpDescribeAndExit(argc, argv,"Test the bisection.",SvgOutParam,DimParam,FParameterDefinitions::OctreeHeight);
const char* filename = FParameters::getStr(argc, argv, FParameterDefinitions::InputFile.options, "../Addons/HMat/Data/unitCube1000.bin");
const int height = FParameters::getValue(argc, argv, FParameterDefinitions::OctreeHeight.options, 4); const int height = FParameters::getValue(argc, argv, FParameterDefinitions::OctreeHeight.options, 4);
const char* outputdir = FParameters::getStr(argc, argv, SvgOutParam.options, "/tmp/"); const char* outputdir = FParameters::getStr(argc, argv, SvgOutParam.options, "/tmp/");
//const char* filename = FParameters::getStr(argc, argv, FParameterDefinitions::InputFile.options, "../Addons/HMat/Data/unitCube1000.bin");
//typedef double FReal;
const char* filename = FParameters::getStr(argc, argv, FParameterDefinitions::InputFileOne.options, "../Addons/HMat/Data/first_reads_1k-fmr-dissw.bin");
typedef float FReal;
int readNbRows = 0; int readNbRows = 0;
int readNbCols = 0; int readNbCols = 0;
// Read distances // Read distances
double* distances = nullptr; FReal* distances = nullptr;
FAssertLF(FMatrixIO::read(filename, &distances, &readNbRows, &readNbCols)); FAssertLF(FMatrixIO::read(filename, &distances, &readNbRows, &readNbCols));
FAssertLF(readNbRows == readNbCols); FAssertLF(readNbRows == readNbCols);
const int dim = readNbRows; const int dim = readNbRows;
FGraphThreshold<double> partitioner(dim, distances, FGraphThreshold<double>::GetDefaultRadius(dim, distances)); FGraphThreshold<FReal> partitioner(dim, distances, FGraphThreshold<FReal>::GetDefaultRadius(dim, distances));
FClusterTree<double> tclusters; FClusterTree<FReal> tclusters;
partitioner.fillClusterTree(&tclusters); partitioner.fillClusterTree(&tclusters);
tclusters.checkData(); tclusters.checkData();
...@@ -56,7 +61,7 @@ int main(int argc, char** argv){ ...@@ -56,7 +61,7 @@ int main(int argc, char** argv){
tclusters.getPartitions(height, nbPartitions, partitions.get()); tclusters.getPartitions(height, nbPartitions, partitions.get());
{ {
typedef double FReal; //typedef double FReal;
typedef FDenseBlock<FReal> LeafClass; typedef FDenseBlock<FReal> LeafClass;
typedef FDenseBlock<FReal> CellClass; typedef FDenseBlock<FReal> CellClass;
typedef FStaticDiagonalBisection<FReal, LeafClass, CellClass> GridClass; typedef FStaticDiagonalBisection<FReal, LeafClass, CellClass> GridClass;
......
...@@ -38,7 +38,8 @@ int main(int argc, char** argv){ ...@@ -38,7 +38,8 @@ int main(int argc, char** argv){
FTic time; FTic time;
time.tic(); time.tic();
const char* filename = FParameters::getStr(argc, argv, FParameterDefinitions::InputFile.options, "../Addons/HMat/Data/unitCube1000_ONE_OVER_R.bin"); //const char* filename = FParameters::getStr(argc, argv, FParameterDefinitions::InputFile.options, "../Addons/HMat/Data/unitCube1000_ONE_OVER_R.bin");
const char* filename = FParameters::getStr(argc, argv, FParameterDefinitions::InputFile.options, "../Addons/HMat/Data/unitSphere1000_GAUSS100.bin");
const int height = FParameters::getValue(argc, argv, FParameterDefinitions::OctreeHeight.options, 4); const int height = FParameters::getValue(argc, argv, FParameterDefinitions::OctreeHeight.options, 4);
...@@ -67,7 +68,7 @@ int main(int argc, char** argv){ ...@@ -67,7 +68,7 @@ int main(int argc, char** argv){
} }
{ {
std::cout << "Test Dense:\n"; std::cout << "Test Dense leaves + Low rank cells:\n";
typedef FDenseBlock<FReal> LeafClass; typedef FDenseBlock<FReal> LeafClass;
//typedef FDenseBlock<FReal> CellClass; //typedef FDenseBlock<FReal> CellClass;
typedef FSVDBlock<FReal,7> CellClass; typedef FSVDBlock<FReal,7> CellClass;
...@@ -98,7 +99,7 @@ int main(int argc, char** argv){ ...@@ -98,7 +99,7 @@ int main(int argc, char** argv){
{ {
std::cout << "Test Dense with partitions:\n"; std::cout << "Test Dense leaves + Low rank cells, with partitions:\n";
typedef FDenseBlock<FReal> LeafClass; typedef FDenseBlock<FReal> LeafClass;
//typedef FDenseBlock<FReal> CellClass; //typedef FDenseBlock<FReal> CellClass;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment