提交 cf205d0d 编写于 作者: X xutianbing

deepSwap

上级 fc32721f
...@@ -1240,6 +1240,12 @@ void BaseMatrixT<T>::assignAtOffset(BaseMatrixT& b, int64_t columnOffset) { ...@@ -1240,6 +1240,12 @@ void BaseMatrixT<T>::assignAtOffset(BaseMatrixT& b, int64_t columnOffset) {
} }
} }
DEFINE_MATRIX_BINARY_OP(DeepSwap, T tmp = a; a = b; b = tmp);
template<class T>
void BaseMatrixT<T>::deepSwap(BaseMatrixT& b) {
applyBinary(binary::DeepSwap<T>(), b);
}
template<> template<>
void BaseMatrixT<real>::rowDotMul(size_t destCol, void BaseMatrixT<real>::rowDotMul(size_t destCol,
BaseMatrixT& b, BaseMatrixT& b,
......
...@@ -455,6 +455,13 @@ public: ...@@ -455,6 +455,13 @@ public:
*/ */
void assign(T p); void assign(T p);
/**
* @code
* swap(this, b)
* @endcode
*/
void deepSwap(BaseMatrixT& b);
/** /**
* @code * @code
* this = this + p * this = this + p
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册