Commit 3b4584f7 authored by Adam Procter's avatar Adam Procter

More cleanup; make 'undetermined' the default val for rank, length

parent d9004a3f
...@@ -39,7 +39,7 @@ namespace ngraph ...@@ -39,7 +39,7 @@ namespace ngraph
} }
Length() Length()
: m_length(0) : m_length(0)
, m_is_determined(true) , m_is_determined(false)
{ {
} }
bool is_determined() const { return m_is_determined; } bool is_determined() const { return m_is_determined; }
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
std::ostream& ngraph::operator<<(std::ostream& str, const Rank& rank) std::ostream& ngraph::operator<<(std::ostream& str, const Rank& rank)
{ {
if (rank.is_fixed()) if (rank.is_determined())
{ {
return (str << size_t(rank)); return (str << size_t(rank));
} }
...@@ -30,10 +30,10 @@ std::ostream& ngraph::operator<<(std::ostream& str, const Rank& rank) ...@@ -30,10 +30,10 @@ std::ostream& ngraph::operator<<(std::ostream& str, const Rank& rank)
bool ngraph::operator==(const Rank& r1, const Rank& r2) bool ngraph::operator==(const Rank& r1, const Rank& r2)
{ {
return (r1.is_fixed() && r2.is_fixed() && size_t(r1) == size_t(r2)); return (r1.is_determined() && r2.is_determined() && size_t(r1) == size_t(r2));
} }
bool ngraph::operator!=(const Rank& r1, const Rank& r2) bool ngraph::operator!=(const Rank& r1, const Rank& r2)
{ {
return (r1.is_fixed() && r2.is_fixed() && size_t(r1) != size_t(r2)); return (r1.is_determined() && r2.is_determined() && size_t(r1) != size_t(r2));
} }
...@@ -29,24 +29,24 @@ namespace ngraph ...@@ -29,24 +29,24 @@ namespace ngraph
public: public:
Rank(size_t rank) Rank(size_t rank)
: m_rank(rank) : m_rank(rank)
, m_fixed(true) , m_is_determined(true)
{ {
} }
Rank(const Undetermined&) Rank(const Undetermined&)
: m_rank(0) : m_rank(0)
, m_fixed(false) , m_is_determined(false)
{ {
} }
Rank() Rank()
: m_rank(0) : m_rank(0)
, m_fixed(true) , m_is_determined(false)
{ {
} }
bool is_fixed() const { return m_fixed; } bool is_determined() const { return m_is_determined; }
explicit operator size_t() const { return m_rank; } explicit operator size_t() const { return m_rank; }
private: private:
size_t m_rank; size_t m_rank;
bool m_fixed; bool m_is_determined;
}; };
std::ostream& operator<<(std::ostream& str, const Rank& rank); std::ostream& operator<<(std::ostream& str, const Rank& rank);
......
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