Commit 87b73fc7 authored by igor's avatar igor

Fix some warnings for MS Windows compiler

parent 35a37cf4
...@@ -96,7 +96,7 @@ namespace INMOST ...@@ -96,7 +96,7 @@ namespace INMOST
else else
{ {
BlockEntry b(typemask,domain_mask); BlockEntry b(typemask,domain_mask);
for(int k = 0; k < t.GetSize(); ++k) for(INMOST_DATA_ENUM_TYPE k = 0; k < t.GetSize(); ++k)
b.AddTag(t,k); b.AddTag(t,k);
return RegisterEntry(b); return RegisterEntry(b);
} }
...@@ -282,8 +282,9 @@ namespace INMOST ...@@ -282,8 +282,9 @@ namespace INMOST
std::vector<INMOST_DATA_ENUM_TYPE> Automatizator::ListRegisteredEntries() const std::vector<INMOST_DATA_ENUM_TYPE> Automatizator::ListRegisteredEntries() const
{ {
std::vector<INMOST_DATA_ENUM_TYPE> ret; std::vector<INMOST_DATA_ENUM_TYPE> ret;
for(blk_enum::size_type it = 0; it < reg_blocks.size(); ++it) if( isRegisteredEntry(it) ) for(blk_enum::size_type it = 0; it < reg_blocks.size(); ++it)
ret.push_back(static_cast<INMOST_DATA_ENUM_TYPE>(it)); if( isRegisteredEntry(static_cast<INMOST_DATA_ENUM_TYPE>(it)) )
ret.push_back(static_cast<INMOST_DATA_ENUM_TYPE>(it));
return ret; return ret;
} }
...@@ -320,7 +321,7 @@ namespace INMOST ...@@ -320,7 +321,7 @@ namespace INMOST
INMOST_DATA_REAL_TYPE MultiEntry::Value(const Storage & e, INMOST_DATA_ENUM_TYPE unk) const INMOST_DATA_REAL_TYPE MultiEntry::Value(const Storage & e, INMOST_DATA_ENUM_TYPE unk) const
{ {
unsigned pos = 0, k = 0; unsigned pos = 0;
for(unsigned k = 0; k < entries.size(); ++k) if( entries[k]->isValid(e) ) for(unsigned k = 0; k < entries.size(); ++k) if( entries[k]->isValid(e) )
{ {
unsigned s = entries[k]->MatrixSize(e); unsigned s = entries[k]->MatrixSize(e);
...@@ -333,7 +334,7 @@ namespace INMOST ...@@ -333,7 +334,7 @@ namespace INMOST
INMOST_DATA_REAL_TYPE & MultiEntry::Value(const Storage & e, INMOST_DATA_ENUM_TYPE unk) INMOST_DATA_REAL_TYPE & MultiEntry::Value(const Storage & e, INMOST_DATA_ENUM_TYPE unk)
{ {
unsigned pos = 0, k = 0; unsigned pos = 0;
for(unsigned k = 0; k < entries.size(); ++k) if( entries[k]->isValid(e) ) for(unsigned k = 0; k < entries.size(); ++k) if( entries[k]->isValid(e) )
{ {
unsigned s = entries[k]->MatrixSize(e); unsigned s = entries[k]->MatrixSize(e);
...@@ -346,7 +347,7 @@ namespace INMOST ...@@ -346,7 +347,7 @@ namespace INMOST
INMOST_DATA_ENUM_TYPE MultiEntry::Index(const Storage & e, INMOST_DATA_ENUM_TYPE unk) const INMOST_DATA_ENUM_TYPE MultiEntry::Index(const Storage & e, INMOST_DATA_ENUM_TYPE unk) const
{ {
unsigned pos = 0, k = 0; unsigned pos = 0;
for(unsigned k = 0; k < entries.size(); ++k) if( entries[k]->isValid(e) ) for(unsigned k = 0; k < entries.size(); ++k) if( entries[k]->isValid(e) )
{ {
unsigned s = entries[k]->MatrixSize(e); unsigned s = entries[k]->MatrixSize(e);
...@@ -359,7 +360,7 @@ namespace INMOST ...@@ -359,7 +360,7 @@ namespace INMOST
unknown MultiEntry::Unknown(const Storage & e, INMOST_DATA_ENUM_TYPE unk) const unknown MultiEntry::Unknown(const Storage & e, INMOST_DATA_ENUM_TYPE unk) const
{ {
unsigned pos = 0, k = 0; unsigned pos = 0;
for(unsigned k = 0; k < entries.size(); ++k) if( entries[k]->isValid(e) ) for(unsigned k = 0; k < entries.size(); ++k) if( entries[k]->isValid(e) )
{ {
unsigned s = entries[k]->MatrixSize(e); unsigned s = entries[k]->MatrixSize(e);
......
...@@ -121,11 +121,11 @@ namespace INMOST ...@@ -121,11 +121,11 @@ namespace INMOST
/// Return vector filled with unknowns of the block with their derivatives. /// Return vector filled with unknowns of the block with their derivatives.
uMatrix operator [](const Storage & e) const {uMatrix ret(MatrixSize(e),1); for(unsigned k = 0; k < Size(); ++k) ret(k,0) = Unknown(e,k); return ret; } uMatrix operator [](const Storage & e) const {uMatrix ret(MatrixSize(e),1); for(unsigned k = 0; k < Size(); ++k) ret(k,0) = Unknown(e,k); return ret; }
/// The intended size of the matrix for this entry. /// The intended size of the matrix for this entry.
INMOST_DATA_ENUM_TYPE MatrixSize(const Storage & e) const {return Size();} INMOST_DATA_ENUM_TYPE MatrixSize(const Storage & e) const {(void)e; return Size();}
/// Number of tags in block. /// Number of tags in block.
INMOST_DATA_ENUM_TYPE Size() const {return (INMOST_DATA_ENUM_TYPE)unknown_tags.size();} INMOST_DATA_ENUM_TYPE Size() const {return (INMOST_DATA_ENUM_TYPE)unknown_tags.size();}
/// Number of entries for each tag in the block. /// Number of entries for each tag in the block.
INMOST_DATA_ENUM_TYPE Size(const Storage & e) const {return (INMOST_DATA_ENUM_TYPE)unknown_tags.size();} INMOST_DATA_ENUM_TYPE Size(const Storage & e) const {(void)e; return (INMOST_DATA_ENUM_TYPE)unknown_tags.size();}
/// Retrive component of the tag related to unknown. /// Retrive component of the tag related to unknown.
INMOST_DATA_ENUM_TYPE GetValueComp(INMOST_DATA_ENUM_TYPE unk) const {return unknown_comp[unk];} INMOST_DATA_ENUM_TYPE GetValueComp(INMOST_DATA_ENUM_TYPE unk) const {return unknown_comp[unk];}
/// Retrive tag related to unknown value. /// Retrive tag related to unknown value.
...@@ -148,11 +148,11 @@ namespace INMOST ...@@ -148,11 +148,11 @@ namespace INMOST
///Provide tag. ///Provide tag.
void SetTag(Tag unknown_tag_in, INMOST_DATA_ENUM_TYPE unknown_comp_in = 0) {unknown_tag = unknown_tag_in; unknown_comp = unknown_comp_in;} void SetTag(Tag unknown_tag_in, INMOST_DATA_ENUM_TYPE unknown_comp_in = 0) {unknown_tag = unknown_tag_in; unknown_comp = unknown_comp_in;}
/// Return value in vector of unknowns of the block at certain position. /// Return value in vector of unknowns of the block at certain position.
INMOST_DATA_REAL_TYPE Value(const Storage & e, INMOST_DATA_ENUM_TYPE pos) const {assert(pos==0); return unknown_tag[e][unknown_comp];} INMOST_DATA_REAL_TYPE Value(const Storage & e, INMOST_DATA_ENUM_TYPE pos) const {(void)pos; assert(pos==0); return unknown_tag[e][unknown_comp];}
/// Return value in vector of unknowns of the block at certain position. /// Return value in vector of unknowns of the block at certain position.
INMOST_DATA_REAL_TYPE & Value(const Storage & e, INMOST_DATA_ENUM_TYPE pos) {assert(pos==0); return unknown_tag[e][unknown_comp];} INMOST_DATA_REAL_TYPE & Value(const Storage & e, INMOST_DATA_ENUM_TYPE pos) {(void)pos; assert(pos==0); return unknown_tag[e][unknown_comp];}
/// Return index in vector of indices of the block at certain position. /// Return index in vector of indices of the block at certain position.
INMOST_DATA_ENUM_TYPE Index(const Storage & e, INMOST_DATA_ENUM_TYPE pos) const {assert(pos==0); return isValid(e) ? GetOffsetTag()[e] : ENUMUNDEF;} INMOST_DATA_ENUM_TYPE Index(const Storage & e, INMOST_DATA_ENUM_TYPE pos) const {(void)pos; assert(pos==0); return isValid(e) ? GetOffsetTag()[e] : ENUMUNDEF;}
/// Return unknown in vector of variables of the block at certain position. /// Return unknown in vector of variables of the block at certain position.
unknown Unknown(const Storage & e, INMOST_DATA_ENUM_TYPE pos) const {assert(pos==0); return unknown(Value(e,pos),Index(e,pos));} unknown Unknown(const Storage & e, INMOST_DATA_ENUM_TYPE pos) const {assert(pos==0); return unknown(Value(e,pos),Index(e,pos));}
/// Return vector filled with values of unknowns of the block. /// Return vector filled with values of unknowns of the block.
...@@ -164,15 +164,15 @@ namespace INMOST ...@@ -164,15 +164,15 @@ namespace INMOST
/// Return vector filled with unknowns of the block with their derivatives. /// Return vector filled with unknowns of the block with their derivatives.
uMatrix operator [](const Storage & e) const { uMatrix ret(1,1); ret(0,0) = Unknown(e,0); return ret; } uMatrix operator [](const Storage & e) const { uMatrix ret(1,1); ret(0,0) = Unknown(e,0); return ret; }
/// The intended size of the matrix for this entry. /// The intended size of the matrix for this entry.
INMOST_DATA_ENUM_TYPE MatrixSize(const Storage & e) const {return 1;} INMOST_DATA_ENUM_TYPE MatrixSize(const Storage & e) const {(void)e; return 1;}
/// Number of tags in block. /// Number of tags in block.
INMOST_DATA_ENUM_TYPE Size() const {return 1;} INMOST_DATA_ENUM_TYPE Size() const {return 1;}
/// Number of entries for each tag in the block. /// Number of entries for each tag in the block.
INMOST_DATA_ENUM_TYPE Size(const Storage & e) const {return 1;} INMOST_DATA_ENUM_TYPE Size(const Storage & e) const {(void)e; return 1;}
/// Retrive component of the tag related to unknown. /// Retrive component of the tag related to unknown.
INMOST_DATA_ENUM_TYPE GetValueComp(INMOST_DATA_ENUM_TYPE unk) const {assert(unk == 0); return unknown_comp;} INMOST_DATA_ENUM_TYPE GetValueComp(INMOST_DATA_ENUM_TYPE unk) const {(void)unk; assert(unk == 0); return unknown_comp;}
/// Retrive tag related to unknown value. /// Retrive tag related to unknown value.
TagRealArray GetValueTag(INMOST_DATA_ENUM_TYPE unk) const { assert(unk == 0); return unknown_tag;} TagRealArray GetValueTag(INMOST_DATA_ENUM_TYPE unk) const {(void)unk; assert(unk == 0); return unknown_tag;}
/// Retrive mesh pointer. /// Retrive mesh pointer.
Mesh * GetMeshLink() const {return unknown_tag.GetMeshLink();} Mesh * GetMeshLink() const {return unknown_tag.GetMeshLink();}
/// Make a copy of the object /// Make a copy of the object
...@@ -212,9 +212,9 @@ namespace INMOST ...@@ -212,9 +212,9 @@ namespace INMOST
/// Number of entries for each tag in the block. /// Number of entries for each tag in the block.
INMOST_DATA_ENUM_TYPE Size(const Storage & e) const {return (INMOST_DATA_ENUM_TYPE)unknown_tag[e].size();} INMOST_DATA_ENUM_TYPE Size(const Storage & e) const {return (INMOST_DATA_ENUM_TYPE)unknown_tag[e].size();}
/// Retrive component of the tag related to unknown. /// Retrive component of the tag related to unknown.
INMOST_DATA_ENUM_TYPE GetValueComp(INMOST_DATA_ENUM_TYPE unk) const {assert(unk==0); return ENUMUNDEF;} INMOST_DATA_ENUM_TYPE GetValueComp(INMOST_DATA_ENUM_TYPE unk) const {(void)unk; assert(unk==0); return ENUMUNDEF;}
/// Retrive tag related to unknown value. /// Retrive tag related to unknown value.
TagRealArray GetValueTag(INMOST_DATA_ENUM_TYPE unk) const {assert(unk==0); return unknown_tag;} TagRealArray GetValueTag(INMOST_DATA_ENUM_TYPE unk) const {(void)unk; assert(unk==0); return unknown_tag;}
/// Retrive mesh pointer. /// Retrive mesh pointer.
Mesh * GetMeshLink() const {return unknown_tag.GetMeshLink();} Mesh * GetMeshLink() const {return unknown_tag.GetMeshLink();}
/// Make a copy of the object /// Make a copy of the object
...@@ -262,7 +262,7 @@ namespace INMOST ...@@ -262,7 +262,7 @@ namespace INMOST
/// Return vector filled with unknowns of the block with their derivatives. /// Return vector filled with unknowns of the block with their derivatives.
uMatrix operator [](const Storage & e) const {uMatrix ret(MatrixSize(e),1); for(INMOST_DATA_ENUM_TYPE k = 0; k < Size(); ++k) ret(k,0) = Unknown(e,k); return ret; } uMatrix operator [](const Storage & e) const {uMatrix ret(MatrixSize(e),1); for(INMOST_DATA_ENUM_TYPE k = 0; k < Size(); ++k) ret(k,0) = Unknown(e,k); return ret; }
/// The intended size of the matrix for this entry. /// The intended size of the matrix for this entry.
INMOST_DATA_ENUM_TYPE MatrixSize(const Storage & e) const {return Size();} INMOST_DATA_ENUM_TYPE MatrixSize(const Storage & e) const {(void)e; return Size();}
/// Number of tags in block. /// Number of tags in block.
INMOST_DATA_ENUM_TYPE Size() const {return (INMOST_DATA_ENUM_TYPE)unknown_tags.size();} INMOST_DATA_ENUM_TYPE Size() const {return (INMOST_DATA_ENUM_TYPE)unknown_tags.size();}
/// Number of entries for each tag in the block. /// Number of entries for each tag in the block.
......
...@@ -112,15 +112,15 @@ namespace INMOST ...@@ -112,15 +112,15 @@ namespace INMOST
private: private:
rMatrix value; rMatrix value;
public: public:
const_block_variable(INMOST_DATA_REAL_TYPE _value) : value(_value) {} const_block_variable(const rMatrix & _value) : value(_value) {}
const_block_variable(const const_block_variable & other) : value(other.value) {} const_block_variable(const const_block_variable & other) : value(other.value) {}
const_block_variable & operator =(const const_block_variable & other) const_block_variable & operator =(const const_block_variable & other)
{ {
value = other.value; value = other.value;
return * this; return * this;
} }
rMatrix Value(const Storage & e) const {return value;} rMatrix Value(const Storage & e) const {(void)e; return value;}
vMatrix Variable(const Storage & e) const { return value; } vMatrix Variable(const Storage & e) const {(void)e; return value;}
abstract_dynamic_block_variable * Copy() const {return static_cast<abstract_dynamic_block_variable *>(new const_block_variable(*this));} abstract_dynamic_block_variable * Copy() const {return static_cast<abstract_dynamic_block_variable *>(new const_block_variable(*this));}
}; };
...@@ -231,16 +231,16 @@ namespace INMOST ...@@ -231,16 +231,16 @@ namespace INMOST
rMatrix Value(const Storage & e) const rMatrix Value(const Storage & e) const
{ {
rMatrix ret = Arg.Value(e); rMatrix ret = Arg.Value(e);
for(int k = 0; k < ret.Rows(); ++k) for(INMOST_DATA_ENUM_TYPE k = 0; k < ret.Rows(); ++k)
for(int l = 0; l < ret.Cols(); ++l) for(INMOST_DATA_ENUM_TYPE l = 0; l < ret.Cols(); ++l)
ret(k,l) = get_table(ret(k,l),Table); ret(k,l) = get_table(ret(k,l),Table);
return ret; return ret;
} }
vMatrix Variable(const Storage & e) const vMatrix Variable(const Storage & e) const
{ {
vMatrix ret = Arg.Variable(e); vMatrix ret = Arg.Variable(e);
for(int k = 0; k < ret.Rows(); ++k) for(INMOST_DATA_ENUM_TYPE k = 0; k < ret.Rows(); ++k)
for(int l = 0; l < ret.Cols(); ++l) for(INMOST_DATA_ENUM_TYPE l = 0; l < ret.Cols(); ++l)
ret(k,l) = get_table(ret(k,l),Table); ret(k,l) = get_table(ret(k,l),Table);
return ret; return ret;
} }
......
...@@ -1795,6 +1795,7 @@ namespace INMOST ...@@ -1795,6 +1795,7 @@ namespace INMOST
{ {
assert(Cols() == cols); assert(Cols() == cols);
assert(Rows() == rows); assert(Rows() == rows);
(void)cols; (void)rows;
} }
}; };
...@@ -2153,7 +2154,7 @@ namespace INMOST ...@@ -2153,7 +2154,7 @@ namespace INMOST
Matrix<typename Promote<Var,typeB>::type> AtB = At*B; //m by l matrix Matrix<typename Promote<Var,typeB>::type> AtB = At*B; //m by l matrix
Matrix<Var> AtA = At*(*this); //m by m matrix Matrix<Var> AtA = At*(*this); //m by m matrix
enumerator l = AtB.Cols(); enumerator l = AtB.Cols();
enumerator n = Rows(); //enumerator n = Rows();
enumerator m = Cols(); enumerator m = Cols();
enumerator * order = new enumerator [m]; enumerator * order = new enumerator [m];
std::pair<Matrix<typename Promote<Var,typeB>::type>,bool> std::pair<Matrix<typename Promote<Var,typeB>::type>,bool>
...@@ -2315,7 +2316,7 @@ namespace INMOST ...@@ -2315,7 +2316,7 @@ namespace INMOST
ret.second = SVD(U,S,V); ret.second = SVD(U,S,V);
if( print_fail && !ret.second ) if( print_fail && !ret.second )
std::cout << "Failed to compute Moore-Penrose inverse of the matrix" << std::endl; std::cout << "Failed to compute Moore-Penrose inverse of the matrix" << std::endl;
for(int k = 0; k < S.Cols(); ++k) for(INMOST_DATA_ENUM_TYPE k = 0; k < S.Cols(); ++k)
{ {
if( S(k,k) > tol ) if( S(k,k) > tol )
S(k,k) = 1.0/S(k,k); S(k,k) = 1.0/S(k,k);
......
...@@ -172,6 +172,7 @@ namespace INMOST ...@@ -172,6 +172,7 @@ namespace INMOST
if( !J.isSorted() ) std::sort(J.Begin(),J.End()); if( !J.isSorted() ) std::sort(J.Begin(),J.End());
for(Sparse::Row::iterator it = J.Begin(); it != J.End(); ++it) it->second *= multJ; for(Sparse::Row::iterator it = J.Begin(); it != J.End(); ++it) it->second *= multJ;
H.Clear(); H.Clear();
(void)multH;
} }
__INLINE multivar_expression & operator = (INMOST_DATA_REAL_TYPE pvalue) __INLINE multivar_expression & operator = (INMOST_DATA_REAL_TYPE pvalue)
{ {
...@@ -631,6 +632,7 @@ namespace INMOST ...@@ -631,6 +632,7 @@ namespace INMOST
for(Sparse::Row::iterator it = J.Begin(); it != J.End(); ++it) it->second *= multJ; for(Sparse::Row::iterator it = J.Begin(); it != J.End(); ++it) it->second *= multJ;
H.Clear(); H.Clear();
} }
(void)multH;
} }
__INLINE multivar_expression_reference & operator = (INMOST_DATA_REAL_TYPE pvalue) __INLINE multivar_expression_reference & operator = (INMOST_DATA_REAL_TYPE pvalue)
{ {
...@@ -1848,6 +1850,7 @@ namespace INMOST ...@@ -1848,6 +1850,7 @@ namespace INMOST
left.GetHessian(1,JL,1,HL); //retrive jacobian row and hessian matrix of the left expression left.GetHessian(1,JL,1,HL); //retrive jacobian row and hessian matrix of the left expression
Sparse::HessianRow::MergeJacobianHessian(multH*ldmult2,JL,JL,multH*ldmult,HL,H); Sparse::HessianRow::MergeJacobianHessian(multH*ldmult2,JL,JL,multH*ldmult,HL,H);
for(Sparse::Row::iterator it = JL.Begin(); it != JL.End(); ++it) it->second *= ldmult*multJ; for(Sparse::Row::iterator it = JL.Begin(); it != JL.End(); ++it) it->second *= ldmult*multJ;
(void)J;
} }
}; };
......
...@@ -38,7 +38,7 @@ namespace INMOST ...@@ -38,7 +38,7 @@ namespace INMOST
/// Roll back to previous step. /// Roll back to previous step.
virtual bool RestoreTimeStep() = 0; virtual bool RestoreTimeStep() = 0;
/// Calculate multiplier for update for this model. Can simply return 1. /// Calculate multiplier for update for this model. Can simply return 1.
virtual double UpdateMultiplier(const Sparse::Vector & sol) const {return 1;} virtual double UpdateMultiplier(const Sparse::Vector & sol) const {(void)sol; return 1;}
/// Calculate time step for this model. Can simply return dt. /// Calculate time step for this model. Can simply return dt.
virtual double AdjustTimeStep(double dt) const {return dt;} virtual double AdjustTimeStep(double dt) const {return dt;}
}; };
......
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
#include "inmost_common.h" #include "inmost_common.h"
namespace INMOST namespace INMOST
{ {
namespace Sparse namespace Sparse
......
...@@ -273,12 +273,13 @@ namespace INMOST ...@@ -273,12 +273,13 @@ namespace INMOST
value = other.value; value = other.value;
return * this; return * this;
} }
INMOST_DATA_REAL_TYPE Value(const Storage & e) const {return value;} INMOST_DATA_REAL_TYPE Value(const Storage & e) const {(void)e; return value;}
multivar_expression Variable(const Storage & e) const multivar_expression Variable(const Storage & e) const
{ {
return multivar_expression(value); (void)e;
return multivar_expression(value);
} }
const_expression operator [](const Storage & e) const {return const_expression(value);} const_expression operator [](const Storage & e) const {(void)e; return const_expression(value);}
void GetVariation(const Storage & e, Sparse::Row & r) const { (*this)[e].GetJacobian(1.0,r); } void GetVariation(const Storage & e, Sparse::Row & r) const { (*this)[e].GetJacobian(1.0,r); }
void GetVariation(const Storage & e, Sparse::RowMerger & r) const { (*this)[e].GetJacobian(1.0,r); } void GetVariation(const Storage & e, Sparse::RowMerger & r) const { (*this)[e].GetJacobian(1.0,r); }
abstract_dynamic_variable * Copy() const {return static_cast<abstract_dynamic_variable *>(new const_variable(*this));} abstract_dynamic_variable * Copy() const {return static_cast<abstract_dynamic_variable *>(new const_variable(*this));}
...@@ -296,12 +297,13 @@ namespace INMOST ...@@ -296,12 +297,13 @@ namespace INMOST
value = other.value; value = other.value;
return * this; return * this;
} }
INMOST_DATA_REAL_TYPE Value(const Storage & e) const {return *value;} INMOST_DATA_REAL_TYPE Value(const Storage & e) const {(void)e; return *value;}
multivar_expression Variable(const Storage & e) const multivar_expression Variable(const Storage & e) const
{ {
return multivar_expression(*value); (void)e;
return multivar_expression(*value);
} }
const_expression operator [](const Storage & e) const {return const_expression(*value);} const_expression operator [](const Storage & e) const {(void)e; return const_expression(*value);}
void GetVariation(const Storage & e, Sparse::Row & r) const { (*this)[e].GetJacobian(1.0,r); } void GetVariation(const Storage & e, Sparse::Row & r) const { (*this)[e].GetJacobian(1.0,r); }
void GetVariation(const Storage & e, Sparse::RowMerger & r) const { (*this)[e].GetJacobian(1.0,r); } void GetVariation(const Storage & e, Sparse::RowMerger & r) const { (*this)[e].GetJacobian(1.0,r); }
abstract_dynamic_variable * Copy() const {return static_cast<abstract_dynamic_variable *>(new const_link_variable(*this));} abstract_dynamic_variable * Copy() const {return static_cast<abstract_dynamic_variable *>(new const_link_variable(*this));}
......
#ifdef _MSC_VER //kill some warnings #ifdef _MSC_VER //kill some warnings
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS
#endif
#ifndef _SCL_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS #define _SCL_SECURE_NO_WARNINGS
#endif #endif
#endif
#include "inmost.h" #include "inmost.h"
#include "../Mesh/incident_matrix.hpp" #include "../Mesh/incident_matrix.hpp"
......
...@@ -1419,7 +1419,7 @@ namespace INMOST ...@@ -1419,7 +1419,7 @@ namespace INMOST
} while(true); } while(true);
data.RemPrivateMarker(mrk); data.RemPrivateMarker(mrk);
mesh->ReleasePrivateMarker(mrk); mesh->ReleasePrivateMarker(mrk);
Storage::real nrm[3], cnt[3], ccnt[3]; Storage::real nrm[3], cnt[3];
for(unsigned j = 0; j < data.size(); j++) for(unsigned j = 0; j < data.size(); j++)
{ {
//std::cout << (data[j].GetPrivateMarker(rev) ? 0:1); //std::cout << (data[j].GetPrivateMarker(rev) ? 0:1);
......
...@@ -1609,7 +1609,7 @@ namespace INMOST ...@@ -1609,7 +1609,7 @@ namespace INMOST
void OperationMinDistance(const Tag & tag, const Element & element, const INMOST_DATA_BULK_TYPE * data, INMOST_DATA_ENUM_TYPE size) void OperationMinDistance(const Tag & tag, const Element & element, const INMOST_DATA_BULK_TYPE * data, INMOST_DATA_ENUM_TYPE size)
{ {
int owner = *((double*)data); int owner = (int)*((double*)data);
double dist = *((double*)(data+sizeof(double))); double dist = *((double*)(data+sizeof(double)));
TagReal r_tag = tag; TagReal r_tag = tag;
...@@ -1619,11 +1619,12 @@ namespace INMOST ...@@ -1619,11 +1619,12 @@ namespace INMOST
element->RealArray(tag)[0] = owner; element->RealArray(tag)[0] = owner;
element->RealArray(tag)[1] = dist; element->RealArray(tag)[1] = dist;
} }
(void)size;
} }
void Mesh::ResolveModification() void Mesh::ResolveModification()
{ {
int rank = GetProcessorRank(),mpisize = GetProcessorsNumber(); int rank = GetProcessorRank();
Tag tag = CreateTag("TEMP_DISTANSE",DATA_REAL,CELL,CELL,2); Tag tag = CreateTag("TEMP_DISTANSE",DATA_REAL,CELL,CELL,2);
...@@ -1642,7 +1643,7 @@ namespace INMOST ...@@ -1642,7 +1643,7 @@ namespace INMOST
} }
} }
int owner1 = it->IntegerDF(tag_owner); //int owner1 = it->IntegerDF(tag_owner);
int owner2 = near_cell.IntegerDF(tag_owner); int owner2 = near_cell.IntegerDF(tag_owner);
it->RealArray(tag)[0] = owner2; it->RealArray(tag)[0] = owner2;
...@@ -1654,7 +1655,7 @@ namespace INMOST ...@@ -1654,7 +1655,7 @@ namespace INMOST
for(Mesh::iteratorCell it = BeginCell(); it != EndCell(); it++) if (GetMarker(*it,NewMarker())) for(Mesh::iteratorCell it = BeginCell(); it != EndCell(); it++) if (GetMarker(*it,NewMarker()))
{ {
int new_owner = it->RealArray(tag)[0]; int new_owner = (int)it->RealArray(tag)[0];
it->IntegerDF(tag_owner) = new_owner; it->IntegerDF(tag_owner) = new_owner;
......
#ifdef _MSC_VER //kill some warnings #ifdef _MSC_VER //kill some warnings
#ifndef _SCL_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS #define _SCL_SECURE_NO_WARNINGS
#endif #endif
#endif
#include "inmost.h" #include "inmost.h"
...@@ -40,7 +42,9 @@ namespace INMOST ...@@ -40,7 +42,9 @@ namespace INMOST
std::string ro() std::string ro()
{ {
int rank = 0; int rank = 0;
#ifdef USE_MPI
MPI_Comm_rank(MPI_COMM_WORLD,&rank); MPI_Comm_rank(MPI_COMM_WORLD,&rank);
#endif
std::stringstream ss; std::stringstream ss;
for (int i = 0; i < rank; i++) for (int i = 0; i < rank; i++)
ss << " "; ss << " ";
...@@ -1618,6 +1622,7 @@ namespace INMOST ...@@ -1618,6 +1622,7 @@ namespace INMOST
#else //USE_MPI #else //USE_MPI
AssignGlobalID(CELL | FACE | EDGE | NODE); AssignGlobalID(CELL | FACE | EDGE | NODE);
(void)only_new;
#endif //USE_MPI #endif //USE_MPI
EXIT_FUNC(); EXIT_FUNC();
} }
...@@ -2284,7 +2289,6 @@ namespace INMOST ...@@ -2284,7 +2289,6 @@ namespace INMOST
void Mesh::PackTagData(const Tag & tag, const elements_by_type & elements, int destination, ElementType mask, MarkerType select, buffer_type & buffer) void Mesh::PackTagData(const Tag & tag, const elements_by_type & elements, int destination, ElementType mask, MarkerType select, buffer_type & buffer)
{ {
int rank = GetProcessorRank();
if( tag.GetDataType() == DATA_REMOTE_REFERENCE ) return; //NOT IMPLEMENTED TODO 14 if( tag.GetDataType() == DATA_REMOTE_REFERENCE ) return; //NOT IMPLEMENTED TODO 14
ENTER_FUNC(); ENTER_FUNC();
#if defined(USE_MPI) #if defined(USE_MPI)
...@@ -2397,6 +2401,7 @@ namespace INMOST ...@@ -2397,6 +2401,7 @@ namespace INMOST
#else #else
(void) tag; (void) tag;
(void) elements; (void) elements;
(void) destination;
(void) mask; (void) mask;
(void) select; (void) select;
(void) buffer; (void) buffer;
...@@ -2409,7 +2414,6 @@ namespace INMOST ...@@ -2409,7 +2414,6 @@ namespace INMOST
bool Mesh::FindSharedGhost(int global_id, INMOST_DATA_INTEGER_TYPE el_type_num, HandleType& res) bool Mesh::FindSharedGhost(int global_id, INMOST_DATA_INTEGER_TYPE el_type_num, HandleType& res)
{ {
int rank = GetProcessorRank();
int dim = el_type_num; int dim = el_type_num;
for (parallel_storage::iterator it = shared_elements.begin(); it != shared_elements.end(); it++) for (parallel_storage::iterator it = shared_elements.begin(); it != shared_elements.end(); it++)
{ {
...@@ -2439,8 +2443,7 @@ namespace INMOST ...@@ -2439,8 +2443,7 @@ namespace INMOST
void Mesh::UnpackTagData(const Tag & tag, const elements_by_type & elements, ElementType mask, MarkerType select, buffer_type & buffer, int & position, ReduceOperation op) void Mesh::UnpackTagData(const Tag & tag, const elements_by_type & elements, ElementType mask, MarkerType select, buffer_type & buffer, int & position, ReduceOperation op)
{ {
int rank = GetProcessorRank(); (void) mask;
(void) mask;
if( tag.GetDataType() == DATA_REMOTE_REFERENCE) return; //NOT IMPLEMENTED TODO 14 if( tag.GetDataType() == DATA_REMOTE_REFERENCE) return; //NOT IMPLEMENTED TODO 14
ENTER_FUNC(); ENTER_FUNC();
REPORT_VAL("TagName",tag.GetTagName()); REPORT_VAL("TagName",tag.GetTagName());
...@@ -2980,13 +2983,13 @@ namespace INMOST ...@@ -2980,13 +2983,13 @@ namespace INMOST
void Mesh::PackElementsData(element_set & all, buffer_type & buffer, int destination, const std::vector<std::string> & tag_list) void Mesh::PackElementsData(element_set & all, buffer_type & buffer, int destination, const std::vector<std::string> & tag_list)
{ {
int rank = GetProcessorRank();
//std::cout << ro() << rank << " In pack elements data " << all.size() << std::endl;
//std::cout << rank << " In pack elements Data" << std::endl;
ENTER_FUNC(); ENTER_FUNC();
REPORT_VAL("dest",destination); REPORT_VAL("dest",destination);
#if defined(USE_MPI) #if defined(USE_MPI)
INMOST_DATA_ENUM_TYPE num; int rank = GetProcessorRank();
//std::cout << ro() << rank << " In pack elements data " << all.size() << std::endl;
//std::cout << rank << " In pack elements Data" << std::endl;
INMOST_DATA_ENUM_TYPE num;
//assume hex mesh for forward allocation //assume hex mesh for forward allocation
//8 nodes per cell, 2 nodes per edge, 4 edges per face, 6 faces per cell //8 nodes per cell, 2 nodes per edge, 4 edges per face, 6 faces per cell
const INMOST_DATA_ENUM_TYPE size_hint[5] = {8,2,4,6,1}; const INMOST_DATA_ENUM_TYPE size_hint[5] = {8,2,4,6,1};
...@@ -3102,7 +3105,7 @@ namespace INMOST ...@@ -3102,7 +3105,7 @@ namespace INMOST
} }
stringstream ss; stringstream ss;
ss << ro() << rank << ": to send: "; ss << ro() << mpirank << ": to send: ";
ss << "nodes: " << selems[0].size() << " | "; ss << "nodes: " << selems[0].size() << " | ";
ss << "edge: " << selems[1].size() << " | "; ss << "edge: " << selems[1].size() << " | ";
ss << "faces: " << selems[2].size() << " | "; ss << "faces: " << selems[2].size() << " | ";
...@@ -3414,7 +3417,7 @@ namespace INMOST ...@@ -3414,7 +3417,7 @@ namespace INMOST
// Compute names_buff_size // Compute names_buff_size
for(element_set::iterator it = selems[4].begin(); it != selems[4].end(); it++) names_buff_size += ElementSet(this,*it).GetName().size() + 1; for(element_set::iterator it = selems[4].begin(); it != selems[4].end(); it++) names_buff_size += ElementSet(this,*it).GetName().size() + 1;
//cout << ro() << rank << ": Names buff size = " << names_buff_size << endl; //cout << ro() << mpirank << ": Names buff size = " << names_buff_size << endl;
char* names_buff; char* names_buff;
if (names_buff_size > 0) names_buff = new char[names_buff_size]; if (names_buff_size > 0) names_buff = new char[names_buff_size];
int names_buff_pos = 0; int names_buff_pos = 0;
...@@ -3429,7 +3432,7 @@ namespace INMOST ...@@ -3429,7 +3432,7 @@ namespace INMOST
// Add all low conns to low_conn_nums // Add all low conns to low_conn_nums
stringstream ss; stringstream ss;
ss << ro() << rank << ": For set " << ElementSet(this,*it).GetName() << " low conns ("; ss << ro() << mpirank << ": For set " << ElementSet(this,*it).GetName() << " low conns (";
low_conn_size[k] = 0; low_conn_size[k] = 0;
Element::adj_type const & lc = LowConn(*it); Element::adj_type const & lc = LowConn(*it);
for(Element::adj_type::const_iterator jt = lc.begin(); jt != lc.end(); jt++) if( !Hidden(*jt) ) for(Element::adj_type::const_iterator jt = lc.begin(); jt != lc.end(); jt++) if( !Hidden(*jt) )
...@@ -3451,7 +3454,7 @@ namespace INMOST ...@@ -3451,7 +3454,7 @@ namespace INMOST
if (set.HaveParent()) high_conn_nums[k*3+2] = Integer(selems[4][Integer(set.GetParent().GetHandle(), arr_position)],arr_position); else high_conn_nums[k*3 + 2] = -1; if (set.HaveParent()) high_conn_nums[k*3+2] = Integer(selems[4][Integer(set.GetParent().GetHandle(), arr_position)],arr_position); else high_conn_nums[k*3 + 2] = -1;