Skip to content
Snippets Groups Projects
Commit e7e0735b authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[MaL] Eigen: cleanup and unify documentation.

Wrong parameter names.
Empty statements.
Unify comment style. /* */ vs ///
parent a2691ee2
No related branches found
No related tags found
No related merge requests found
......@@ -22,8 +22,6 @@ namespace MathLib
class EigenMatrix;
/**
*/
class EigenLinearSolver final
{
public:
......@@ -35,20 +33,17 @@ public:
}
/**
* configure linear solvers
* @param option
* parse linear solvers configuration
*/
void setOption(const boost::property_tree::ptree &option);
/**
* configure linear solvers
* @param option
* copy linear solvers options
*/
void setOption(const EigenOption &option) { _option = option; }
/**
* get linear solver options
* @return
*/
EigenOption &getOption() { return _option; }
......
......@@ -36,7 +36,7 @@ public:
/**
* constructor
* @param n_rows the number of rows (that is equal to the number of columns)
* @param n the number of rows (that is equal to the number of columns)
*/
explicit EigenMatrix(std::size_t n) :_mat(n, n) {}
......@@ -95,16 +95,14 @@ public:
this->add(indices.rows, indices.columns, sub_matrix, fkt);
}
/**
* Add sub-matrix at positions \c row_pos and \c col_pos. If the entries doesn't
* exist in the matrix, the values are inserted.
* @param row_pos a vector of row position indices. The vector size should
* equal to the number of rows in the given sub-matrix.
* @param col_pos a vector of column position indices. The vector size should
* equal to the number of columns in the given sub-matrix.
* @param sub_matrix a sub-matrix to be added
* @param fkt a scaling factor applied to all entries in the sub-matrix
*/
/// Add sub-matrix at positions \c row_pos and \c col_pos. If the entries doesn't
/// exist in the matrix, the values are inserted.
/// @param row_pos a vector of row position indices. The vector size should
/// equal to the number of rows in the given sub-matrix.
/// @param col_pos a vector of column position indices. The vector size should
/// equal to the number of columns in the given sub-matrix.
/// @param sub_matrix a sub-matrix to be added
/// @param fkt a scaling factor applied to all entries in the sub-matrix
template <class T_DENSE_MATRIX>
void add(std::vector<std::size_t> const& row_pos,
std::vector<std::size_t> const& col_pos, const T_DENSE_MATRIX &sub_matrix,
......
......@@ -15,9 +15,7 @@
namespace MathLib
{
/**
* \brief Option for Eigen sparse solver
*/
/// \brief Option for Eigen sparse solver
struct EigenOption final
{
/// Solver type
......@@ -45,35 +43,29 @@ struct EigenOption final
/// Error tolerance
double error_tolerance;
/**
* Constructor
*
* Default options are CG, no preconditioner, iteration count 500 and
* tolerance 1e-10. Default matrix storage type is CRS.
*/
/// Constructor
///
/// Default options are CG, no preconditioner, iteration count 500 and
/// tolerance 1e-10. Default matrix storage type is CRS.
EigenOption();
/**
* return a linear solver type from the solver name
*
* @param solver_name
* @return a linear solver type
* If there is no solver type matched with the given name, INVALID
* is returned.
*/
/// return a linear solver type from the solver name
///
/// @param solver_name
/// @return a linear solver type
/// If there is no solver type matched with the given name, INVALID
/// is returned.
static SolverType getSolverType(const std::string &solver_name);
/**
* return a preconditioner type from the name
*
* @param precon_name
* @return a preconditioner type
* If there is no preconditioner type matched with the given name, NONE
* is returned.
*/
/// return a preconditioner type from the name
///
/// @param precon_name
/// @return a preconditioner type
/// If there is no preconditioner type matched with the given name, NONE
/// is returned.
static PreconType getPreconType(const std::string &precon_name);
};
}
#endif //LIS_OPTION_H_
#endif // EIGENOPTION_H_
......@@ -21,18 +21,14 @@
namespace MathLib
{
/**
* Global vector based on Eigen vector
*/
/// Global vector based on Eigen vector
class EigenVector final
{
public:
using RawVectorType = Eigen::VectorXd;
/**
* Constructor for initialization of the number of rows
* @param length number of rows
*/
/// Constructor for initialization of the number of rows
/// @param length number of rows
explicit EigenVector(std::size_t length) : _vec(length) {}
/// copy constructor
......@@ -88,10 +84,10 @@ public:
void write (const std::string &filename) const { std::ofstream os(filename); os << _vec; }
#endif
/// return a raw Lis vector object
/// return a raw Eigen vector object
RawVectorType& getRawVector() {return _vec; }
/// return a raw Lis vector object
/// return a raw Eigen vector object
const RawVectorType& getRawVector() const {return _vec; }
/// vector operation: set data
......
......@@ -38,20 +38,17 @@ public:
EigenLisLinearSolver(EigenMatrix &A, boost::property_tree::ptree const*const option = nullptr);
/**
* configure linear solvers
* @param option
* parse linear solvers configuration
*/
void setOption(const boost::property_tree::ptree &option);
/**
* configure linear solvers
* @param option
* copy linear solvers options
*/
void setOption(const LisOption &option) { _option = option; }
/**
* get linear solver options
* @return
*/
LisOption &getOption() { return _option; }
......
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