-static VALUE
-s_Molecule_BondParIsObsolete(VALUE self, VALUE val)
-{
- rb_raise(rb_eMolbyError, "Molecule#bond_par, angle_par, dihedral_par, improper_par, vdw_par are now obsolete. You can use MDArena#bond_par, angle_par, dihedral_par, improper_par, vdw_par instead, and probably these are what you really want.");
-}
-
-/*
- * call-seq:
- * bond_par(idx) -> ParameterRef
- *
- * Returns the MD parameter for the idx-th bond.
- */
-/*
-static VALUE
-s_Molecule_BondPar(VALUE self, VALUE val)
-{
- Molecule *mol;
- BondPar *bp;
- UInt t1, t2;
- Int i1, i2;
- Int ival;
- Data_Get_Struct(self, Molecule, mol);
- ival = NUM2INT(rb_Integer(val));
- if (ival < -mol->nbonds || ival >= mol->nbonds)
- rb_raise(rb_eMolbyError, "bond index (%d) out of range", ival);
- if (ival < 0)
- ival += mol->nbonds;
- s_RebuildMDParameterIfNecessary(self, Qtrue);
- i1 = mol->bonds[ival * 2];
- i2 = mol->bonds[ival * 2 + 1];
- t1 = ATOM_AT_INDEX(mol->atoms, i1)->type;
- t2 = ATOM_AT_INDEX(mol->atoms, i2)->type;
- bp = ParameterLookupBondPar(mol->par, t1, t2, i1, i2, 0);
- if (bp == NULL)
- return Qnil;
- return ValueFromMoleculeWithParameterTypeAndIndex(mol, kBondParType, bp - mol->par->bondPars);
-}
-*/
-
-/*
- * call-seq:
- * angle_par(idx) -> ParameterRef
- *
- * Returns the MD parameter for the idx-th angle.
- */
-/*
-static VALUE
-s_Molecule_AnglePar(VALUE self, VALUE val)
-{
- Molecule *mol;
- AnglePar *ap;
- UInt t1, t2, t3;
- Int i1, i2, i3;
- Int ival;
- Data_Get_Struct(self, Molecule, mol);
- ival = NUM2INT(rb_Integer(val));
- if (ival < -mol->nangles || ival >= mol->nangles)
- rb_raise(rb_eMolbyError, "angle index (%d) out of range", ival);
- if (ival < 0)
- ival += mol->nangles;
- s_RebuildMDParameterIfNecessary(self, Qtrue);
- i1 = mol->angles[ival * 3];
- i2 = mol->angles[ival * 3 + 1];
- i3 = mol->angles[ival * 3 + 2];
- t1 = ATOM_AT_INDEX(mol->atoms, i1)->type;
- t2 = ATOM_AT_INDEX(mol->atoms, i2)->type;
- t3 = ATOM_AT_INDEX(mol->atoms, i3)->type;
- ap = ParameterLookupAnglePar(mol->par, t1, t2, t3, i1, i2, i3, 0);
- if (ap == NULL)
- return Qnil;
- return ValueFromMoleculeWithParameterTypeAndIndex(mol, kAngleParType, ap - mol->par->anglePars);
-}
-*/
-/*
- * call-seq:
- * dihedral_par(idx) -> ParameterRef
- *
- * Returns the MD parameter for the idx-th dihedral.
- */
-/*
-static VALUE
-s_Molecule_DihedralPar(VALUE self, VALUE val)
-{
- Molecule *mol;
- Int ival;
- TorsionPar *tp;
- UInt t1, t2, t3, t4;
- Int i1, i2, i3, i4;
- Data_Get_Struct(self, Molecule, mol);
- ival = NUM2INT(rb_Integer(val));
- if (ival < -mol->ndihedrals || ival >= mol->ndihedrals)
- rb_raise(rb_eMolbyError, "dihedral index (%d) out of range", ival);
- if (ival < 0)
- ival += mol->ndihedrals;
- s_RebuildMDParameterIfNecessary(self, Qtrue);
- i1 = mol->dihedrals[ival * 4];
- i2 = mol->dihedrals[ival * 4 + 1];
- i3 = mol->dihedrals[ival * 4 + 2];
- i4 = mol->dihedrals[ival * 4 + 3];
- t1 = ATOM_AT_INDEX(mol->atoms, i1)->type;
- t2 = ATOM_AT_INDEX(mol->atoms, i2)->type;
- t3 = ATOM_AT_INDEX(mol->atoms, i3)->type;
- t4 = ATOM_AT_INDEX(mol->atoms, i4)->type;
- tp = ParameterLookupDihedralPar(mol->par, t1, t2, t3, t4, i1, i2, i3, i4, 0);
- if (tp == NULL)
- return Qnil;
- return ValueFromMoleculeWithParameterTypeAndIndex(mol, kDihedralParType, tp - mol->par->dihedralPars);
-}
-*/
-/*
- * call-seq:
- * improper_par(idx) -> ParameterRef
- *
- * Returns the MD parameter for the idx-th improper.
- */
-/*
-static VALUE
-s_Molecule_ImproperPar(VALUE self, VALUE val)
-{
- Molecule *mol;
- Int ival;
- TorsionPar *tp;
- UInt t1, t2, t3, t4;
- Int i1, i2, i3, i4;
- Data_Get_Struct(self, Molecule, mol);
- ival = NUM2INT(rb_Integer(val));
- if (ival < -mol->nimpropers || ival >= mol->nimpropers)
- rb_raise(rb_eMolbyError, "improper index (%d) out of range", ival);
- if (ival < 0)
- ival += mol->nimpropers;
- s_RebuildMDParameterIfNecessary(self, Qtrue);
- i1 = mol->impropers[ival * 4];
- i2 = mol->impropers[ival * 4 + 1];
- i3 = mol->impropers[ival * 4 + 2];
- i4 = mol->impropers[ival * 4 + 3];
- t1 = ATOM_AT_INDEX(mol->atoms, i1)->type;
- t2 = ATOM_AT_INDEX(mol->atoms, i2)->type;
- t3 = ATOM_AT_INDEX(mol->atoms, i3)->type;
- t4 = ATOM_AT_INDEX(mol->atoms, i4)->type;
- tp = ParameterLookupImproperPar(mol->par, t1, t2, t3, t4, i1, i2, i3, i4, 0);
- if (tp == NULL)
- return Qnil;
- return ValueFromMoleculeWithParameterTypeAndIndex(mol, kImproperParType, tp - mol->par->improperPars);
-}
-*/
-/*
- * call-seq:
- * vdw_par(idx) -> ParameterRef
- *
- * Returns the vdw parameter for the idx-th atom.
- */
-/*
-static VALUE
-s_Molecule_VdwPar(VALUE self, VALUE val)
-{
- Molecule *mol;
- Int ival;
- VdwPar *vp;
- UInt t1;
- Data_Get_Struct(self, Molecule, mol);
- ival = NUM2INT(rb_Integer(val));
- if (ival < -mol->natoms || ival >= mol->natoms)
- rb_raise(rb_eMolbyError, "atom index (%d) out of range", ival);
- if (ival < 0)
- ival += mol->natoms;
- s_RebuildMDParameterIfNecessary(self, Qtrue);
- t1 = ATOM_AT_INDEX(mol->atoms, ival)->type;
- vp = ParameterLookupVdwPar(mol->par, t1, 0);
- if (vp == NULL)
- return Qnil;
- return ValueFromMoleculeWithParameterTypeAndIndex(mol, kVdwParType, vp - mol->par->vdwPars);
-}
-*/
-
-/*
- * call-seq:
- * start_step -> Integer
- *
- * Returns the start step (defined by dcd format).
- */
-static VALUE
-s_Molecule_StartStep(VALUE self)
-{
- Molecule *mol;
- Data_Get_Struct(self, Molecule, mol);
- return INT2NUM(mol->startStep);
-}
-
-/*
- * call-seq:
- * start_step = Integer
- *
- * Set the start step (defined by dcd format).
- */
-static VALUE
-s_Molecule_SetStartStep(VALUE self, VALUE val)
-{
- Molecule *mol;
- Data_Get_Struct(self, Molecule, mol);
- mol->startStep = NUM2INT(rb_Integer(val));
- return val;
-}
-
-/*
- * call-seq:
- * steps_per_frame -> Integer
- *
- * Returns the number of steps between frames (defined by dcd format).
- */
-static VALUE
-s_Molecule_StepsPerFrame(VALUE self)
-{
- Molecule *mol;
- Data_Get_Struct(self, Molecule, mol);
- return INT2NUM(mol->stepsPerFrame);
-}
-
-/*
- * call-seq:
- * steps_per_frame = Integer
- *
- * Set the number of steps between frames (defined by dcd format).
- */
-static VALUE
-s_Molecule_SetStepsPerFrame(VALUE self, VALUE val)
-{
- Molecule *mol;
- Data_Get_Struct(self, Molecule, mol);
- mol->stepsPerFrame = NUM2INT(rb_Integer(val));
- return val;
-}
-
-/*
- * call-seq:
- * ps_per_step -> Float
- *
- * Returns the time increment (in picoseconds) for one step (defined by dcd format).
- */
-static VALUE
-s_Molecule_PsPerStep(VALUE self)
-{
- Molecule *mol;
- Data_Get_Struct(self, Molecule, mol);
- return rb_float_new(mol->psPerStep);
-}
-
-/*
- * call-seq:
- * ps_per_step = Float
- *
- * Set the time increment (in picoseconds) for one step (defined by dcd format).
- */
-static VALUE
-s_Molecule_SetPsPerStep(VALUE self, VALUE val)
-{
- Molecule *mol;
- Data_Get_Struct(self, Molecule, mol);
- mol->psPerStep = NUM2DBL(rb_Float(val));
- return val;
-}
-
-/*
- * call-seq:
- * find_angles -> Integer
- *
- * Find the angles from the bonds. Returns the number of angles newly created.
- */
-/*
-static VALUE
-s_Molecule_FindAngles(VALUE self)
-{
- Molecule *mol;
- Atom *ap;
- int n1, i, j, nc;
- Int *ip, nip, n[3];
- Data_Get_Struct(self, Molecule, mol);
- if (mol == NULL || mol->natoms == 0)
- return INT2NUM(0);
- ip = NULL;
- nip = 0;
- for (n1 = 0, ap = mol->atoms; n1 < mol->natoms; n1++, ap = ATOM_NEXT(ap)) {
- nc = ap->connect.count;
- n[1] = n1;
- for (i = 0; i < nc; i++) {
- n[0] = ap->connects[i];
- for (j = i + 1; j < nc; j++) {
- n[2] = ap->connects[j];
- if (MoleculeLookupAngle(mol, n[0], n[1], n[2]) < 0)
- AssignArray(&ip, &nip, sizeof(Int) * 3, nip, n);
- }
- }
- }
- if (nip > 0) {
- MolActionCreateAndPerform(mol, gMolActionAddAngles, nip * 3, ip, NULL);
- free(ip);
- }
- return INT2NUM(nip);
-}
-*/
-/*
- * call-seq:
- * find_dihedrals -> Integer
- *
- * Find the dihedrals from the bonds. Returns the number of dihedrals newly created.
- */
-/*
-static VALUE
-s_Molecule_FindDihedrals(VALUE self)
-{
- Molecule *mol;
- Atom *ap1, *ap2;
- int n1, i, j, k, nc1, nc2;
- Int *ip, nip, n[4];
- Data_Get_Struct(self, Molecule, mol);
- if (mol == NULL || mol->natoms == 0)
- return INT2NUM(0);
- ip = NULL;
- nip = 0;
- for (n1 = 0, ap1 = mol->atoms; n1 < mol->natoms; n1++, ap1 = ATOM_NEXT(ap1)) {
- nc1 = ap1->connect.count;
- n[1] = n1;
- for (i = 0; i < nc1; i++) {
- n[2] = ap1->connects[i];
- if (n[1] > n[2])
- continue;
- ap2 = ATOM_AT_INDEX(mol->atoms, n[2]);
- nc2 = ap2->connect.count;
- for (j = 0; j < nc1; j++) {
- n[0] = ap1->connects[j];
- if (n[0] == n[2])
- continue;
- for (k = 0; k < nc2; k++) {
- n[3] = ap2->connects[k];
- if (n[3] == n1 || n[3] == n[0])
- continue;
- if (MoleculeLookupDihedral(mol, n[0], n[1], n[2], n[3]) < 0)
- AssignArray(&ip, &nip, sizeof(Int) * 4, nip, n);
- }
- }
- }
- }
- if (nip > 0) {
- MolActionCreateAndPerform(mol, gMolActionAddDihedrals, nip * 4, ip, NULL);
- free(ip);
- }
- return INT2NUM(nip);
-}
-*/
-