Java Code Examples for no.uib.cipr.matrix.Vector#copy()

The following examples show how to use no.uib.cipr.matrix.Vector#copy() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: QMR.java    From matrix-toolkits-java with GNU Lesser General Public License v3.0 6 votes vote down vote up
/**
 * Constructor for QMR. Uses the given vector as template for creating
 * scratch vectors. Typically, the solution or the right hand side vector
 * can be passed, and the template is not modified
 * 
 * @param template
 *            Vector to use as template for the work vectors needed in the
 *            solution process
 */
public QMR(Vector template) {
    M1 = M;
    M2 = M;
    r = template.copy();
    y = template.copy();
    z = template.copy();
    v = template.copy();
    w = template.copy();
    p = template.copy();
    q = template.copy();
    d = template.copy();
    s = template.copy();
    v_tld = template.copy();
    w_tld = template.copy();
    y_tld = template.copy();
    z_tld = template.copy();
    p_tld = template.copy();
}
 
Example 2
Source File: QMR.java    From matrix-toolkits-java with GNU Lesser General Public License v3.0 6 votes vote down vote up
/**
 * Constructor for QMR. Uses the given vector as template for creating
 * scratch vectors. Typically, the solution or the right hand side vector
 * can be passed, and the template is not modified. Allows setting different
 * right and left preconditioners
 * 
 * @param template
 *            Vector to use as template for the work vectors needed in the
 *            solution process
 * @param M1
 *            Left preconditioner
 * @param M2
 *            Right preconditioner
 */
public QMR(Vector template, Preconditioner M1, Preconditioner M2) {
    this.M1 = M1;
    this.M2 = M2;
    r = template.copy();
    y = template.copy();
    z = template.copy();
    v = template.copy();
    w = template.copy();
    p = template.copy();
    q = template.copy();
    d = template.copy();
    s = template.copy();
    v_tld = template.copy();
    w_tld = template.copy();
    y_tld = template.copy();
    z_tld = template.copy();
    p_tld = template.copy();
}
 
Example 3
Source File: BiCGstab.java    From matrix-toolkits-java with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Constructor for BiCGstab. Uses the given vector as template for creating
 * scratch vectors. Typically, the solution or the right hand side vector
 * can be passed, and the template is not modified
 * 
 * @param template
 *            Vector to use as template for the work vectors needed in the
 *            solution process
 */
public BiCGstab(Vector template) {
    p = template.copy();
    s = template.copy();
    phat = template.copy();
    shat = template.copy();
    t = template.copy();
    v = template.copy();
    temp = template.copy();
    r = template.copy();
    rtilde = template.copy();
}
 
Example 4
Source File: CGS.java    From matrix-toolkits-java with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Constructor for CGS. Uses the given vector as template for creating
 * scratch vectors. Typically, the solution or the right hand side vector
 * can be passed, and the template is not modified
 * 
 * @param template
 *            Vector to use as template for the work vectors needed in the
 *            solution process
 */
public CGS(Vector template) {
    p = template.copy();
    q = template.copy();
    u = template.copy();
    phat = template.copy();
    qhat = template.copy();
    vhat = template.copy();
    uhat = template.copy();
    sum = template.copy();
    r = template.copy();
    rtilde = template.copy();
}
 
Example 5
Source File: BiCG.java    From matrix-toolkits-java with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Constructor for BiCG. Uses the given vector as template for creating
 * scratch vectors. Typically, the solution or the right hand side vector
 * can be passed, and the template is not modified
 * 
 * @param template
 *            Vector to use as template for the work vectors needed in the
 *            solution process
 */
public BiCG(Vector template) {
    z = template.copy();
    p = template.copy();
    q = template.copy();
    r = template.copy();
    ztilde = template.copy();
    ptilde = template.copy();
    qtilde = template.copy();
    rtilde = template.copy();
}
 
Example 6
Source File: CG.java    From matrix-toolkits-java with GNU Lesser General Public License v3.0 3 votes vote down vote up
/**
 * Constructor for CG. Uses the given vector as template for creating
 * scratch vectors. Typically, the solution or the right hand side vector
 * can be passed, and the template is not modified
 * 
 * @param template
 *            Vector to use as template for the work vectors needed in the
 *            solution process
 */
public CG(Vector template) {
    p = template.copy();
    z = template.copy();
    q = template.copy();
    r = template.copy();
}
 
Example 7
Source File: Chebyshev.java    From matrix-toolkits-java with GNU Lesser General Public License v3.0 3 votes vote down vote up
/**
 * Constructor for Chebyshev. Uses the given vector as template for creating
 * scratch vectors. Typically, the solution or the right hand side vector
 * can be passed, and the template is not modified. Eigenvalue estimates
 * must also be provided
 * 
 * @param template
 *            Vector to use as template for the work vectors needed in the
 *            solution process
 * @param eigmin
 *            Smallest eigenvalue. Must be positive
 * @param eigmax
 *            Largest eigenvalue. Must be positive
 */
public Chebyshev(Vector template, double eigmin, double eigmax) {
    p = template.copy();
    z = template.copy();
    r = template.copy();
    q = template.copy();
    setEigenvalues(eigmin, eigmax);
}
 
Example 8
Source File: GMRES.java    From matrix-toolkits-java with GNU Lesser General Public License v3.0 3 votes vote down vote up
/**
 * Constructor for GMRES. Uses the given vector as template for creating
 * scratch vectors. Typically, the solution or the right hand side vector
 * can be passed, and the template is not modified
 * 
 * @param template
 *            Vector to use as template for the work vectors needed in the
 *            solution process
 * @param restart
 *            GMRES iteration is restarted after this number of iterations
 */
public GMRES(Vector template, int restart) {
    w = template.copy();
    u = template.copy();
    r = template.copy();
    setRestart(restart);
}
 
Example 9
Source File: IR.java    From matrix-toolkits-java with GNU Lesser General Public License v3.0 2 votes vote down vote up
/**
 * Constructor for IR. Uses the given vector as template for creating
 * scratch vectors. Typically, the solution or the right hand side vector
 * can be passed, and the template is not modified
 * 
 * @param template
 *            Vector to use as template for the work vectors needed in the
 *            solution process
 */
public IR(Vector template) {
    z = template.copy();
    r = template.copy();
}