/** * Returns A = A ./ B, where A is this matrix. * The symbol ./ denotes element-by-element right division. * @param b the matrix B. * @return A = A ./ B. */ public DMatrix arrayRightDivideEquals(DMatrix b) { div(_a,b._a,_a); return this; }
/** * Returns A = A .\ B, where A is this matrix. * The symbol .\ denotes element-by-element left division. * @param b the matrix B. * @return A = A .\ B. */ public DMatrix arrayLeftDivideEquals(DMatrix b) { div(b._a,_a,_a); return this; }
/** * Returns A = A ./ B, where A is this matrix. * The symbol ./ denotes element-by-element right division. * @param b the matrix B. * @return A = A ./ B. */ public DMatrix arrayRightDivideEquals(DMatrix b) { div(_a,b._a,_a); return this; }
/** * Returns A = A .\ B, where A is this matrix. * The symbol .\ denotes element-by-element left division. * @param b the matrix B. * @return A = A .\ B. */ public DMatrix arrayLeftDivideEquals(DMatrix b) { div(b._a,_a,_a); return this; }
/** * Returns C = A .\ B, where A is this matrix. * The symbol .\ denotes element-by-element left division. * @param b the matrix B. * @return C = A .\ B. */ public DMatrix arrayLeftDivide(DMatrix b) { DMatrix c = new DMatrix(_m,_n); div(b._a,_a,c._a); return c; }
/** * Returns C = A ./ B, where A is this matrix. * The symbol ./ denotes element-by-element right division. * @param b the matrix B. * @return C = A ./ B. */ public DMatrix arrayRightDivide(DMatrix b) { DMatrix c = new DMatrix(_m,_n); div(_a,b._a,c._a); return c; }
/** * Returns C = A ./ B, where A is this matrix. * The symbol ./ denotes element-by-element right division. * @param b the matrix B. * @return C = A ./ B. */ public DMatrix arrayRightDivide(DMatrix b) { DMatrix c = new DMatrix(_m,_n); div(_a,b._a,c._a); return c; }
/** * Returns C = A .\ B, where A is this matrix. * The symbol .\ denotes element-by-element left division. * @param b the matrix B. * @return C = A .\ B. */ public DMatrix arrayLeftDivide(DMatrix b) { DMatrix c = new DMatrix(_m,_n); div(b._a,_a,c._a); return c; }
M2(Tensors2 d, float c, float[][] s, float[][] x) { int n1 = x[0].length; int n2 = x.length; _p = fillfloat(1.0f,n1,n2); c *= 0.25f; float[] di = new float[3]; for (int i2=1,m2=0; i2<n2; ++i2,++m2) { for (int i1=1,m1=0; i1<n1; ++i1,++m1) { float si = s!=null?s[i2][i1]:1.0f; float csi = c*si; float d11 = csi; float d12 = 0.0f; float d22 = csi; if (d!=null) { d.getTensor(i1,i2,di); d11 = di[0]*csi; d12 = di[1]*csi; d22 = di[2]*csi; } _p[i2][i1] += (d11+d12)+( d12+d22); _p[m2][m1] += (d11+d12)+( d12+d22); _p[i2][m1] += (d11-d12)+(-d12+d22); _p[m2][i1] += (d11-d12)+(-d12+d22); } } div(1.0f,_p,_p); } public void apply(float[][] x, float[][] y) {
div(1.0f,_p,_p);
sqrt(sf,sf); sqrt(sg,sg); div(1.0f,sf,sf); div(1.0f,sg,sg); } else if (_dimension==2) { float[][] f = _f[0]; sqrt(sf,sf); sqrt(sg,sg); div(1.0f,sf,sf); div(1.0f,sg,sg); } else { float[][][] f = _f; sqrt(sf,sf); sqrt(sg,sg); div(1.0f,sf,sf); div(1.0f,sg,sg); mul(sf,sg,s); sqrt(s,s); div(1.0f,s,s); } else if (_dimension==2) { float[][] f = _f[0]; mul(sf,sg,s); sqrt(s,s); div(1.0f,s,s); } else {