Package com.opengamma.analytics.math.linearalgebra

Examples of com.opengamma.analytics.math.linearalgebra.TridiagonalMatrix


    } else {
      a[n - 1] = deltaX[n - 2] / 3.0;
      c[n - 2] = deltaX[n - 2] / 6.0;
    }

    final TridiagonalMatrix tridiagonal = new TridiagonalMatrix(a, b, c);
    return invertor.evaluate(tridiagonal);
  }
View Full Code Here


      b[i] = doubMat[i][i];
      c[i] = doubMat[i + 1][i];
    }
    b[sizeM1] = doubMat[sizeM1][sizeM1];

    final TridiagonalMatrix m = new TridiagonalMatrix(b, a, c);

    return solvTriDag(m, doubVec);
  }
View Full Code Here

      u[i] = doubMat1[i][i + 1];
      d[i] = doubMat1[i][i];
      l[i] = doubMat1[i + 1][i];
    }
    d[size - 1] = doubMat1[size - 1][size - 1];
    final TridiagonalMatrix m = new TridiagonalMatrix(d, u, l);
    res[0] = new DoubleMatrix1D(solvTriDag(m, doubVec));
    for (int i = 0; i < size; ++i) {
      final double[] doubMat2Colum = doubMat2Matrix.getColumnVector(i).getData();
      res[i + 1] = new DoubleMatrix1D(solvTriDag(m, doubMat2Colum));
    }
View Full Code Here

        for (int ii = 1; ii < _nNodesX - 1; ii++) {
          d[ii] = 1 + _theta * dt * cDag[ii - 1];
          u[ii] = _theta * dt * uDag[ii - 1];
          l[ii - 1] = _theta * dt * lDag[ii - 1];
        }
        final TridiagonalMatrix lhs = new TridiagonalMatrix(d, u, l);

        //solve the system (update h)
        switch (_mode) {
          case tridiagonal:
            h = solvTriDag(lhs, y);
View Full Code Here

        l[ii] = RANDOM.nextRandom();
        u[ii] = RANDOM.nextRandom();
      }
    }

    final TridiagonalMatrix m = new TridiagonalMatrix(c, u, l);
    final DoubleMatrix1D xVec = new DoubleMatrix1D(x);
    DoubleMatrix1D y1 = (DoubleMatrix1D) ALGEBRA.multiply(m, xVec);
    DoubleMatrix2D full = m.toDoubleMatrix2D();
    DoubleMatrix1D y2 = (DoubleMatrix1D) ALGEBRA.multiply(full, xVec);

    for (int i = 0; i < n; i++) {
      assertEquals(y1.getEntry(i), y2.getEntry(i), 1e-12);
    }
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.math.linearalgebra.TridiagonalMatrix

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.