<commit_before>/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

package etomica.virial;

import etomica.math.SpecialFunctions;


/**
 * This class calculates the sum of all biconnected clusters using Wheatley's
 * recursive formulation.
 * 
 * @author <NAME> and <NAME> 
 */
public class ClusterWheatleySoftDerivatives implements ClusterAbstract, ClusterAbstractMultivalue {

    protected final int n;
    protected final MayerFunction f;
    protected final int nDer;
    protected final double[][] fQ, fC;
    protected final double[][] fA, fB;
    protected long cPairID = -1, lastCPairID = -1;
    protected final double[] value, lastValue;
    protected double beta;
    public static boolean pushme = false, pushmeval=false;
    protected double tol;
    protected ClusterWheatleySoftDerivativesBD clusterBD;
    protected boolean debug = false;
    protected boolean doCaching = true;
    protected final int[][] binomial;
    protected long SoftBDcount = 0;
    protected int stepcount = 0;
    protected long totcount = 0;
    protected boolean count=false;
    protected double rCut2 = Double.POSITIVE_INFINITY;


    public ClusterWheatleySoftDerivatives(int nPoints, MayerFunction f, double tol, int nDer) {        
        this.n = nPoints;
        value = new double[nDer+1];
        lastValue = new double[nDer+1];
        this.f = f;
        int nf = 1<<n;  // 2^n
        fQ = new double[nf][nDer+1];
        fC = new double[nf][nDer+1];
        for(int i=0; i<n; i++) {
            fQ[1<<i][0] = 1.0;
    	}
        fA = new double[nf][nDer+1];
        fB = new double[nf][nDer+1];
        if(tol!=0){setTolerance(tol);}
        this.nDer = nDer;
        this.binomial = new int[nDer+1][]; 
        for(int m=0;m<=nDer;m++){
            binomial[m] = new int[m+1];<commit_msg>Declaring nDer before calling setTolerance<commit_after>/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

package etomica.virial;

import etomica.math.SpecialFunctions;


/**
 * This class calculates the sum of all biconnected clusters using Wheatley's
 * recursive formulation.
 * 
 * @author <NAME> and <NAME> 
 */
public class ClusterWheatleySoftDerivatives implements ClusterAbstract, ClusterAbstractMultivalue {

    protected final int n;
    protected final MayerFunction f;
    protected final int nDer;
    protected final double[][] fQ, fC;
    protected final double[][] fA, fB;
    protected long cPairID = -1, lastCPairID = -1;
    protected final double[] value, lastValue;
    protected double beta;
    public static boolean pushme = false, pushmeval=false;
    protected double tol;
    protected ClusterWheatleySoftDerivativesBD clusterBD;
    protected boolean debug = false;
    protected boolean doCaching = true;
    protected final int[][] binomial;
    protected long SoftBDcount = 0;
    protected int stepcount = 0;
    protected long totcount = 0;
    protected boolean count=false;
    protected double rCut2 = Double.POSITIVE_INFINITY;


    public ClusterWheatleySoftDerivatives(int nPoints, MayerFunction f, double tol, int nDer) {        
        this.n = nPoints;
        value = new double[nDer+1];
        lastValue = new double[nDer+1];
        this.f = f;
        int nf = 1<<n;  // 2^n
        fQ = new double[nf][nDer+1];
        fC = new double[nf][nDer+1];
        for(int i=0; i<n; i++) {
            fQ[1<<i][0] = 1.0;
    	}
        fA = new double[nf][nDer+1];
        fB = new double[nf][nDer+1];
        this.nDer = nDer;
        if(tol!=0){setTolerance(tol);}
        this.binomial = new int[nDer+1][]; 
        for(int m=0;m<=nDer;m++){
            binomial[m] = new int[m+1];
{'fraction_non_alphanumeric': 0.10729722857869312, 'fraction_numerical': 0.013729977116704805, 'mean_word_length': 2.8835143139190524, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1893453', 'n_tokens_mistral': 1296, 'n_tokens_neox': 1226, 'n_words': 389}