Commit 9325de74 authored by Kirill Terekhov's avatar Kirill Terekhov

replace dynarray with std::vector

parent 870446ec
......@@ -78,11 +78,11 @@ bool find_stencils(Cell cK,
//store all the precomputed interpolation directions
dynarray<real,128> dirs; //all directions
dynarray<real,128> bndrhs; //right hand sides coming out of boundary conditions
dynarray<real,128> bndmlt; //multiplier for original cell
dynarray<integer,128> weights; //layer number
dynarray<HandleType,128> handles; //elements corresponding to each direction
std::vector<real> dirs; //all directions
std::vector<real> bndrhs; //right hand sides coming out of boundary conditions
std::vector<real> bndmlt; //multiplier for original cell
std::vector<integer> weights; //layer number
std::vector<HandleType> handles; //elements corresponding to each direction
//variables used for interpolation calculation
rMatrix xK(1,3), //current cell position
......
......@@ -474,7 +474,7 @@ namespace INMOST
cells[k]->RemMarker(marker);
}
tree->intersect_plane_edge(clip_point, clip_state, cells, marker, p, n);
dynarray<edge_point, 128> clipcoords, loopcoords;
std::vector<edge_point> clipcoords, loopcoords;
std::vector<bool> closed;
for (INMOST_DATA_ENUM_TYPE k = 0; k < cells.size(); ++k)
{
......@@ -970,8 +970,8 @@ namespace INMOST
face2gl f;
f.set_color(0.6, 0.6, 0.6, 1);
ElementArray<Node> nodes = Element(mm, faces[k])->getNodes();
dynarray<bool, 64> nodepos(nodes.size());
dynarray<Storage::real, 64> faceverts;
std::vector<bool> nodepos(nodes.size());
std::vector<Storage::real> faceverts;
Storage::real_array coords = nodes[0].Coords();
for (INMOST_DATA_ENUM_TYPE q = 0; q < nodes.size(); q++)
{
......
This diff is collapsed.
......@@ -42,7 +42,7 @@ typedef std::vector<HandleType> cell_vector;
typedef std::map<Tag, Storage::real > data_by_mat;
typedef std::pair< Storage::real, std::map<Tag, Storage::real> > vol_and_data_by_mat;
typedef std::map<Storage::integer, vol_and_data_by_mat > data_storage;
typedef dynarray<Storage::integer, 32> mat_ret_type;
typedef std::vector<Storage::integer> mat_ret_type;
struct cell
{
......
This diff is collapsed.
......@@ -274,7 +274,7 @@ namespace INMOST
}
else return false;
} //m <= n
dynarray<Var,128> rv1(m);
std::vector<Var> rv1(m);
//array<Var> _rv1(m);
//shell<Var> rv1(_rv1);
std::swap(n,m); //this how original algorithm takes it
......@@ -3218,7 +3218,7 @@ namespace INMOST
//enumerator l = AtB.Cols();
//enumerator n = Rows();
dynarray<enumerator,128> order(m);
std::vector<enumerator> order(m);
Var temp;
INMOST_DATA_REAL_TYPE max,v;
......@@ -3848,9 +3848,9 @@ namespace INMOST
/// shortcut for matrix of real values.
typedef Matrix<INMOST_DATA_REAL_TYPE> rMatrix;
/// shortcut for matrix of integer values in stack-preallocated and dynamically reallocated array.
typedef Matrix<INMOST_DATA_INTEGER_TYPE,dynarray<INMOST_DATA_INTEGER_TYPE,128> > idMatrix;
//typedef Matrix<INMOST_DATA_INTEGER_TYPE,dynarray<INMOST_DATA_INTEGER_TYPE,128> > idMatrix;
/// shortcut for matrix of real values in stack-preallocated and dynamically reallocated array.
typedef Matrix<INMOST_DATA_REAL_TYPE, dynarray<INMOST_DATA_REAL_TYPE,128> > rdMatrix;
//typedef Matrix<INMOST_DATA_REAL_TYPE, dynarray<INMOST_DATA_REAL_TYPE,128> > rdMatrix;
/// shortcut for matrix of integer values in pool-allocated array (beaware of deallocation order issue).
typedef Matrix<INMOST_DATA_INTEGER_TYPE,pool_array_t<INMOST_DATA_INTEGER_TYPE> > ipMatrix;
/// shortcut for matrix of real values in pool-allocated array (beaware of deallocation order issue).
......@@ -3864,9 +3864,9 @@ namespace INMOST
/// shortcut for symmetric matrix of real values.
typedef SymmetricMatrix<INMOST_DATA_REAL_TYPE> rSymmetricMatrix;
/// shortcut for symmetric matrix of integer values in stack-preallocated and dynamically reallocated array.
typedef SymmetricMatrix<INMOST_DATA_INTEGER_TYPE,dynarray<INMOST_DATA_INTEGER_TYPE,128> > idSymmetricMatrix;
//typedef SymmetricMatrix<INMOST_DATA_INTEGER_TYPE,dynarray<INMOST_DATA_INTEGER_TYPE,128> > idSymmetricMatrix;
/// shortcut for symmetric matrix of real values in stack-preallocated and dynamically reallocated array.
typedef SymmetricMatrix<INMOST_DATA_REAL_TYPE,dynarray<INMOST_DATA_REAL_TYPE,128> > rdSymmetricMatrix;
//typedef SymmetricMatrix<INMOST_DATA_REAL_TYPE,dynarray<INMOST_DATA_REAL_TYPE,128> > rdSymmetricMatrix;
/// shortcut for symmetric matrix of integer values in pool-allocated array (beaware of deallocation order issue).
typedef SymmetricMatrix<INMOST_DATA_INTEGER_TYPE,pool_array_t<INMOST_DATA_INTEGER_TYPE> > ipSymmetricMatrix;
/// shortcut for symmetric matrix of real values in pool-allocated array (beaware of deallocation order issue).
......@@ -3888,11 +3888,11 @@ namespace INMOST
//< shortcut for matrix of variables with first and second order derivatives.
typedef Matrix<hessian_variable> hMatrix;
/// shortcut for matrix of variables with single unit entry of first order derivative in stack-preallocated and dynamically reallocated array.
typedef Matrix<unknown, dynarray<unknown,128> > udMatrix;
//typedef Matrix<unknown, dynarray<unknown,128> > udMatrix;
/// shortcut for matrix of variables with first order derivatives in stack-preallocated and dynamically reallocated array.
typedef Matrix<variable, dynarray<variable,128> > vdMatrix;
//typedef Matrix<variable, dynarray<variable,128> > vdMatrix;
//< shortcut for matrix of variables with first and second order derivatives in stack-preallocated and dynamically reallocated array.
typedef Matrix<hessian_variable, dynarray<hessian_variable,128> > hdMatrix;
//typedef Matrix<hessian_variable, dynarray<hessian_variable,128> > hdMatrix;
/// shortcut for matrix of variables with single unit entry of first order derivative in pool-allocated array (beaware of deallocation order issue).
typedef Matrix<unknown, pool_array_t<unknown> > upMatrix;
/// shortcut for matrix of variables with first order derivatives in pool-allocated array (beaware of deallocation order issue).
......@@ -3912,11 +3912,11 @@ namespace INMOST
/// shortcut for matrix of variables in existing array.
typedef SymmetricMatrix<hessian_variable,shell<hessian_variable> > haSymmetricMatrix;
/// shortcut for symmetric matrix of variables with single unit entry of first order derivative in stack-preallocated and dynamically reallocated array.
typedef SymmetricMatrix<unknown, dynarray<unknown,128> > udSymmetricMatrix;
//typedef SymmetricMatrix<unknown, dynarray<unknown,128> > udSymmetricMatrix;
/// shortcut for symmetric matrix of variables with first order derivatives in stack-preallocated and dynamically reallocated array.
typedef SymmetricMatrix<variable, dynarray<variable,128> > vdSymmetricMatrix;
//typedef SymmetricMatrix<variable, dynarray<variable,128> > vdSymmetricMatrix;
//< shortcut for symmetric matrix of variables with first and second order derivatives in stack-preallocated and dynamically reallocated array.
typedef SymmetricMatrix<hessian_variable, dynarray<hessian_variable,128> > hdSymmetricMatrix;
//typedef SymmetricMatrix<hessian_variable, dynarray<hessian_variable,128> > hdSymmetricMatrix;
/// shortcut for symmetric matrix of variables with single unit entry of first order derivative in pool-allocated array (beaware of deallocation order issue).
typedef SymmetricMatrix<unknown, pool_array_t<unknown> > upSymmetricMatrix;
/// shortcut for symmetric matrix of variables with first order derivatives in pool-allocated array (beaware of deallocation order issue).
......
......@@ -138,7 +138,7 @@ namespace INMOST
class ElementArray
{
public:
typedef dynarray<HandleType,64> cont_t;
typedef std::vector<HandleType> cont_t;
typedef cont_t::size_type size_type;
private:
Mesh * m_link;
......
......@@ -391,7 +391,7 @@ namespace INMOST
public:
typedef const_multiplication_expression<A> argument;
typedef unary_pool_expression< argument, A> pool;
typedef dynarray< argument, 64 > container;
typedef std::vector< argument > container;
private:
container arg;
INMOST_DATA_REAL_TYPE value;
......@@ -724,7 +724,7 @@ template<class A> __INLINE
template<class A> __INLINE INMOST::table_variable<A> get_table(INMOST::shell_dynamic_variable<typename A::Var,A> const & Arg, const INMOST::keyval_table & Table) {return INMOST::table_variable<A>(Arg,Table);}
template<class A> __INLINE INMOST::stencil_expression<A> stencil(INMOST::HandleType * elems, INMOST_DATA_REAL_TYPE * coefs, INMOST_DATA_ENUM_TYPE num, INMOST::shell_dynamic_variable<typename A::Var,A> const & Arg)
{
INMOST::dynarray< INMOST::const_multiplication_expression<typename A::Var>, 64> tmp;
std::vector< INMOST::const_multiplication_expression<typename A::Var> > tmp;
for( INMOST_DATA_ENUM_TYPE k = 0; k < num; ++k) if( elems[k] != 0 )
tmp.push_back(INMOST::const_multiplication_expression<typename A::Var>(Arg[elems[k]],coefs[k]));
return INMOST::stencil_expression<typename A::Var>(tmp);
......
......@@ -318,7 +318,7 @@ namespace INMOST
}
}
}
dynarray<int, 64> nums(n_cells.size()); //store all numbers
std::vector<int> nums(n_cells.size()); //store all numbers
for (size_t k = 0; k < n_cells.size(); ++k) nums[k] = n_cells[k].IntegerDF(indexes);
std::sort(nums.begin(), nums.end());
nums.resize(std::unique(nums.begin(), nums.end()) - nums.begin());
......@@ -1061,8 +1061,7 @@ namespace INMOST
Storage::integer_array bn = n->IntegerArray(write);
if (!adj.empty())
{
dynarray<int, 64> uni, tmp;
//std::vector<int> uni, tmp;
std::vector<int> uni, tmp;
for (ElementArray<Edge>::size_type k = 0; k < adj.size(); ++k)
{
Storage::integer_array be = adj[k]->IntegerArray(block);
......@@ -1080,8 +1079,7 @@ namespace INMOST
Storage::integer_array bn = n->IntegerArray(write);
if (!adj.empty())
{
dynarray<int, 64> uni(bn.begin(), bn.end()), tmp(uni.size());
//std::vector<int> uni(bn.begin(), bn.end()), tmp(uni.size());
std::vector<int> uni(bn.begin(), bn.end()), tmp(uni.size());
for (ElementArray<Edge>::size_type k = 0; k < adj.size(); ++k)
{
Storage::integer_array be = adj[k]->IntegerArray(block);
......@@ -1099,8 +1097,7 @@ namespace INMOST
if (!adj.empty())
{
Storage::integer_array be = adj[0]->IntegerArray(block);
dynarray<int, 64> inter(be.begin(), be.end()), tmp(inter.size());
//std::vector<int> inter(be.begin(), be.end()), tmp(inter.size());
std::vector<int> inter(be.begin(), be.end()), tmp(inter.size());
for (ElementArray<Edge>::size_type k = 1; k < adj.size(); ++k)
{
be = adj[k]->IntegerArray(block);
......
......@@ -56,8 +56,8 @@ namespace INMOST
int nnodes, ncells, nchars, nodenum, elemnum, elemtype, numtags, elemnodes, temp;
int ascii, float_size, verlow, verhigh;
char skip_keyword[2048];
dynarray<int,128> elemtags;
dynarray<int,128> nodelist;
std::vector<int> elemtags;
std::vector<int> nodelist;
ElementArray<Node> c_nodes(this);
FILE * f = fopen(File.c_str(),"r");
if( f == NULL )
......@@ -467,7 +467,7 @@ read_elem_num_link:
if( --elemnodes == 0 )
{
for(dynarray<int,128>::size_type k = 0; k < nodelist.size(); ++k)
for(size_t k = 0; k < nodelist.size(); ++k)
c_nodes.push_back(newnodes[nodelist[k]]);
//Create new element
......
......@@ -600,7 +600,7 @@ namespace INMOST
io_converter<INMOST_DATA_ENUM_TYPE ,INMOST_DATA_REAL_TYPE> uconv;
io_converter<INMOST_DATA_BIG_ENUM_TYPE,INMOST_DATA_REAL_TYPE> buconv;
REPORT_STR("start load pmf");
dynarray<INMOST_DATA_ENUM_TYPE,128> myprocs;
std::vector<INMOST_DATA_ENUM_TYPE> myprocs;
std::stringstream in(std::ios::in | std::ios::out | std::ios::binary);
HeaderType token;
std::set< std::string > noload, loadonly, noderivs;
......
......@@ -213,7 +213,7 @@ namespace INMOST
f << "\n";
}
{
dynarray<int,64> values;
std::vector<int> values;
for(Mesh::iteratorCell it = BeginCell(); it != EndCell(); it++)
{
switch(it->GetGeometricType())
......@@ -347,7 +347,7 @@ safe_output:
else
f << "CELLS " << NumberOfCells() << " " << values.size() << "\n";
for(dynarray<Storage::integer,64>::size_type i = 0; i < values.size(); i++)
for(size_t i = 0; i < values.size(); i++)
{
f << values[i] << " ";
if( (i+1) % 20 == 0) f << "\n";
......@@ -2178,8 +2178,8 @@ safe_output:
{
int k = j;
k++; //skip number of total number of integers
dynarray<integer,64> sizes(cp[k++]);
for(dynarray<integer,64>::size_type m = 0; m < sizes.size(); m++)
std::vector<integer> sizes(cp[k++]);
for(size_t m = 0; m < sizes.size(); m++)
{
sizes[m] = cp[k++];
for (integer l = 0; l < sizes[m]; l++)
......
......@@ -117,7 +117,7 @@ namespace INMOST
{
std::vector<INMOST_DATA_REAL_TYPE> Vector;
int Repeat;
dynarray<Storage::real,3> xyz;
std::vector<Storage::real> xyz;
for(std::string val = reader.GetContentsWord(); !reader.isContentsEnded(); val = reader.GetContentsWord() )
{
reader.ParseReal(val,Vector,Repeat,nnodes);
......@@ -1056,7 +1056,7 @@ namespace INMOST
Integer(GetHandle(),idx) = 0;
fout << "\t\t<Nodes Number=\"" << NumberOfNodes() << "\" Dimensions=\"" << GetDimensions() << "\">\n";
fout << "\t\t\t<![CDATA[\n";
dynarray<Storage::real,3> xyz(GetDimensions());
std::vector<Storage::real> xyz(GetDimensions());
int cnt = 0;
for(iteratorNode it = BeginNode(); it != EndNode(); ++it)
{
......
......@@ -69,7 +69,7 @@ namespace INMOST
assert( !(_etype & MESH) );
assert( !(_etype & ESET) );
Mesh * mesh = GetMeshLink();
dynarray<HandleType,128> result;
std::vector<HandleType> result;
INMOST_DATA_INTEGER_TYPE conn[4] = {0,0,0,0};
INMOST_DATA_INTEGER_TYPE myconn = -1, i;
enumerator ret = 0;
......@@ -132,7 +132,7 @@ namespace INMOST
}
ret += static_cast<enumerator>(result.size());
}
for(dynarray<HandleType,128>::size_type it = 0; it < result.size(); it++)
for(size_t it = 0; it < result.size(); it++)
mesh->RemPrivateMarker(result[it],mrk);
result.clear();
mesh->ReleasePrivateMarker(mrk);
......@@ -195,7 +195,7 @@ namespace INMOST
}
ret += static_cast<enumerator>(result.size());
}
for(dynarray<HandleType,128>::size_type it = 0; it < result.size(); it++)
for(size_t it = 0; it < result.size(); it++)
mesh->RemPrivateMarker(result[it],mrk);
result.clear();
mesh->ReleasePrivateMarker(mrk);
......@@ -212,7 +212,7 @@ namespace INMOST
assert( !(_etype & MESH) );
assert( !(_etype & ESET) );
Mesh * mesh = GetMeshLink();
dynarray<HandleType,128> result;
std::vector<HandleType> result;
INMOST_DATA_INTEGER_TYPE conn[4] = {0,0,0,0};
INMOST_DATA_INTEGER_TYPE myconn = -1, i;
enumerator ret = 0;
......@@ -277,7 +277,7 @@ namespace INMOST
}
ret += static_cast<enumerator>(result.size());
}
for(dynarray<HandleType,128>::size_type it = 0; it < result.size(); it++)
for(size_t it = 0; it < result.size(); it++)
mesh->RemPrivateMarker(result[it],mrk);
result.clear();
mesh->ReleasePrivateMarker(mrk);
......@@ -338,7 +338,7 @@ namespace INMOST
}
ret += static_cast<enumerator>(result.size());
}
for(dynarray<HandleType,128>::size_type it = 0; it < result.size(); it++)
for(size_t it = 0; it < result.size(); it++)
mesh->RemPrivateMarker(result[it],mrk);
result.clear();
mesh->ReleasePrivateMarker(mrk);
......@@ -401,7 +401,7 @@ namespace INMOST
}
ret += static_cast<enumerator>(result.size());
}
for(dynarray<HandleType,128>::size_type it = 0; it < result.size(); it++)
for(size_t it = 0; it < result.size(); it++)
mesh->RemPrivateMarker(result[it],mrk);
result.clear();
mesh->ReleasePrivateMarker(mrk);
......@@ -462,7 +462,7 @@ namespace INMOST
}
ret += static_cast<enumerator>(result.size());
}
for(dynarray<HandleType,128>::size_type it = 0; it < result.size(); it++)
for(size_t it = 0; it < result.size(); it++)
mesh->RemPrivateMarker(result[it],mrk);
result.clear();
mesh->ReleasePrivateMarker(mrk);
......@@ -1279,7 +1279,7 @@ namespace INMOST
Storage::integer_array set_procs = e->IntegerArray(e->GetMeshLink()->ProcessorsTag());
Storage::integer_array sendto = e->IntegerArray(e->GetMeshLink()->SendtoTag());
std::sort(sendto.begin(),sendto.end());
dynarray<Storage::integer,64> tmp1(cont.size()),tmp2;
std::vector<Storage::integer> tmp1(cont.size()),tmp2;
tmp1.resize(std::set_difference(cont.begin(),cont.end(),set_procs.begin(),set_procs.end(),tmp1.begin())-tmp1.begin());
tmp2.resize(tmp1.size()+sendto.size());
tmp2.resize(std::set_union(tmp1.begin(),tmp1.end(),sendto.begin(),sendto.end(),tmp2.begin())-tmp2.begin());
......
This diff is collapsed.
......@@ -799,7 +799,7 @@ namespace INMOST
{
{
enumerator flag0, flag1, i;
dynarray<Element::adj_type const *, 64> hcarr(s);
std::vector<Element::adj_type const *> hcarr(s);
hcarr[0] = &HighConn(arr[0]);
if( !hcarr[0]->empty() )
{
......
This diff is collapsed.
......@@ -367,7 +367,7 @@ namespace INMOST
{
Storage::integer_array p1 = e->IntegerArray(tag);
const Storage::integer * p2 = static_cast<const Storage::integer *>(static_cast<const void *>(data));
dynarray<Storage::integer,64> result(static_cast<size_t>(p1.size())+size);
std::vector<Storage::integer> result(static_cast<size_t>(p1.size())+size);
result.resize(std::set_union(p1.begin(),p1.end(),p2,p2+size,result.begin())-result.begin());
p1.replace(p1.begin(),p1.end(),result.begin(),result.end());
}
......@@ -902,7 +902,7 @@ namespace INMOST
{
ENTER_FUNC();
#if defined(USE_MPI)
static dynarray<Storage::real,64> temp;
static std::vector<Storage::real> temp;
temp.resize(size);
memcpy(temp.data(),input,sizeof(Storage::real)*size);
REPORT_MPI(MPI_Allreduce(temp.data(),input,size,INMOST_MPI_DATA_REAL_TYPE,MPI_SUM,comm));
......@@ -917,7 +917,7 @@ namespace INMOST
{
ENTER_FUNC();
#if defined(USE_MPI)
static dynarray<Storage::integer,64> temp;
static std::vector<Storage::integer> temp;
temp.resize(size);
memcpy(temp.data(),input,sizeof(Storage::integer)*size);
REPORT_MPI(MPI_Allreduce(temp.data(),input,size,INMOST_MPI_DATA_INTEGER_TYPE,MPI_SUM,comm));
......@@ -932,7 +932,7 @@ namespace INMOST
{
ENTER_FUNC();
#if defined(USE_MPI)
static dynarray<Storage::enumerator,64> temp;
static std::vector<Storage::enumerator> temp;
temp.resize(size);
memcpy(temp.data(),input,sizeof(Storage::enumerator)*size);
REPORT_MPI(MPI_Allreduce(temp.data(),input,size,INMOST_MPI_DATA_ENUM_TYPE,MPI_SUM,comm));
......@@ -1032,7 +1032,7 @@ namespace INMOST
{
ENTER_FUNC();
#if defined(USE_MPI)
static dynarray<Storage::real,64> temp;
static std::vector<Storage::real> temp;
temp.resize(size);
memcpy(temp.data(),input,sizeof(Storage::real)*size);
REPORT_MPI(MPI_Allreduce(temp.data(),input,size,INMOST_MPI_DATA_REAL_TYPE,MPI_MAX,comm));
......@@ -1047,7 +1047,7 @@ namespace INMOST
{
ENTER_FUNC();
#if defined(USE_MPI)
static dynarray<Storage::integer,64> temp;
static std::vector<Storage::integer> temp;
temp.resize(size);
memcpy(temp.data(),input,sizeof(Storage::integer)*size);
REPORT_MPI(MPI_Allreduce(temp.data(),input,size,INMOST_MPI_DATA_INTEGER_TYPE,MPI_MAX,comm));
......@@ -1062,7 +1062,7 @@ namespace INMOST
{
ENTER_FUNC();
#if defined(USE_MPI)
static dynarray<Storage::enumerator,64> temp;
static std::vector<Storage::enumerator> temp;
temp.resize(size);
memcpy(temp.data(),input,sizeof(Storage::enumerator)*size);
REPORT_MPI(MPI_Allreduce(temp.data(),input,size,INMOST_MPI_DATA_ENUM_TYPE,MPI_MAX,comm));
......@@ -1116,7 +1116,7 @@ namespace INMOST
{
ENTER_FUNC();
#if defined(USE_MPI)
static dynarray<Storage::real,64> temp;
static std::vector<Storage::real> temp;
temp.resize(size);
memcpy(temp.data(),input,sizeof(Storage::real)*size);
REPORT_MPI(MPI_Allreduce(temp.data(),input,size,INMOST_MPI_DATA_REAL_TYPE,MPI_MIN,comm));
......@@ -1131,7 +1131,7 @@ namespace INMOST
{
ENTER_FUNC();
#if defined(USE_MPI)
static dynarray<Storage::enumerator,64> temp;
static std::vector<Storage::enumerator> temp;
temp.resize(size);
memcpy(temp.data(),input,sizeof(Storage::enumerator)*size);
REPORT_MPI(MPI_Allreduce(temp.data(),input,size,INMOST_MPI_DATA_ENUM_TYPE,MPI_MIN,comm));
......@@ -1146,7 +1146,7 @@ namespace INMOST
{
ENTER_FUNC();
#if defined(USE_MPI)
static dynarray<Storage::integer,64> temp;
static std::vector<Storage::integer> temp;
temp.resize(size);
memcpy(temp.data(),input,sizeof(Storage::integer)*size);
REPORT_MPI(MPI_Allreduce(temp.data(),input,size,INMOST_MPI_DATA_INTEGER_TYPE,MPI_MIN,comm));
......@@ -1311,7 +1311,7 @@ namespace INMOST
void determine_my_procs_low(Mesh * m, HandleType h, dynarray<Storage::integer,64> & result, dynarray<Storage::integer,64> & intersection)
void determine_my_procs_low(Mesh * m, HandleType h, std::vector<Storage::integer> & result, std::vector<Storage::integer> & intersection)
{
MarkerType hm = m->HideMarker();
Element::adj_type const & subelements = m->LowConn(h);
......@@ -1330,14 +1330,14 @@ namespace INMOST
if( hm && m->GetMarker(*i,hm) ) {i++; continue;}
Storage::integer_array q = m->IntegerArrayDV(*i,m->ProcessorsTag());
intersection.resize(std::max(static_cast<INMOST_DATA_ENUM_TYPE>(result.size()),static_cast<INMOST_DATA_ENUM_TYPE>(q.size())));
dynarray<Storage::integer,64>::iterator qt = std::set_intersection(result.begin(),result.end(),q.begin(),q.end(),intersection.begin());
std::vector<Storage::integer>::iterator qt = std::set_intersection(result.begin(),result.end(),q.begin(),q.end(),intersection.begin());
intersection.resize(qt-intersection.begin());
result.swap(intersection);
i++;
}
}
void determine_my_procs_high(Mesh * m, HandleType h, const Tag & procs, dynarray<Storage::integer,64> & result, dynarray<Storage::integer,64> & intersection)
void determine_my_procs_high(Mesh * m, HandleType h, const Tag & procs, std::vector<Storage::integer> & result, std::vector<Storage::integer> & intersection)
{
MarkerType hm = m->HideMarker();
Element::adj_type const & overelements = m->HighConn(h);
......@@ -1349,7 +1349,7 @@ namespace INMOST
if( hm && m->GetMarker(*i,hm) ) {i++; continue;}
Storage::integer_array q = m->IntegerArrayDV(*i,procs);
intersection.resize(result.size()+q.size());
dynarray<Storage::integer,64>::iterator qt = std::set_union(result.begin(),result.end(),q.begin(),q.end(),intersection.begin());
std::vector<Storage::integer>::iterator qt = std::set_union(result.begin(),result.end(),q.begin(),q.end(),intersection.begin());
intersection.resize(qt-intersection.begin());
result.swap(intersection);
i++;
......@@ -1480,7 +1480,7 @@ namespace INMOST
#endif //USE_PARALLEL_STORAGE
ReportParallelStorage();
//determine which bboxes i intersect
dynarray<int,64> procs;
std::vector<int> procs;
Storage::real bbox[6]; //local bounding box
std::vector<Storage::real> bboxs((size_t)mpisize*6);
//Compute local bounding box containing nodes.
......@@ -1742,7 +1742,7 @@ namespace INMOST
std::vector<size_t> sendsizeall(mpisize);
ENTER_BLOCK();
for(dynarray<integer,64>::size_type k = 0; k < procs.size(); k++)
for(size_t k = 0; k < procs.size(); k++)
{
send_buffs[k].first = procs[k];
pack_data(send_buffs[k].second,exch_data.size(),GetCommunicator());
......@@ -1772,7 +1772,7 @@ namespace INMOST
{
ENTER_BLOCK();
for(dynarray<integer,64>::size_type k = 0; k < procs.size(); k++)
for(size_t k = 0; k < procs.size(); k++)
{
send_buffs[k].first = procs[k];
send_buffs[k].second = exch_data;
......@@ -1942,7 +1942,7 @@ namespace INMOST
#pragma omp parallel
#endif
{
dynarray<Storage::integer,64> result, intersection;
std::vector<Storage::integer> result, intersection;
#if defined(USE_OMP)
#pragma omp for
#endif
......@@ -2090,7 +2090,7 @@ namespace INMOST
{
integer conn_size = message_recv[m][pos++], flag = 1;
//REPORT_VAL("number of connxections",conn_size);
dynarray<HandleType,64> sub_elements;
std::vector<HandleType> sub_elements;
for(integer j = 0; j < conn_size; j++)
{
integer global_id = message_recv[m][pos++];
......@@ -6820,7 +6820,7 @@ namespace INMOST
Tag tag_new_processors = CreateTag("TEMPORARY_NEW_PROCESSORS",DATA_INTEGER,ESET | CELL | FACE | EDGE | NODE, NONE);
ElementType bridge = Integer(GetHandle(),tag_bridge);
Storage::integer layers = Integer(GetHandle(),tag_layers);
dynarray<Storage::integer,64> result,intersection;
std::vector<Storage::integer> result,intersection;
ExchangeData(tag_new_owner,CELL,0);
......@@ -7163,7 +7163,7 @@ namespace INMOST
//compute processors that should have the entity but they have not
Storage::integer_array old_procs = it->IntegerArrayDV(tag_processors);
result.resize(new_procs.size());
dynarray<Storage::integer,64>::iterator end = std::set_difference(new_procs.begin(),new_procs.end(),old_procs.begin(),old_procs.end(),result.begin());
std::vector<Storage::integer>::iterator end = std::set_difference(new_procs.begin(),new_procs.end(),old_procs.begin(),old_procs.end(),result.begin());
result.resize(end-result.begin());
//mark to send entity to processors that don't have it
Storage::integer_array sendto = it->IntegerArray(tag_sendto);
......
......@@ -37,7 +37,7 @@ namespace INMOST
#endif
{
int ierr = 0;
dynarray<INMOST_DATA_REAL_TYPE, 1024> temp(num);
std::vector<INMOST_DATA_REAL_TYPE> temp(num);
memcpy(temp.data(), inout, sizeof(INMOST_DATA_REAL_TYPE) * num);
GUARD_MPI(MPI_Allreduce(temp.data(), inout, num, INMOST_MPI_DATA_REAL_TYPE, MPI_SUM, comm));
}
......
......@@ -49,7 +49,7 @@ namespace INMOST
int flag, i, its, j, jj, k, l, nm;
INMOST_DATA_REAL_TYPE c, f, h, s, x, y, z;
INMOST_DATA_REAL_TYPE anorm = 0.0, g = 0.0, scale = 0.0;
dynarray<INMOST_DATA_REAL_TYPE,64> rv1;
std::vector<INMOST_DATA_REAL_TYPE> rv1;
rv1.resize(n);
// Householder reduction to bidiagonal form
for (i = 0; i < n*n; ++i) u[i] = a[i];
......
......@@ -21,7 +21,7 @@ class ILUC_preconditioner : public Method
Sparse::Row row, col;
INMOST_DATA_REAL_TYPE diag;
} row_col;
typedef dynarray<INMOST_DATA_ENUM_TYPE,256> levels_t;
typedef std::vector<INMOST_DATA_ENUM_TYPE> levels_t;
//result of multilevel preconditioner
// |LDU F |
// A = | |
......
......@@ -76,7 +76,7 @@ class MLMTILUC_preconditioner : public Method
INMOST_DATA_ENUM_TYPE first, last;
INMOST_DATA_ENUM_TYPE Size() const { return last - first; }
} Interval;
typedef dynarray<INMOST_DATA_ENUM_TYPE,256> levels_t;
typedef std::vector<INMOST_DATA_ENUM_TYPE> levels_t;
std::vector<Sparse::Row::entry> L_Entries, U_Entries, B_Entries;
interval<INMOST_DATA_ENUM_TYPE, INMOST_DATA_REAL_TYPE> LU_Diag;
interval<INMOST_DATA_ENUM_TYPE, Interval> U_Address, L_Address, B_Address;
......
......@@ -78,7 +78,7 @@ using namespace INMOST;
}
void MTILUC_preconditioner::DumpMatrix(interval<INMOST_DATA_ENUM_TYPE, Interval> & Address,
array<Sparse::Row::entry> & Entries,
std::vector<Sparse::Row::entry> & Entries,
INMOST_DATA_ENUM_TYPE wmbeg, INMOST_DATA_ENUM_TYPE wmend,
std::string file_name)
{
......@@ -162,7 +162,7 @@ using namespace INMOST;
fout.close();
}
void MTILUC_preconditioner::CheckOrder(interval<INMOST_DATA_ENUM_TYPE, Interval> & Address,
array<Sparse::Row::entry> & Entries,
std::vector<Sparse::Row::entry> & Entries,
INMOST_DATA_ENUM_TYPE rbeg, INMOST_DATA_ENUM_TYPE rend)
{
INMOST_DATA_ENUM_TYPE i,r;
......@@ -212,7 +212,7 @@ using namespace INMOST;
}
}
void MTILUC_preconditioner::SwapEntries(interval<INMOST_DATA_ENUM_TYPE, Interval> & Address,
array<Sparse::Row::entry> & Entries,
std::vector<Sparse::Row::entry> & Entries,
INMOST_DATA_ENUM_TYPE rbeg, INMOST_DATA_ENUM_TYPE rend,
INMOST_DATA_ENUM_TYPE k, INMOST_DATA_ENUM_TYPE j)
{
......@@ -588,7 +588,7 @@ using namespace INMOST;
#if defined(ILUC2)
INMOST_DATA_ENUM_TYPE nzLU2 = 0;
INMOST_DATA_REAL_TYPE tau2 = iluc2_tau;
array<Sparse::Row::entry> LU2_Entries;
std::vector<Sparse::Row::entry> LU2_Entries;
interval<INMOST_DATA_ENUM_TYPE, Interval> L2_Address(mobeg, moend+1), U2_Address(mobeg, moend+1);
interval<INMOST_DATA_ENUM_TYPE, INMOST_DATA_ENUM_TYPE> U2list(mobeg, moend, UNDEF), L2list(mobeg, moend, UNDEF);
interval<INMOST_DATA_ENUM_TYPE, INMOST_DATA_ENUM_TYPE> U2beg(mobeg, moend, EOL), L2beg(mobeg, moend, EOL);
......
......@@ -16,10 +16,10 @@ class MTILUC_preconditioner : public Method
typedef std::pair<INMOST_DATA_ENUM_TYPE, INMOST_DATA_ENUM_TYPE> coord;
typedef std::pair<INMOST_DATA_REAL_TYPE, coord > wgt_coord;
typedef std::vector< wgt_coord > wgt_coords;
typedef dynarray<INMOST_DATA_ENUM_TYPE,256> levels_t;
typedef std::vector<INMOST_DATA_ENUM_TYPE> levels_t;
//Sparse::Vector div;
array<Sparse::Row::entry> LU_Entries;
std::vector<Sparse::Row::entry> LU_Entries;
std::vector<Sparse::Row::entry> B_Entries;
interval<INMOST_DATA_ENUM_TYPE, INMOST_DATA_REAL_TYPE> LU_Diag;
interval<INMOST_DATA_ENUM_TYPE, Interval> U_Address, L_Address, B_Address;
......@@ -36,14 +36,14 @@ class MTILUC_preconditioner : public Method
Solver::OrderInfo * info;
bool init;
void DumpMatrix(interval<INMOST_DATA_ENUM_TYPE, Interval> & Address,
array<Sparse::Row::entry> & Entries,
std::vector<Sparse::Row::entry> & Entries,
INMOST_DATA_ENUM_TYPE wmbeg, INMOST_DATA_ENUM_TYPE wmend,
std::string file_name);
void CheckOrder(interval<INMOST_DATA_ENUM_TYPE, Interval> & Address,
array<Sparse::Row::entry> & Entries,
std::vector<Sparse::Row::entry> & Entries,
INMOST_DATA_ENUM_TYPE rbeg, INMOST_DATA_ENUM_TYPE rend);
void SwapEntries(interval<INMOST_DATA_ENUM_TYPE, Interval> & Address,
array<Sparse::Row::entry> & Entries,
std::vector<Sparse::Row::entry> & Entries,
INMOST_DATA_ENUM_TYPE rbeg, INMOST_DATA_ENUM_TYPE rend,
INMOST_DATA_ENUM_TYPE k, INMOST_DATA_ENUM_TYPE j);
void SwapLine(interval<INMOST_DATA_ENUM_TYPE, Interval> & Line, INMOST_DATA_ENUM_TYPE i, INMOST_DATA_ENUM_TYPE j);
......
......@@ -399,7 +399,7 @@ int main(int argc,char ** argv)
Storage::real B[] = {-1,5,-21};
raMatrix mA = raMatrixMake(A,3,1);
raMatrix mB = raMatrixMake(B,3,1);
rdMatrix Q = mA.Transform(mB);
rMatrix Q = mA.Transform(mB);
std::cout << "Q:" << std::endl;
Q.Print();
std::cout << "Q*mA:" << std::endl;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or