Where F(g) is the vertex degree count; i.e, the number of vertices with the same vertex degree. g is the value of the considered vertex degree. The second Zagreb index is calculated as shown in equation 2.
Where b runs over all bonds. i and j are the source and target vertices of the considered bond.
template <class HDepletedMolecule> struct first_zagreb : std::unary_function<HDepletedMolecule,size_t> { result_type operator()(typename boost::call_traits<argument_type>::param_type m); };And
template <class HDepletedMolecule> struct second_zagreb : std::unary_function<HDepletedMolecule,size_t> { result_type operator()(typename boost::call_traits<argument_type>::param_type m); };For the second.
Argument | Model of |
---|---|
Molecule | cdl::molecule |
// suppose you're streaming a mol format from the stdin: typedef desc_molecular_properties<> desc_mol_props_t; typedef boost::property<mol_propsS, molecular_properties<>, boost::property<descriptors_mol_propsS, desc_mol_props_t> > descr_props_t; typedef molecule<double,descr_props_t> M; morpho::cdl::nail_juice<M> j; morpho::cdl::get_juice_from_stream(std::cin, j, 0, sdf_formatT()); M mol(j); morpho::cdl::first_zagreb<M> FZ; morpho::cdl::second_zagreb<M> SZ; std::cout << "First Zagreb index of my mol: "; std::cout << FZ(mol) << '\n'; std::cout << "Second Zagreb index of my mol: "; std::cout << SZ(mol) << '\n';