Commit 18666b75 authored by BRAMAS Berenger's avatar BRAMAS Berenger
Browse files

update hmat

parent 9bd4a37f
#ifndef FHUTILS_HPP
#define FHUTILS_HPP
// @SCALFMM_PRIVATE
#include "Utils/FGlobal.hpp"
#include <cstring>
......
#ifndef FSVGRECT_HPP
#define FSVGRECT_HPP
// @SCALFMM_PRIVATE
#include "Utils/FGlobal.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 @@
#include "Utils/FGlobal.hpp"
#include "Utils/FAssert.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;
}
};
#include "FDenseBlockWrapper.hpp"
template <class FReal>
class FMatGrid {
......
// @SCALFMM_PRIVATE
#include "../Src/Core/FDiv2Bissection.hpp"
#include "../Src/Containers/FMatGrid.hpp"
#include "../Src/Containers/FDiv2Bissection.hpp"
#include "../Src/Viewers/FMatGrid.hpp"
#include "../Src/Utils/FSvgRect.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;
}
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