Commit 51ecd218 authored by Patrick Jaap's avatar Patrick Jaap

SymmetrixMatrix: Identity matrix

parent efd45e10
......@@ -38,6 +38,16 @@ public:
data_[i] = *it;
}
/** \brief Construct identityMatrix */
static constexpr SymmetricMatrix<T,N> identityMatrix()
{
SymmetricMatrix<T,N> id;
for( size_t i=0; i<N*(N+1)/2; ++i)
id.setEntry(i,i,1);
return id;
}
SymmetricMatrix<T,N>& operator=(const T& s)
{
data_ = s;
......
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