64 using typeT =
typename std::enable_if<
65 std::is_same<Real, T>::value || std::is_same<Real_t, T>::value ||
66 std::is_same<int, T>::value ||
67 std::is_same<uchar, T>::value ||
68 std::is_same<Complex<Real>, T>::value || std::is_same<Complex<Real_t>, T>::value, T>::type;
87 for (
int x = 0; x < size[
_X]; x++)
88 for (
int y = 0; y < size[
_Y]; y++) {
89 mat[x][y] = ref.
mat[x][y];
98 mat =
new std::vector<T>[size[0]];
99 for (
int x = 0; x < size[
_X]; x++) {
100 for (
int y = 0; y < size[
_Y]; y++) {
101 if (x == y && size[
_X] == size[
_Y])
120 size[0] = x; size[1] = y;
128 if (size[
_X] != size[
_Y])
return *
this;
129 for (
int x = 0; x < size[
_X]; x++) {
130 for (
int y = 0; y < size[
_Y]; y++) {
141 for (
int col = 0; col < size[
_COL]; col++) {
142 for (
int row = 0; row < size[
_ROW]; row++) {
232 if (size != p.
size)
return *
this;
234 for (
int x = 0; x < size[
_X]; x++) {
235 for (
int y = 0; y < size[
_Y]; y++) {
236 mat[x][y] += p[x][y];
244 if (size != p.
size)
return *
this;
246 for (
int x = 0; x < size[
_X]; x++) {
247 for (
int y = 0; y < size[
_Y]; y++) {
248 mat[x][y] -= p[x][y];
256 if (size[
_X] != p.
size[
_Y])
return *
this;
260 for (
int x = 0; x < res.
size[
_X]; x++) {
261 for (
int y = 0; y < res.
size[
_Y]; y++) {
263 for (
int num = 0; num < p.
size[
_X]; num++) {
264 res[x][y] += mat[x][num] * p[num][y];
275 if (size != p.
size)
return *
this;
277 for (
int x = 0; x < size[
_X]; x++) {
278 for (
int y = 0; y < size[
_Y]; y++) {
279 mat[x][y] /= p[x][y];
287 if (size != p.
size)
return *
this;
291 for (
int x = 0; x < res.
size[
_X]; x++) {
292 for (
int y = 0; y < res.
size[
_Y]; y++) {
294 res[x][y] = mat[x][y] * p.
mat[x][y];
308 T& operator ()(
int x,
int y) {
316 for (
int x = 0; x < size[
_X]; x++) {
317 for (
int y = 0; y < size[
_Y]; y++) {
318 mat[x][y] = p.
mat[x][y];
323 inline void operator =(T* p) {
324 for (
int x = 0; x < size[
_X]; x++) {
325 for (
int y = 0; y < size[
_Y]; y++) {
369 for (
int x = 0; x < size[
_X]; x++) {
370 for (
int y = 0; y < size[
_Y]; y++) {
378 for (
int x = 0; x < size[
_X]; x++) {
379 for (
int y = 0; y < size[
_Y]; y++) {
387 for (
int x = 0; x < size[
_X]; x++) {
388 for (
int y = 0; y < size[
_Y]; y++) {
396 for (
int x = 0; x < size[
_X]; x++) {
397 for (
int y = 0; y < size[
_Y]; y++) {
oph::matrix< Complex< Real > > OphComplexField
oph::ivec2 & getSize(void)
matrix< T > & sub(matrix< T > &p)
matrix< T > & add(matrix< T > &p)
matrix< T > & identity(void)
oph::matrix< Real_t > OphRealTField
matrix< T > & mulElem(matrix< T > &p)
ivec2 operator-(const ivec2 &a, const ivec2 &b)
oph::matrix< int > OphIntField
structure for 2-dimensional integer vector and its arithmetic.
matrix< T > & resize(int x, int y)
ivec2 operator+(const ivec2 &a, const ivec2 &b)
oph::matrix< uchar > OphByteField
ivec2 operator*(const ivec2 &a, const ivec2 &b)
matrix(const matrix< T > &ref)
oph::matrix< Real > OphRealField
matrix< T > & zeros(void)
vec2 operator/(const vec2 &a, const vec2 &b)
std::vector< T > & operator[](const int index)
matrix< T > & mul(matrix< T > &p)
oph::matrix< Complex< Real_t > > OphComplexTField
matrix< T > & div(matrix< T > &p)