[DEV] update matrix template

This commit is contained in:
Edouard DUPIN 2012-12-11 22:48:23 +01:00
parent 1d4c27e7fd
commit 033c9dd63a

View File

@ -101,6 +101,14 @@ namespace etk
m_data = obj.m_data; m_data = obj.m_data;
return *this; return *this;
}; };
const Matrix<T>& operator= (T& value)
{
// set data :
for (int32_t iii=0; iii<m_data.Size(); iii++) {
m_data = value;
}
return *this;
};
/***************************************************** /*****************************************************
* == operator * == operator
*****************************************************/ *****************************************************/
@ -238,6 +246,12 @@ namespace etk
T* operator[] (int32_t line) { T* operator[] (int32_t line) {
return &m_data[line*m_size.x]; return &m_data[line*m_size.x];
} }
/*****************************************************
* () operator
*****************************************************/
T& operator () (int32_t line, int32_t colomn) {
return m_data[line*m_size.x + colomn];
}
/***************************************************** /*****************************************************
* Other mathematical function * Other mathematical function
*****************************************************/ *****************************************************/