-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathComplexReShapeClass.h
45 lines (41 loc) · 1.48 KB
/
ComplexReShapeClass.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
#pragma once
#ifndef COMPLEXRESHAPECLASS_H
#define COMPLEXRESHAPECLASS_H
#include "ComplexCoreClass.h"
TemplateDefinition
class ComplexReShapeClass : ComplexCoreClass <TemplateParameter>
{
public:
ComplexReShapeClass()
{
// 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.
}
ComplexReShapeClass(MemoryManagerClass *MemoryManager) : BaseConstructor
{
}
Tca ReShapeColMajor_GetColumn(Tca input, int reShapedMatrix_rowCount, int desire_colIndex, int start_rowIndex = 0, int end_rowIndex = 0)
{
if (end_rowIndex == 0)
{
end_rowIndex = reShapedMatrix_rowCount - 1;
}
int reslen = end_rowIndex - start_rowIndex + 1;
int input_start_index = (desire_colIndex * reShapedMatrix_rowCount) + start_rowIndex;
Tca col = input.GetSubArray(input_start_index, reslen);
return col;
}
Tca ReShapeColMajor_GetColumn_Getpointer(Tca input, int reShapedMatrix_rowCount, int desire_colIndex, int start_rowIndex = 0, int end_rowIndex = 0)
{
if (end_rowIndex == 0)
{
end_rowIndex = reShapedMatrix_rowCount - 1;
}
int reslen = end_rowIndex - start_rowIndex + 1;
int input_start_index = (desire_colIndex * reShapedMatrix_rowCount) + start_rowIndex;
Tca col = input.GetPointer(input_start_index, input_start_index + reslen - 1);
return col;
}
};
#endif