-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathComplexFloorClass.h
56 lines (53 loc) · 1.17 KB
/
ComplexFloorClass.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#pragma once
#ifndef COMPLEXFLOORCLASS_H
#define COMPLEXFLOORCLASS_H
#include "ComplexCoreClass.h"
TemplateDefinition
class ComplexFloorClass : ComplexCoreClass <TemplateParameter>
{
public:
ComplexFloorClass()
{
// dont call base class default constructor directly, icc has problem with it.
// default constructor of base class automatically called befor constructor of derived class.
// but parametrized constructor of base class should be called explicitly.
}
ComplexFloorClass(MemoryManagerClass *MemoryManager) : BaseConstructor
{
}
Ts* Floor(Ts* X, int XLength)
{
if (XLength <= 0)
return NULL;
Ts* m = this->AllocMem_Single(XLength);
for (int i = 0; i < XLength; i++)
{
m[i] = floor(X[i]);
}
return m;
}
Ta Floor(Ta X)
{
Ta res(this->MemManager);
if (X.Length <= 0)
{
return res;
}
res.SetArray(Floor(X.GetArray(), X.Length), X.Length);
return res;
}
void Floor_inplace(Ts* X, int XLength)
{
if (XLength <= 0)
return;
for (int i = 0; i < XLength; i++)
{
X[i] = floor(X[i]);
}
}
void Floor_inplace(Ta X)
{
Floor_inplace(X.GetArray(), X.Length);
}
};
#endif