diff --git a/Addons/HMat/Src/Blocks/FACABlock.hpp b/Addons/HMat/Src/Blocks/FACABlock.hpp index 8ff3d62558cf1e716e89c45208883e27623c6e9a..0ab918676bb61dcd83ddf995b0a5578632ee95a6 100644 --- a/Addons/HMat/Src/Blocks/FACABlock.hpp +++ b/Addons/HMat/Src/Blocks/FACABlock.hpp @@ -91,7 +91,7 @@ public: #endif // display rank - std::cout << "rank after ACA=" << rank << std::endl; + std::cout << "rank after ACA=" << rank << " (" << nbRows << "," << nbCols << ")" << std::endl; #if (defined RECOMPRESSED_ACA) @@ -173,6 +173,9 @@ public: } + int getRank() const{ + return rank; + } }; diff --git a/Addons/HMat/Src/Blocks/FSVDBlock.hpp b/Addons/HMat/Src/Blocks/FSVDBlock.hpp index 46ea24c8b778e3e0b108a0138bea87b34c2f9c2f..76a330cd6fcb20291d14b0c9ee9c7765d89ead2a 100644 --- a/Addons/HMat/Src/Blocks/FSVDBlock.hpp +++ b/Addons/HMat/Src/Blocks/FSVDBlock.hpp @@ -48,7 +48,7 @@ static void computeSVD(const FSize nbRows, const FSize nbCols, const FReal* A, F // nothing means OS (the opposite of SO, A=USVT) //is_int(size); is_int(LWORK); const unsigned int INFOSVD - = FBlas::gesvd(int(nbRows), int(nbCols), U, S, VT, int(minMN), + = FBlas::gesvd(int(nbRows), int(nbCols), U, S, VT, int(minMN)/*ldVT*/, int(LWORK), WORK); if(verbose) { if(INFOSVD!=0) {std::cout << " failed!" << std::endl;} @@ -132,7 +132,7 @@ public: // SVD specific (col major) rank = std::min(nbRows,nbCols); S = new FReal[rank]; - FReal* _U = new FReal[nbRows*nbCols]; // Call to computeSVD() copies block into U + FReal* _U = new FReal[nbRows*nbCols]; // Call to computeSVD() copies block MxN into _U and stores first min(M,N) cols of U into _U FReal* _VT = new FReal[rank*nbCols]; FBlas::setzero(int(rank), S); FBlas::setzero(int(rank*nbCols),_VT); @@ -142,8 +142,14 @@ public: // Determine numerical rank using prescribed accuracy computeNumericalRank(rank, S, accuracy); + //// Display singular values + //std::cout << "S = ["; + //for(int idxRow = 0 ; idxRow < rank ; ++idxRow) + // std::cout << S[idxRow] << " " ; + //std::cout << "]" << std::endl; + //// display rank - //std::cout << "rank=" << rank << std::endl; + std::cout << "rank SVD =" << rank << " (" << nbRows << "," << nbCols << ")" << std::endl; // Resize U and VT U = new FReal[nbRows*rank]; // Call to computeSVD() copies block into U diff --git a/Addons/HMat/Tests/testCompareClusteringRank.cpp b/Addons/HMat/Tests/testCompareClusteringRank.cpp index 9f1fd2519877ef848876615d10f44fa86a707ab3..2484442a693d7b76236d81cff71d2b94afa2da7c 100644 --- a/Addons/HMat/Tests/testCompareClusteringRank.cpp +++ b/Addons/HMat/Tests/testCompareClusteringRank.cpp @@ -20,6 +20,7 @@ #include "../Src/Viewers/FMatDensePerm.hpp" #include "../Src/Blocks/FDenseBlock.hpp" #include "../Src/Blocks/FSVDBlock.hpp" +#include "../Src/Blocks/FACABlock.hpp" #include "../Src/Clustering/FMaxDistCut.hpp" #include "../Src/Clustering/FCCLTreeCluster.hpp" @@ -93,7 +94,7 @@ 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_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 int height = FParameters::getValue(argc, argv, FParameterDefinitions::OctreeHeight.options, 4); diff --git a/Addons/HMat/Tests/testSDBGemvFile.cpp b/Addons/HMat/Tests/testSDBGemvFile.cpp index dfb847a3ff308253ef9f39ffde3cf7b16b965989..0d757b8fd7f828ea54235811c55869669510f53a 100644 --- a/Addons/HMat/Tests/testSDBGemvFile.cpp +++ b/Addons/HMat/Tests/testSDBGemvFile.cpp @@ -70,8 +70,8 @@ int main(int argc, char** argv){ std::cout << "Test Dense:\n"; typedef FDenseBlock<FReal> LeafClass; //typedef FDenseBlock<FReal> CellClass; - //typedef FSVDBlock<FReal,7> CellClass; - typedef FACABlock<FReal,7> CellClass; + typedef FSVDBlock<FReal,7> CellClass; + //typedef FACABlock<FReal,7> CellClass; typedef FStaticDiagonalBisection<FReal, LeafClass, CellClass> GridClass; @@ -102,8 +102,8 @@ int main(int argc, char** argv){ typedef FDenseBlock<FReal> LeafClass; //typedef FDenseBlock<FReal> CellClass; - //typedef FSVDBlock<FReal,7> CellClass; - typedef FACABlock<FReal,7> CellClass; + typedef FSVDBlock<FReal,7> CellClass; + //typedef FACABlock<FReal,7> CellClass; typedef FStaticDiagonalBisection<FReal, LeafClass, CellClass> GridClass;