Commit 1ff261cf authored by BRAMAS Berenger's avatar BRAMAS Berenger
parents 5aeb328b a47ac944
......@@ -28,7 +28,7 @@
//#define PARTIALLY_PIVOTED_ACA
/*! Choose \a RECOMPRESSED_ACA */
//#define RECOMPRESSED_ACA
#define RECOMPRESSED_ACA
template <class FReal, int ORDER = 14>
......@@ -48,7 +48,7 @@ protected:
public:
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
......
......@@ -110,7 +110,7 @@ protected:
public:
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
......
......@@ -36,11 +36,11 @@
#include <memory>
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){
typedef FDenseBlock<FReal> LeafClass;
typedef FSVDBlock<FReal,7> CellClass;
typedef FACABlock<FReal,7> CellClass;
typedef FStaticDiagonalBisection<FReal, LeafClass, CellClass> GridClass;
const int dim = matrix.getDim();
......@@ -94,13 +94,20 @@ int main(int argc, char** argv){
////////////////////////////////////////////////////////////////////
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* 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/unitCube1000.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);
std::cout << "Check until height = " << height << "\n";
typedef double FReal;
typedef FMatDensePerm<FReal> MatrixClass;
////////////////////////////////////////////////////////////////////
......@@ -126,6 +133,17 @@ int main(int argc, char** argv){
MatrixClass matrix(matrixFilename);
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);
std::cout << "Matrices dim = " << matrixDim << "\n";
......@@ -135,7 +153,7 @@ int main(int argc, char** argv){
std::cout << "Test FMaxDistCut\n";
FMaxDistCut<FReal> partitioner(matrixDim, distanceValues.get());
FClusterTree<double> tclusters;
FClusterTree<FReal> tclusters;
partitioner.fillClusterTree(&tclusters);
tclusters.checkData();
CheckRank<FReal, MatrixClass>(tclusters, matrix, outputdir, "FMaxDistCut", height);
......@@ -145,7 +163,7 @@ int main(int argc, char** argv){
std::cout << "Test FGraphThreshold\n";
FGraphThreshold<FReal> partitioner(matrixDim, distanceValues.get(), FGraphThreshold<FReal>::GetDefaultRadius(matrixDim, distanceValues.get()));
FClusterTree<double> tclusters;
FClusterTree<FReal> tclusters;
partitioner.fillClusterTree(&tclusters);
tclusters.checkData();
CheckRank<FReal, MatrixClass>(tclusters, matrix, outputdir, "FGraphThreshold", height);
......@@ -153,7 +171,7 @@ int main(int argc, char** argv){
////////////////////////////////////////////////////////////////////
{
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;
partitioner.fillClusterTree(&tclusters);
......
......@@ -30,21 +30,26 @@ int main(int argc, char** argv){
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 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 readNbCols = 0;
// Read distances
double* distances = nullptr;
FReal* distances = nullptr;
FAssertLF(FMatrixIO::read(filename, &distances, &readNbRows, &readNbCols));
FAssertLF(readNbRows == readNbCols);
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);
tclusters.checkData();
......@@ -56,7 +61,7 @@ int main(int argc, char** argv){
tclusters.getPartitions(height, nbPartitions, partitions.get());
{
typedef double FReal;
//typedef double FReal;
typedef FDenseBlock<FReal> LeafClass;
typedef FDenseBlock<FReal> CellClass;
typedef FStaticDiagonalBisection<FReal, LeafClass, CellClass> GridClass;
......
......@@ -38,7 +38,8 @@ int main(int argc, char** argv){
FTic time;
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);
......@@ -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> CellClass;
typedef FSVDBlock<FReal,7> CellClass;
......@@ -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> CellClass;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment