DiSMEC++
anonymous_namespace{dense.cpp} Namespace Reference

Functions

long check_positive (long v, const char *error_msg)
 Checks that v is positive and returns v. More...
 

Function Documentation

◆ check_positive()

long anonymous_namespace{dense.cpp}::check_positive ( long  v,
const char *  error_msg 
)

Checks that v is positive and returns v.

This function can be used to verify arguments in the initializer list of the constructor.

Parameters
vNumber to check.
error_msgThis message will be used in the construction of the std::invalid_argument exception in case of error.
Exceptions
std::invalid_argumentif v <= 0.

Definition at line 23 of file dense.cpp.