Commit bfe393fd authored by Kirill Terekhov's avatar Kirill Terekhov

Merge branch 'master' of https://github.com/INMOST-DEV/INMOST

parents 354b2de4 f68544bc
......@@ -5,7 +5,7 @@
#if defined(USE_AUTODIFF)
#include "inmost_expression.h"
#endif
#include "inmost_dense.h"
#if defined(USE_MESH)
......@@ -673,6 +673,13 @@ namespace INMOST
TagRealArray & operator = (Tag const & b) {Tag::operator =(b); return *this;}
__INLINE Storage::real_array operator [](const Storage & arg) const {return arg.RealArray(*static_cast<const Tag*>(this));}
__INLINE Storage::real_array operator [](HandleType h) const;
__INLINE Matrix<Storage::real,Storage::real_array> operator()(const Storage & arg, int n, int m) const
{
Storage::real_array data = arg.RealArray(*static_cast<const Tag*>(this));
assert(data.size() == n*m);
return Matrix<Storage::real,Storage::real_array>(data,n,m);
}
__INLINE Matrix<Storage::real,Storage::real_array> operator()(HandleType h, int n, int m) const;
};
class TagIntegerArray : public Tag
......@@ -734,6 +741,13 @@ namespace INMOST
TagVariableArray & operator = (Tag const & b) {Tag::operator =(b); return *this;}
__INLINE Storage::var_array operator [](const Storage & arg) const {return arg.VariableArray(*static_cast<const Tag*>(this));}
__INLINE Storage::var_array operator [](HandleType h) const;
__INLINE Matrix<Storage::var,Storage::var_array> operator()(const Storage & arg, int n, int m) const
{
Storage::var_array data = arg.VariableArray(*static_cast<const Tag*>(this));
assert(data.size() == n*m);
return Matrix<Storage::var,Storage::var_array>(data,n,m);
}
__INLINE Matrix<Storage::var,Storage::var_array> operator()(HandleType h, int n, int m) const;
};
#endif //USE_AUTODIFF
......
......@@ -553,9 +553,9 @@ namespace INMOST
for(enumerator l = 0; l < Cols(); ++l)
{
if( fabs(get_value((*this)(k,l))) > threshold )
std::cout << std::setw(10) << get_value((*this)(k,l));
std::cout << std::setw(12) << get_value((*this)(k,l));
else
std::cout << std::setw(10) << 0;
std::cout << std::setw(12) << 0;
std::cout << " ";
}
std::cout << std::endl;
......@@ -815,10 +815,10 @@ namespace INMOST
Matrix(enumerator pn, enumerator pm) : space(pn*pm), n(pn), m(pm) {}
/// Copy matrix.
/// @param other Another matrix of the same type.
Matrix(const Matrix & other) : space(other.n*other.m), n(other.n), m(other.m)
Matrix(const Matrix & other) : space(other.space), n(other.n), m(other.m)
{
for(enumerator i = 0; i < n*m; ++i)
space[i] = other.space[i];
//for(enumerator i = 0; i < n*m; ++i)
// space[i] = other.space[i];
}
/// Construct matrix from matrix of different type.
/// Uses assign function declared in inmost_expression.h.
......
......@@ -3470,6 +3470,12 @@ namespace INMOST
{
return GetMeshLink()->RealArray(h,*static_cast<const Tag*>(this));
}
__INLINE Matrix<Storage::real,Storage::real_array> TagRealArray::operator ()(HandleType h, int n, int m) const
{
Storage::real_array data = GetMeshLink()->RealArray(h,*static_cast<const Tag*>(this));
assert(data.size() == n*m);
return Matrix<Storage::real,Storage::real_array>(data,n,m);
}
__INLINE Storage::integer_array TagIntegerArray::operator [](HandleType h) const
{
return GetMeshLink()->IntegerArray(h,*static_cast<const Tag*>(this));
......@@ -3515,6 +3521,13 @@ namespace INMOST
{
return GetMeshLink()->VariableArray(h,*static_cast<const Tag*>(this));
}
__INLINE Matrix<Storage::var,Storage::var_array> TagVariableArray::operator ()(HandleType h, int n, int m) const
{
Storage::var_array data = GetMeshLink()->VariableArray(h,*static_cast<const Tag*>(this));
assert(data.size() == n*m);
return Matrix<Storage::var,Storage::var_array>(data,n,m);
}
#endif
__INLINE bool Storage::HaveData(const Tag & tag) const
{
......
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 to comment