public TRFN Multiplication(TRFN N1, TRFN N2) { OperacionesNumericas opn = new OperacionesNumericas(); double t = (tmult(N1, N2).Max() - tmult(N1, N2).Min()) / 2; double ab = opn.ValorAbsoluto((N1.U * N2.Alfa) + opn.ValorAbsoluto(N2.U * N1.Alfa)); return(new TRFN(Constantes.NDType.AlfaBetaType, opn.Media(N1.L, N1.U) * opn.Media(N2.L, N2.U) - t, opn.Media(N1.L, N1.U) * opn.Media(N2.L, N2.U) + t, opn.ValorAbsoluto(ab), opn.ValorAbsoluto(ab))); }
public TRFN(Constantes.NDType nDType, double a1, double a2, double a3alf, double a4bet) { OperacionesNumericas op = new OperacionesNumericas(); if (nDType == Constantes.NDType.AlfaBetaType) { this.L = a1; this.U = a2; this.Alfa = a3alf; this.Beta = a4bet; this.A2 = a1; this.A3 = a2; this.A1 = a1 - a3alf; this.A4 = a2 + a4bet; } else if (nDType == Constantes.NDType.NumType) { this.A1 = a1; this.A2 = a2; this.A3 = a3alf; this.A4 = a4bet; this.L = a2; this.U = a3alf; this.Alfa = a2 - a1; this.Beta = a4bet - a3alf; } if (IsZero()) { this.A1 = 0; this.A2 = 0; this.A3 = 0; this.A4 = 0; this.L = 0; this.U = 0; this.Alfa = 0; this.Beta = 0; } }