// ############################## START FUNC ############################################ // This is a rather complicated function which prepare an vector, comb1, to be interpretated in // the function "determine_muliple_bonds". An formatted example comb1[n] looks like this, 5*2*1#7*2*0 which // means that there are two paths, splittet by "#" which are sent to the actual atom. In the first case // the path are sent from the neighbour atom 5 and have passed 2 atoms with -1 bonds (potential double bonded) // and and 1 atom with -2 bonds (potential triple bonded). // The counter for p=0 and up serves the same purpose as in many other functions, to traverse each path // from its present atom variable to all neighbour atoms. All paths starts at the end atoms (ends list). // But in this case there is an utter while-loop. // If formations like =C< are met, new ends must be set, because double and triple bonds are determined // by the number of -1 and -2 atoms that is passed (odd or even), in the function "determine_muliple_bonds". // In the =C< formation, if the path is built from the upper corner to the right and sent to the lower corner // to the right, the alternativity "odd,even,odd,even..." will be broken, because there are two single bonds // two times running without an intermediate =. Therefore, new ends must be established at the position on // C and at the upper and the lower corner, i.e. 3 new ends. Then, a new path series must be started. function d_t_bonds(ends, mconn, atom_sorts, d_atoms, t_atoms, branchstop) { var number_of_atoms=atom_sorts.length; var loopmax=parseInt(d_atoms.Span())+parseInt(t_atoms.Span()); var comb1 = new Array(number_of_atoms); var comb2 = new Array(number_of_atoms); for(n=0;n newendsmarker. while(newendsmarker){ for(n=0;n