mirror of
https://github.moeyy.xyz/https://github.com/TheAlgorithms/C.git
synced 2023-10-11 15:56:24 +08:00
added safety paranthesis
This commit is contained in:
parent
580c501c29
commit
2651ff5903
@ -28,10 +28,12 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef max
|
#ifndef max
|
||||||
#define max(a, b) (a > b ? a : b) /**< shorthand for maximum value */
|
#define max(a, b) (((a) > (b)) ? (a) : (b)) /**< shorthand for maximum value \
|
||||||
|
*/
|
||||||
#endif
|
#endif
|
||||||
#ifndef min
|
#ifndef min
|
||||||
#define min(a, b) (a < b ? a : b) /**< shorthand for minimum value */
|
#define min(a, b) (((a) < (b)) ? (a) : (b)) /**< shorthand for minimum value \
|
||||||
|
*/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** to store info regarding 3D arrays */
|
/** to store info regarding 3D arrays */
|
||||||
|
@ -9,8 +9,9 @@
|
|||||||
* The algorithm creates a connected network of weights that closely
|
* The algorithm creates a connected network of weights that closely
|
||||||
* follows the given data points. This this creates a chain of nodes that
|
* follows the given data points. This this creates a chain of nodes that
|
||||||
* resembles the given input shape.
|
* resembles the given input shape.
|
||||||
|
* \see kohonen_som_topology.c
|
||||||
*/
|
*/
|
||||||
#define _USE_MATH_DEFINES // required for MS Visual C
|
#define _USE_MATH_DEFINES /**< required for MS Visual C */
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -19,8 +20,14 @@
|
|||||||
#include <omp.h>
|
#include <omp.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define max(a, b) (a > b ? a : b) // shorthand for maximum value
|
#ifndef max
|
||||||
#define min(a, b) (a < b ? a : b) // shorthand for minimum value
|
#define max(a, b) (((a) > (b)) ? (a) : (b)) /**< shorthand for maximum value \
|
||||||
|
*/
|
||||||
|
#endif
|
||||||
|
#ifndef min
|
||||||
|
#define min(a, b) (((a) < (b)) ? (a) : (b)) /**< shorthand for minimum value \
|
||||||
|
*/
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper function to generate a random number in a given interval.
|
* Helper function to generate a random number in a given interval.
|
||||||
|
Loading…
Reference in New Issue
Block a user