Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 18666b75 authored by BRAMAS Berenger's avatar BRAMAS Berenger
Browse files

update hmat

parent 9bd4a37f
No related branches found
No related tags found
No related merge requests found
#ifndef FHUTILS_HPP #ifndef FHUTILS_HPP
#define FHUTILS_HPP #define FHUTILS_HPP
// @SCALFMM_PRIVATE
#include "Utils/FGlobal.hpp" #include "Utils/FGlobal.hpp"
#include <cstring> #include <cstring>
......
#ifndef FSVGRECT_HPP #ifndef FSVGRECT_HPP
#define FSVGRECT_HPP #define FSVGRECT_HPP
// @SCALFMM_PRIVATE
#include "Utils/FGlobal.hpp" #include "Utils/FGlobal.hpp"
#include "Utils/FAssert.hpp" #include "Utils/FAssert.hpp"
......
#ifndef FDENSEBLOCKWRAPPER_HPP
#define FDENSEBLOCKWRAPPER_HPP
// @SCALFMM_PRIVATE
template <class FReal>
class FDenseBlockWrapper{
protected:
const FReal* values;
const int nbRows;
const int nbCols;
const int leadingDim;
public:
FDenseBlockWrapper(const FReal* inValues, const int inNbRows, const int inNbCols, const int inLeading)
: values(inValues), nbRows(inNbRows), nbCols(inNbCols), leadingDim(inLeading){
}
int getNbRows() const {
return nbRows;
}
int getNbCols() const {
return nbCols;
}
FReal getValue(const int rowIdx, const int colIdx) const{
FAssertLF(rowIdx < nbRows);
FAssertLF(colIdx < nbCols);
return values[colIdx*leadingDim + rowIdx];
}
constexpr bool existsForReal() const{
return true;
}
};
#endif // FDENSEBLOCKWRAPPER_HPP
...@@ -6,39 +6,7 @@ ...@@ -6,39 +6,7 @@
#include "Utils/FGlobal.hpp" #include "Utils/FGlobal.hpp"
#include "Utils/FAssert.hpp" #include "Utils/FAssert.hpp"
#include "FDenseBlockWrapper.hpp"
template <class FReal>
class FDenseBlockWrapper{
protected:
const FReal* values;
const int nbRows;
const int nbCols;
const int leadingDim;
public:
FDenseBlockWrapper(const FReal* inValues, const int inNbRows, const int inNbCols, const int inLeading)
: values(inValues), nbRows(inNbRows), nbCols(inNbCols), leadingDim(inLeading){
}
int getNbRows() const {
return nbRows;
}
int getNbCols() const {
return nbCols;
}
FReal getValue(const int rowIdx, const int colIdx) const{
FAssertLF(rowIdx < nbRows);
FAssertLF(colIdx < nbCols);
return values[colIdx*leadingDim + rowIdx];
}
constexpr bool existsForReal() const{
return true;
}
};
template <class FReal> template <class FReal>
class FMatGrid { class FMatGrid {
......
// @SCALFMM_PRIVATE // @SCALFMM_PRIVATE
#include "../Src/Core/FDiv2Bissection.hpp" #include "../Src/Containers/FDiv2Bissection.hpp"
#include "../Src/Containers/FMatGrid.hpp" #include "../Src/Viewers/FMatGrid.hpp"
#include "../Src/Utils/FSvgRect.hpp" #include "../Src/Utils/FSvgRect.hpp"
#include "Utils/FParameters.hpp" #include "Utils/FParameters.hpp"
......
// @SCALFMM_PRIVATE
#include "../Src/Containers/FDiv2Bissection.hpp"
#include "../Src/Viewers/FMatGrid.hpp"
#include "../Src/Blocks/FDenseMatrix.hpp"
#include "Utils/FParameters.hpp"
#include "Utils/FParameterNames.hpp"
int main(int argc, char** argv){
static const FParameterNames DimParam = {
{"-N", "-nb", "-dim"} ,
"Dim of the matrix."
};
static const FParameterNames HeightParam = {
{"-h", "-height"} ,
"Number of dissection (+1)."
};
FHelpDescribeAndExit(argc, argv,
"Test the bisection.",SvgOutParam,
DimParam,HeightParam);
const int dim = FParameters::getValue(argc, argv, DimParam.options, 100);
const int height = FParameters::getValue(argc, argv, HeightParam.options, 4);
std::cout << "Config : dim = " << dim << "\n";
std::cout << "Config : height = " << height << "\n";
{
typedef double FReal;
typedef FMatGrid<FReal> MatrixClass;
typedef FDenseMatrix<FReal> LeafClass;
typedef FDenseMatrix<FReal> CellClass;
typedef FDiv2Bissection<FReal, LeafClass, CellClass> GridClass;
GridClass bissection(dim, height);
bissection.fillBlocks(matrix);
}
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment