-
Notifications
You must be signed in to change notification settings - Fork 1
/
Helper.h
39 lines (31 loc) · 991 Bytes
/
Helper.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef _HELPER_H_
#define _HELPER_H_
#include "BasicDataStructures.h"
#include <math.h>
#include <mpi.h>
#include <algorithm>
#include <vector>
using namespace std;
using namespace BasicDataStructures;
namespace MyHelper
{
#define MPI_ERROR_MESSAGE_BUFF_SIZE 50
bool StrEqualCaseSen( const char* str1, const char* str2 );
bool StrEqualCaseInsen( const char* str1, const char* str2 );
// Include string terminator
unsigned int GetStrLength( const char* str );
bool IsLetter( const char c );
Instance Tokenize(
const char* str,
const vector<NumericAttr>& featureVec );
unsigned int getIndexOfMax(
const unsigned int* uintArray,
const unsigned int length );
// Consume a sorted array, remove duplicates in place,
// and return the number of unique elements.
unsigned int removeDuplicates(
double* sortedArr,
unsigned int length );
void CheckMPIErr( int errorCode, int mpiNodeId );
}
#endif