Beispiel #1
0
// Converts a Vector of strings to an array of int.
func VectorAsIntArray(v []string) []int {
	data := make([]int, len(v))
	for i := 0; i < len(v); i++ {
		x := strings.TrimSpace(v[i])
		data[i] = what.Atoi(x)
	}
	return data
}
Beispiel #2
0
// Returns the number of atoms the prmtop expects there to be
func (mol *System) NumAtoms() int {
	x := mol.Blocks["POINTERS"][0]
	val := what.Atoi(strings.TrimSpace(x))
	return val
}
Beispiel #3
0
// Gets an int at specified offset in specified block.
func (mol *System) GetInt(blockName string, index int) int {
	s := mol.Blocks[blockName][index]
	val := what.Atoi(s)
	return val
}