100 lines
3.4 KiB
C++
100 lines
3.4 KiB
C++
#ifndef DArrayH
|
|
#define DArrayH
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
//
|
|
// DArray.h: interface for the DArray class.
|
|
//
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
#include <vector>
|
|
#include <fstream>
|
|
|
|
#include "Space.h"
|
|
#include "AMView.h"
|
|
#include "AlignAxis.h"
|
|
#include "Block.h"
|
|
#include "CommCost.h"
|
|
//#include "ModelStructs.h"
|
|
|
|
class AMView;
|
|
|
|
class DArray : public Space {
|
|
void PrepareAlign(long& TempRank, const std::vector<long>& AAxisArray,
|
|
const std::vector<long>& ACoeffArray, const std::vector<long>& AConstArray,
|
|
std::vector<AlignAxis>& IniRule);
|
|
|
|
|
|
// ïðîâåðÿåò èíäåêñû íà âûõîä çà ïðåäåëû ìàññèâà.
|
|
// Âîçâðàùàåòñÿ ÷èñëî ýëåìåíòîâ â áëîêå. 0 åñëè èõ íåò èëè âûøëè çà ìàññèâ
|
|
long CheckIndex(const std::vector<long>& InitIndexArray,
|
|
std::vector<long>& LastIndexArray,
|
|
const std::vector<long>& StepArray);
|
|
|
|
public:
|
|
|
|
std::vector<long> LowShdWidthArray;
|
|
std::vector<long> HiShdWidthArray;
|
|
long TypeSize; // Ðàçìåð â áàéòàõ îäíîãî ýëåìåíòà ìàññèâà
|
|
AMView *AM_Dis; // AMView â êîòîðóþ îòîáðàæàåòñÿ DArray
|
|
// Ïðàâèëî âûðàâíèâàíèÿ íà AM_Dis - ?
|
|
// äëÿ ÷åãî íóæåí - äëÿ Pattern èëè åùå äëÿ ÷åãî-íèáóäü òîæå
|
|
std::vector<AlignAxis> AlignRule;
|
|
int Repl; // ïðèçíàê ïîëíîñòüþ ðàçìíîæåííîãî ïî AM_Dis ìàññèâà
|
|
|
|
DArray();
|
|
DArray(const std::vector<long>& ASizeArray, const std::vector<long>& ALowShdWidthArray,
|
|
const std::vector<long>& AHiShdWidthArray, int ATypeSize);
|
|
DArray(const DArray &);
|
|
~DArray();
|
|
DArray & operator= (const DArray &x);
|
|
|
|
void AlnDA(AMView *APattern, const std::vector<long>& AAxisArray,
|
|
const std::vector<long>& ACoeffArray, const std::vector<long>& AConstArray);
|
|
void AlnDA(DArray* APattern, const std::vector<long>& AAxisArray,
|
|
const std::vector<long>& ACoeffArray, const std::vector<long>& AConstArray);
|
|
|
|
double RAlnDA(AMView *APattern, const std::vector<long>& AAxisArray,
|
|
const std::vector<long>& ACoeffArray, const std::vector<long>& AConstArray,
|
|
long ANewSign);
|
|
double RAlnDA(DArray* APattern, const std::vector<long>& AAxisArray,
|
|
const std::vector<long>& ACoeffArray, const std::vector<long>& AConstArray,
|
|
long ANewSign);
|
|
|
|
friend double ArrayCopy(
|
|
DArray* AFromArray,
|
|
const std::vector<long>& AFromInitIndexArray,
|
|
const std::vector<long>& AFromLastIndexArray,
|
|
const std::vector<long>& AFromStepArray,
|
|
DArray* AToArray,
|
|
const std::vector<long>& AToInitIndexArray,
|
|
const std::vector<long>& AToLastIndexArray,
|
|
const std::vector<long>& AToStepArray);
|
|
|
|
friend double ArrayCopy(DArray* AFromArray,
|
|
const std::vector<long>& AFromInitIndexArray,
|
|
const std::vector<long>& AFromLastIndexArray,
|
|
const std::vector<long>& AFromStepArray,
|
|
long ACopyRegim);
|
|
|
|
|
|
// ArrCpy ? - êàêèå ïàðàìåòðû, ÷òî äåëàåò
|
|
|
|
long GetMapDim(long arrDim, int &dir); // Ôóíêöèÿ âîçâðàùàåò íîìåð
|
|
// èçìåðåíèÿ VM íà êîòîðîå îòîáðàæåíî óêàçàííîå èçìåðåíèå ìàññèâà
|
|
// (åñëè èçìåðåíèå ìàññèâà ðàçìíîæåíî ïî âñåì íàïðàâëåíèÿì ìàòðèöû âèðòóàëüíûõ ïðîöåññîðîâ - 0).
|
|
// â dir çàíîñèòñÿ 1 èëè -1 â çàâèñèìîñòè îò íàïðàâëåíèÿ ðàçáèåíèÿ èçìåðåíèÿ ìàññèâà
|
|
bool IsAlign();
|
|
|
|
double RDisDA(const std::vector<long>& AAxisArray, const std::vector<long>& ADistrParamArray,
|
|
long ANewSign);
|
|
#ifdef P_DEBUG
|
|
friend std::ostream& operator << (std::ostream& os, const DArray& s);
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
#endif
|