<commit_before>'use strict';

var OCL = require('openchemlib');

module.exports = function getConnectivityMatrix(options={}) {
    var {
        sdt,
        mass
    } = options;

    this.ensureHelperArrays(OCL.Molecule.cHelperNeighbours);
    var nbAtoms=this.getAllAtoms();
    var result=new Array(nbAtoms);
    for (var i=0; i<nbAtoms; i++) {
        result[i]=new Array(nbAtoms).fill(0);
        result[i][i]=(mass) ? OCL.Molecule.cRoundedMass[this.getAtomicNo(i)] : 1;
    }

    for (var i=0; i<nbAtoms; i++) {
        for (var j=0; j<this.getAllConnAtoms(i); j++) {
            result[i][this.getConnAtom(i,j)]=(sdt) ? this.getConnBondOrder(i,j) : 1;
        }
    }
    return result;
}<commit_msg>Make it compatible with node 4.0<commit_after>'use strict';

var OCL = require('openchemlib');

module.exports = function getConnectivityMatrix(options) {
    var options = options || {};
    var sdt=options.sdt;
    var mass=options.mass;

    this.ensureHelperArrays(OCL.Molecule.cHelperNeighbours);
    var nbAtoms=this.getAllAtoms();
    var result=new Array(nbAtoms);
    for (var i=0; i<nbAtoms; i++) {
        result[i]=new Array(nbAtoms).fill(0);
        result[i][i]=(mass) ? OCL.Molecule.cRoundedMass[this.getAtomicNo(i)] : 1;
    }

    for (var i=0; i<nbAtoms; i++) {
        for (var j=0; j<this.getAllConnAtoms(i); j++) {
            result[i][this.getConnAtom(i,j)]=(sdt) ? this.getConnBondOrder(i,j) : 1;
        }
    }
    return result;
}
{'fraction_non_alphanumeric': 0.16575716234652116, 'fraction_numerical': 0.009549795361527967, 'mean_word_length': 3.1914285714285713, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, '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': '3934834', 'n_tokens_mistral': 572, 'n_tokens_neox': 557, 'n_words': 94}