Skip to content

Commit 8181451

Browse files
committed
Add default threshold and precision value for Output_HContainer.
1 parent 5ed2b2a commit 8181451

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

source/module_hamilt_lcao/module_hcontainer/output_hcontainer.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ Output_HContainer<T>::Output_HContainer(hamilt::HContainer<T>* hcontainer,
1818
int precision)
1919
: _hcontainer(hcontainer), _ofs(ofs), _sparse_threshold(sparse_threshold), _precision(precision)
2020
{
21+
if (this->_sparse_threshold == -1)
22+
{
23+
this->_sparse_threshold = 1e-10;
24+
}
25+
if (this->_precision == -1)
26+
{
27+
this->_precision = 8;
28+
}
2129
}
2230

2331
template <typename T>

source/module_hamilt_lcao/module_hcontainer/output_hcontainer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ template <typename T>
1313
class Output_HContainer
1414
{
1515
public:
16-
Output_HContainer(hamilt::HContainer<T>* hcontainer, std::ostream& ofs, double sparse_threshold, int precision);
16+
Output_HContainer(hamilt::HContainer<T>* hcontainer, std::ostream& ofs, double sparse_threshold = -1, int precision = -1);
1717
// write the matrices of all R vectors to the output stream
1818
void write();
1919

0 commit comments

Comments
 (0)