Commit 760ca043 authored by Kirill Terekhov's avatar Kirill Terekhov

threshold for printing derivatives in variable

parent a83e629e
......@@ -340,10 +340,10 @@ namespace INMOST
{
return 1 + v[0].first;
}
void Print() const
void Print(double eps = -1) const
{
std::cout << value << std::endl;
entries.Print();
entries.Print(eps);
}
void swap(multivar_expression & b)
{
......
......@@ -295,10 +295,11 @@ namespace INMOST
/// @param size New size of the row.
void Resize(INMOST_DATA_ENUM_TYPE size) {data.resize(size);}
/// Output all entries of the row.
void Print() const
void Print(double eps = -1) const
{
for(const_iterator it = Begin(); it != End(); ++it) std::cout << "(" << it->first << "," << it->second << ") ";
std::cout << std::endl;
int k = 0;
for(const_iterator it = Begin(); it != End(); ++it) if( fabs(it->second) > eps ) {std::cout << "(" << it->first << "," << it->second << ") "; k++; }
if( k ) std::cout << std::endl;
}
/// Check whether the row is sorted.
bool isSorted() const;
......
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