BlockIP
|
#include <iostream>
#include <algorithm>
#include <vector>
#include "MatrixBlockIP.h"
#include "ExceptionBlockIP.h"
Macros | |
#define | ALLOC(n, type) (type *)malloc((n)*sizeof(type)) |
#define | REALLOC(ptr, n, type) (type *)realloc(((char *)ptr),(n)*sizeof(type)) |
#define | FREE(p) if (p) {free(p); (p)= NULL;} |
#define | TRY_ALLOC(ptr, n, type) if (!(ptr= ALLOC((n),type)) ) {throw ExceptionBlockIP(OUT_OF_MEMORY, __FILE__, __LINE__);} |
#define | TRY_REALLOC(ptr, n, type) if (!(ptr= REALLOC((ptr),(n),type)) ) {throw ExceptionBlockIP(OUT_OF_MEMORY, __FILE__, __LINE__);} |
#define ALLOC | ( | n, | |
type | |||
) | (type *)malloc((n)*sizeof(type)) |
#define FREE | ( | p | ) | if (p) {free(p); (p)= NULL;} |
#define REALLOC | ( | ptr, | |
n, | |||
type | |||
) | (type *)realloc(((char *)ptr),(n)*sizeof(type)) |
#define TRY_ALLOC | ( | ptr, | |
n, | |||
type | |||
) | if (!(ptr= ALLOC((n),type)) ) {throw ExceptionBlockIP(OUT_OF_MEMORY, __FILE__, __LINE__);} |
#define TRY_REALLOC | ( | ptr, | |
n, | |||
type | |||
) | if (!(ptr= REALLOC((ptr),(n),type)) ) {throw ExceptionBlockIP(OUT_OF_MEMORY, __FILE__, __LINE__);} |