Commit 055857ca authored by Kirill Terekhov's avatar Kirill Terekhov

add functions to check memory usage; reduce memory usage by multilevel solver; fix some warnings

parent 07d81fc9
......@@ -214,7 +214,7 @@ namespace INMOST
void Automatizator::EnumerateEntries()
{
first_num = last_num = 0;
const ElementType paralleltypes = NODE | EDGE | FACE | CELL;
const ElementType paralleltypes = NODE | EDGE | FACE | CELL | ESET;
for (unsigned it = 0; it < reg_blocks.size(); ++it) if( act_blocks[it] )
{
......
......@@ -330,10 +330,10 @@ namespace INMOST
template<typename Var>
class ConstBlockOfMatrix;
template<typename Var, typename Storage = array<Var> >
template<typename Var, typename Storage = std::vector<Var> >
class Matrix;
template<typename Var, typename Storage = array<Var> >
template<typename Var, typename Storage = std::vector<Var> >
class SymmetricMatrix;
}
......@@ -343,5 +343,8 @@ __INLINE bool __isnan__(double x) { return x != x; }
__INLINE bool __isinf__(double x) { return fabs(x) > DBL_MAX; }
__INLINE bool __isbad(double x) { return __isnan__(x) || __isinf__(x); }
//in Utils/mem.cpp
size_t getPeakRSS();
size_t getCurrentRSS();
#endif //INMOST_COMMON_INCLUDED
......@@ -275,8 +275,6 @@ namespace INMOST
else return false;
} //m <= n
std::vector<Var> rv1(m);
//array<Var> _rv1(m);
//shell<Var> rv1(_rv1);
std::swap(n,m); //this how original algorithm takes it
// Householder reduction to bidiagonal form
for (i = 0; i < n; i++)
......@@ -1234,7 +1232,6 @@ namespace INMOST
using AbstractMatrix<Var>::operator();
typedef unsigned enumerator; //< Integer type for indexes.
protected:
//array<Var> space; //< Array of row-wise stored elements.
storage_type space; //< Array of row-wise stored elements.
enumerator n; //< Number of rows.
enumerator m; //< Number of columns.
......@@ -3626,16 +3623,15 @@ namespace INMOST
int n = Rows();
int m = Cols();
INMOST_DATA_REAL_TYPE u, l;
array<INMOST_DATA_REAL_TYPE> Cmax(m,0.0);
array<INMOST_DATA_REAL_TYPE> U(m,std::numeric_limits<INMOST_DATA_REAL_TYPE>::max());
array<INMOST_DATA_REAL_TYPE> V(n,std::numeric_limits<INMOST_DATA_REAL_TYPE>::max());
std::vector<INMOST_DATA_REAL_TYPE> Cmax(m,0.0);
std::vector<INMOST_DATA_REAL_TYPE> U(m,std::numeric_limits<INMOST_DATA_REAL_TYPE>::max());
std::vector<INMOST_DATA_REAL_TYPE> V(n,std::numeric_limits<INMOST_DATA_REAL_TYPE>::max());
std::fill(Perm,Perm+m,ENUMUNDEF);
//array<INMOST_DATA_ENUM_TYPE> Perm(m,ENUMUNDEF);
array<INMOST_DATA_ENUM_TYPE> IPerm(std::max(n,m),ENUMUNDEF);
array<INMOST_DATA_ENUM_TYPE> ColumnList(m,ENUMUNDEF);
array<INMOST_DATA_ENUM_TYPE> ColumnPosition(n,ENUMUNDEF);
array<INMOST_DATA_ENUM_TYPE> Parent(n,ENUMUNDEF);
array<INMOST_DATA_REAL_TYPE> Dist(m,std::numeric_limits<INMOST_DATA_REAL_TYPE>::max());
std::vector<INMOST_DATA_ENUM_TYPE> IPerm(std::max(n,m),ENUMUNDEF);
std::vector<INMOST_DATA_ENUM_TYPE> ColumnList(m,ENUMUNDEF);
std::vector<INMOST_DATA_ENUM_TYPE> ColumnPosition(n,ENUMUNDEF);
std::vector<INMOST_DATA_ENUM_TYPE> Parent(n,ENUMUNDEF);
std::vector<INMOST_DATA_REAL_TYPE> Dist(m,std::numeric_limits<INMOST_DATA_REAL_TYPE>::max());
const AbstractMatrix<Var> & A = *this;
Matrix<INMOST_DATA_REAL_TYPE> C(n,m);
INMOST_DATA_ENUM_TYPE Li, Ui;
......@@ -3847,10 +3843,6 @@ namespace INMOST
typedef Matrix<INMOST_DATA_INTEGER_TYPE> iMatrix;
/// 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;
/// 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;
/// 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).
......@@ -3863,10 +3855,6 @@ namespace INMOST
typedef SymmetricMatrix<INMOST_DATA_INTEGER_TYPE> iSymmetricMatrix;
/// 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;
/// 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;
/// 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).
......@@ -3887,12 +3875,6 @@ namespace INMOST
typedef Matrix<variable> vMatrix;
//< 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;
/// shortcut for matrix of variables with first order derivatives in stack-preallocated and dynamically reallocated array.
//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;
/// 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).
......@@ -3911,12 +3893,6 @@ namespace INMOST
typedef SymmetricMatrix<variable,shell<variable> > vaSymmetricMatrix;
/// 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;
/// shortcut for symmetric matrix of variables with first order derivatives in stack-preallocated and dynamically reallocated array.
//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;
/// 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).
......
......@@ -177,8 +177,7 @@ namespace INMOST
return ret;
}
private:
//typedef dynarray<entry,16> Entries; //replace later with more memory-efficient chunk_array, with first chunk in stack
typedef array<entry> Entries; ///< Container type for
typedef std::vector<entry> Entries; ///< Container type for
public:
typedef Entries::iterator iterator; ///< Iterator over pairs of index and value.
typedef Entries::const_iterator const_iterator; ///< Iterator over constant pairs of index and value.
......@@ -349,8 +348,7 @@ namespace INMOST
return ret;
}
private:
typedef array<entry> Entries; //replace later with more memory-efficient chunk_array, with first chunk in stack
//typedef dynarray<entry,8> Entries;
typedef std::vector<entry> Entries; //replace later with more memory-efficient chunk_array, with first chunk in stack
public:
typedef Entries::iterator iterator;
typedef Entries::const_iterator const_iterator;
......
......@@ -111,7 +111,7 @@ namespace INMOST
}
}
ret += static_cast<enumerator>(result.size());
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0],result.size(),mrk);
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0],(enumerator)result.size(),mrk);
result.clear();
mesh->ReleasePrivateMarker(mrk);
}
......@@ -130,7 +130,7 @@ namespace INMOST
}
}
ret += static_cast<enumerator>(result.size());
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0],result.size(),mrk);
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0], (enumerator)result.size(),mrk);
result.clear();
mesh->ReleasePrivateMarker(mrk);
}
......@@ -153,7 +153,7 @@ namespace INMOST
}
}
ret += static_cast<enumerator>(result.size());
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0],result.size(),mrk);
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0], (enumerator)result.size(),mrk);
result.clear();
mesh->ReleasePrivateMarker(mrk);
}
......@@ -176,7 +176,7 @@ namespace INMOST
}
}
ret += static_cast<enumerator>(result.size());
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0],result.size(),mrk);
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0], (enumerator)result.size(),mrk);
result.clear();
mesh->ReleasePrivateMarker(mrk);
}
......@@ -220,7 +220,7 @@ namespace INMOST
}
}
ret += static_cast<enumerator>(result.size());
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0],result.size(),mrk);
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0], (enumerator)result.size(),mrk);
result.clear();
mesh->ReleasePrivateMarker(mrk);
}
......@@ -239,7 +239,7 @@ namespace INMOST
}
}
ret += static_cast<enumerator>(result.size());
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0],result.size(),mrk);
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0], (enumerator)result.size(),mrk);
result.clear();
mesh->ReleasePrivateMarker(mrk);
}
......@@ -262,7 +262,7 @@ namespace INMOST
}
}
ret += static_cast<enumerator>(result.size());
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0],result.size(),mrk);
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0], (enumerator)result.size(),mrk);
result.clear();
mesh->ReleasePrivateMarker(mrk);
}
......@@ -285,7 +285,7 @@ namespace INMOST
}
}
ret += static_cast<enumerator>(result.size());
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0],result.size(),mrk);
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0], (enumerator)result.size(),mrk);
result.clear();
mesh->ReleasePrivateMarker(mrk);
}
......@@ -349,7 +349,7 @@ namespace INMOST
}
}
ret += static_cast<enumerator>(result.size());
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0],result.size(),mrk);
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0], (enumerator)result.size(),mrk);
result.clear();
mesh->ReleasePrivateMarker(mrk);
}
......@@ -368,7 +368,7 @@ namespace INMOST
}
}
ret += static_cast<enumerator>(result.size());
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0],result.size(),mrk);
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0], (enumerator)result.size(),mrk);
result.clear();
mesh->ReleasePrivateMarker(mrk);
}
......@@ -393,7 +393,7 @@ namespace INMOST
}
}
ret += static_cast<enumerator>(result.size());
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0],result.size(),mrk);
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0], (enumerator)result.size(),mrk);
result.clear();
mesh->ReleasePrivateMarker(mrk);
}
......@@ -418,7 +418,7 @@ namespace INMOST
}
}
ret += static_cast<enumerator>(result.size());
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0],result.size(),mrk);
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0], (enumerator)result.size(),mrk);
result.clear();
mesh->ReleasePrivateMarker(mrk);
}
......@@ -460,7 +460,7 @@ namespace INMOST
}
}
ret += static_cast<enumerator>(result.size());
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0],result.size(),mrk);
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0], (enumerator)result.size(),mrk);
result.clear();
mesh->ReleasePrivateMarker(mrk);
}
......@@ -479,7 +479,7 @@ namespace INMOST
}
}
ret += static_cast<enumerator>(result.size());
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0],result.size(),mrk);
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0], (enumerator)result.size(),mrk);
result.clear();
mesh->ReleasePrivateMarker(mrk);
}
......@@ -504,7 +504,7 @@ namespace INMOST
}
}
ret += static_cast<enumerator>(result.size());
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0],result.size(),mrk);
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0], (enumerator)result.size(),mrk);
result.clear();
mesh->ReleasePrivateMarker(mrk);
}
......@@ -529,7 +529,7 @@ namespace INMOST
}
}
ret += static_cast<enumerator>(result.size());
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0],result.size(),mrk);
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0], (enumerator)result.size(),mrk);
result.clear();
mesh->ReleasePrivateMarker(mrk);
}
......@@ -573,7 +573,7 @@ namespace INMOST
}
}
ret += static_cast<enumerator>(result.size());
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0],result.size(),mrk);
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0], (enumerator)result.size(),mrk);
result.clear();
mesh->ReleasePrivateMarker(mrk);
}
......@@ -592,7 +592,7 @@ namespace INMOST
}
}
ret += static_cast<enumerator>(result.size());
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0],result.size(),mrk);
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0], (enumerator)result.size(),mrk);
result.clear();
mesh->ReleasePrivateMarker(mrk);
}
......@@ -617,7 +617,7 @@ namespace INMOST
}
}
ret += static_cast<enumerator>(result.size());
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0],result.size(),mrk);
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0], (enumerator)result.size(),mrk);
result.clear();
mesh->ReleasePrivateMarker(mrk);
}
......@@ -642,7 +642,7 @@ namespace INMOST
}
}
ret += static_cast<enumerator>(result.size());
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0],result.size(),mrk);
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0], (enumerator)result.size(),mrk);
result.clear();
mesh->ReleasePrivateMarker(mrk);
}
......@@ -684,7 +684,7 @@ namespace INMOST
}
}
ret += static_cast<enumerator>(result.size());
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0],result.size(),mrk);
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0], (enumerator)result.size(),mrk);
result.clear();
mesh->ReleasePrivateMarker(mrk);
}
......@@ -703,7 +703,7 @@ namespace INMOST
}
}
ret += static_cast<enumerator>(result.size());
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0],result.size(),mrk);
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0], (enumerator)result.size(),mrk);
result.clear();
mesh->ReleasePrivateMarker(mrk);
}
......@@ -728,7 +728,7 @@ namespace INMOST
}
}
ret += static_cast<enumerator>(result.size());
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0],result.size(),mrk);
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0], (enumerator)result.size(),mrk);
result.clear();
mesh->ReleasePrivateMarker(mrk);
}
......@@ -753,7 +753,7 @@ namespace INMOST
}
}
ret += static_cast<enumerator>(result.size());
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0],result.size(),mrk);
if( !result.empty() ) mesh->RemPrivateMarkerArray(&result[0], (enumerator)result.size(),mrk);
result.clear();
mesh->ReleasePrivateMarker(mrk);
}
......
......@@ -155,7 +155,7 @@ namespace INMOST
}
}
}
if( !nodes.empty() ) m->RemPrivateMarkerArray(&nodes[0],nodes.size(),mrk);
if( !nodes.empty() ) m->RemPrivateMarkerArray(&nodes[0],(Storage::enumerator)nodes.size(),mrk);
m->ReleasePrivateMarker(mrk);
bbox[0] = bbox[2] = bbox[4] = 1.0e20f;
bbox[1] = bbox[3] = bbox[5] = -1.0e20f;
......
......@@ -5,6 +5,7 @@ set(SOURCE
${CMAKE_CURRENT_SOURCE_DIR}/utils.cpp
${CMAKE_CURRENT_SOURCE_DIR}/base64.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pool.cpp
${CMAKE_CURRENT_SOURCE_DIR}/mem.cpp
PARENT_SCOPE
)
......
/*
* Author: David Robert Nadeau
* Site: http://NadeauSoftware.com/
* License: Creative Commons Attribution 3.0 Unported License
* http://creativecommons.org/licenses/by/3.0/deed.en_US
*/
#if defined(_WIN32)
#include <windows.h>
#include <psapi.h>
#elif defined(__unix__) || defined(__unix) || defined(unix) || (defined(__APPLE__) && defined(__MACH__))
#include <unistd.h>
#include <sys/resource.h>
#if defined(__APPLE__) && defined(__MACH__)
#include <mach/mach.h>
#elif (defined(_AIX) || defined(__TOS__AIX__)) || (defined(__sun__) || defined(__sun) || defined(sun) && (defined(__SVR4) || defined(__svr4__)))
#include <fcntl.h>
#include <procfs.h>
#elif defined(__linux__) || defined(__linux) || defined(linux) || defined(__gnu_linux__)
#include <stdio.h>
#endif
#else
#error "Cannot define getPeakRSS( ) or getCurrentRSS( ) for an unknown OS."
#endif
#include "utils.h"
/**
* Returns the peak (maximum so far) resident set size (physical
* memory use) measured in bytes, or zero if the value cannot be
* determined on this OS.
*/
size_t getPeakRSS()
{
#if defined(_WIN32)
/* Windows -------------------------------------------------- */
PROCESS_MEMORY_COUNTERS info;
GetProcessMemoryInfo(GetCurrentProcess(), &info, sizeof(info));
return (size_t)info.PeakWorkingSetSize;
#elif (defined(_AIX) || defined(__TOS__AIX__)) || (defined(__sun__) || defined(__sun) || defined(sun) && (defined(__SVR4) || defined(__svr4__)))
/* AIX and Solaris ------------------------------------------ */
struct psinfo psinfo;
int fd = -1;
if ((fd = open("/proc/self/psinfo", O_RDONLY)) == -1)
return (size_t)0L; /* Can't open? */
if (read(fd, &psinfo, sizeof(psinfo)) != sizeof(psinfo))
{
close(fd);
return (size_t)0L; /* Can't read? */
}
close(fd);
return (size_t)(psinfo.pr_rssize * 1024L);
#elif defined(__unix__) || defined(__unix) || defined(unix) || (defined(__APPLE__) && defined(__MACH__))
/* BSD, Linux, and OSX -------------------------------------- */
struct rusage rusage;
getrusage(RUSAGE_SELF, &rusage);
#if defined(__APPLE__) && defined(__MACH__)
return (size_t)rusage.ru_maxrss;
#else
return (size_t)(rusage.ru_maxrss * 1024L);
#endif
#else
/* Unknown OS ----------------------------------------------- */
return (size_t)0L; /* Unsupported. */
#endif
}
/**
* Returns the current resident set size (physical memory use) measured
* in bytes, or zero if the value cannot be determined on this OS.
*/
size_t getCurrentRSS()
{
#if defined(_WIN32)
/* Windows -------------------------------------------------- */
PROCESS_MEMORY_COUNTERS info;
GetProcessMemoryInfo(GetCurrentProcess(), &info, sizeof(info));
return (size_t)info.WorkingSetSize;
#elif defined(__APPLE__) && defined(__MACH__)
/* OSX ------------------------------------------------------ */
struct mach_task_basic_info info;
mach_msg_type_number_t infoCount = MACH_TASK_BASIC_INFO_COUNT;
if (task_info(mach_task_self(), MACH_TASK_BASIC_INFO,
(task_info_t)&info, &infoCount) != KERN_SUCCESS)
return (size_t)0L; /* Can't access? */
return (size_t)info.resident_size;
#elif defined(__linux__) || defined(__linux) || defined(linux) || defined(__gnu_linux__)
/* Linux ---------------------------------------------------- */
long rss = 0L;
FILE* fp = NULL;
if ((fp = fopen("/proc/self/statm", "r")) == NULL)
return (size_t)0L; /* Can't open? */
if (fscanf(fp, "%*s%ld", &rss) != 1)
{
fclose(fp);
return (size_t)0L; /* Can't read? */
}
fclose(fp);
return (size_t)rss * (size_t)sysconf(_SC_PAGESIZE);
#else
/* AIX, BSD, Solaris, and Unknown OS ------------------------ */
return (size_t)0L; /* Unsupported. */
#endif
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -6,34 +6,6 @@
#include "inmost_solver.h"
#include "../solver_prototypes.hpp"
/*
class Range
{
INMOST_DATA_ENUM_TYPE first, last;
public:
Range(const Range & b):first(b.first), last(b.last) {}
Range(INMOST_DATA_ENUM_TYPE first, INMOST_DATA_ENUM_TYPE last) : first(first), last(last) {}
Range & operator =(Range const & b) {first = b.first; last = b.last; return *this;}
~Range() {}
INMOST_DATA_ENUM_TYPE Size() { return last - first; }
INMOST_DATA_ENUM_TYPE First() {return first;}
INMOST_DATA_ENUM_TYPE Last() {return last;}
};
class CSR_Row
{
Range & range;
std::vector<Sparse::Row::entry> & entries;
public:
}
class CSR_Matrix
{
interval<INMOST_DATA_ENUM_TYPE, Range> Address;
std::vector<Sparse::Row::entry> Entries;
public:
};
*/
class MLMTILUC_preconditioner : public Method
{
......@@ -77,9 +49,9 @@ class MLMTILUC_preconditioner : public Method
INMOST_DATA_ENUM_TYPE Size() const { return last - first; }
} Interval;
typedef std::vector<INMOST_DATA_ENUM_TYPE> levels_t;
std::vector<Sparse::Row::entry> L_Entries, U_Entries, B_Entries;
std::vector<Sparse::Row::entry> L_Entries, U_Entries;
interval<INMOST_DATA_ENUM_TYPE, INMOST_DATA_REAL_TYPE> LU_Diag;
interval<INMOST_DATA_ENUM_TYPE, Interval> U_Address, L_Address, B_Address;
interval<INMOST_DATA_ENUM_TYPE, Interval> U_Address, L_Address;
std::vector<interval<INMOST_DATA_ENUM_TYPE, Interval> *> F_Address, E_Address;
std::vector<Sparse::Row::entry> E_Entries, F_Entries;
levels_t level_size; //remember size of each level
......@@ -268,7 +240,6 @@ public:
bool isFinalized();
bool Initialize();
bool Finalize();
void ApplyB(double alpha, Sparse::Vector & x, double beta, Sparse::Vector & y);
int Descend(INMOST_DATA_ENUM_TYPE level, Sparse::Vector & inout);
int Ascend(INMOST_DATA_ENUM_TYPE level, Sparse::Vector & inout);
bool Solve(Sparse::Vector & input, Sparse::Vector & output);
......
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