It is inappropriate to have a wrapper around assert in a public API.
This change removes dependence on GMX_ASSERT in one component of the
installed API. Transient dependencies related to inclusion of
gmxassert.h in vectypes.h are also removed.
#include "gmxapi/md/mdmodule.h"
#include "gromacs/restraint/restraintpotential.h"
#include "gmxapi/md/mdmodule.h"
#include "gromacs/restraint/restraintpotential.h"
+#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/real.h"
#include "sessionresources.h"
#include "gromacs/utility/real.h"
#include "sessionresources.h"
#include "config.h"
#include "gromacs/domdec/gpuhaloexchange.h"
#include "config.h"
#include "gromacs/domdec/gpuhaloexchange.h"
+#include "gromacs/utility/gmxassert.h"
#ifndef GMX_MATH_VECTYPES_H
#define GMX_MATH_VECTYPES_H
#ifndef GMX_MATH_VECTYPES_H
#define GMX_MATH_VECTYPES_H
#include <cmath>
#include <algorithm>
#include <type_traits>
#include <cmath>
#include <algorithm>
#include <type_traits>
-#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/real.h"
#define XX 0 /* Defines for indexing in */
#include "gromacs/utility/real.h"
#define XX 0 /* Defines for indexing in */
//! Allow vector scalar division
BasicVector<ValueType> operator/(const ValueType& right) const
{
//! Allow vector scalar division
BasicVector<ValueType> operator/(const ValueType& right) const
{
- GMX_ASSERT(right != 0, "Cannot divide by zero");
+ assert((right != 0 && "Cannot divide by zero"));
return *this * (1 / right);
}
return *this * (1 / right);
}
//! Divide vector by a scalar
BasicVector<ValueType>& operator/=(const ValueType& right)
{
//! Divide vector by a scalar
BasicVector<ValueType>& operator/=(const ValueType& right)
{
- GMX_ASSERT(right != 0, "Cannot divide by zero");
+ assert((right != 0 && "Cannot divide by zero"));
return *this *= 1 / right;
}
return *this *= 1 / right;
}
BasicVector<ValueType> unitVector() const
{
const ValueType vectorNorm = norm();
BasicVector<ValueType> unitVector() const
{
const ValueType vectorNorm = norm();
- GMX_ASSERT(vectorNorm != 0, "unitVector() should not be called with a zero vector");
+ assert((vectorNorm != 0 && "unitVector() should not be called with a zero vector"));
return *this / vectorNorm;
}
return *this / vectorNorm;
}
int nsig,
real* sig,
int* totalNumberOfBondedInteractions,
int nsig,
real* sig,
int* totalNumberOfBondedInteractions,
int flags)
/* instead of current system, gmx_booleans for summing virial, kinetic energy, and other terms */
{
int flags)
/* instead of current system, gmx_booleans for summing virial, kinetic energy, and other terms */
{
int nsig,
real* sig,
int* totalNumberOfBondedInteractions,
int nsig,
real* sig,
int* totalNumberOfBondedInteractions,
int flags);
/*! \brief Returns TRUE if io should be done */
int flags);
/*! \brief Returns TRUE if io should be done */