Skip to content

Commit

Permalink
[Janitor mode] Set auto-props
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@21339 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
OpenModelica-Hudson committed Jun 30, 2014
1 parent 7f0b6a3 commit 0910073
Showing 1 changed file with 56 additions and 56 deletions.
112 changes: 56 additions & 56 deletions SimulationRuntime/cpp/Include/Core/Math/SparseMatrix.h
@@ -1,56 +1,56 @@
#pragma once

//#include <map>
//#include <vector>
#include "Modelica.h"
//#include <stdexcept>

#ifdef USE_UMFPACK
#include "umfpack.h"

using std::map;
using std::pair;
using std::make_pair;

struct sparse_inserter {
struct t2 {
int i;
int j;
map< pair<int,int>, double> & content;
t2(int i, int j, map< pair<int,int>, double> & c): i(i), j(j), content(c) {}
void operator=(double t) {
content[make_pair(j,i)]=t;
}
};

struct t1 {
int i;
map< pair<int,int>, double> & content;
t1(int i,map< pair<int,int>, double> & c): i(i), content(c) {}
t2 operator[](size_t j) {
t2 res(i,j,content);
return res;
}
};


map< pair<int,int>, double> content;
t1 operator[](size_t i) {
t1 res(i,content);
return res;
}

};

struct sparse_matrix {
std::vector<int> Ap;
std::vector<int> Ai;
std::vector<double> Ax;
int n;
sparse_matrix(int n=-1): n(n) {}

void build(sparse_inserter& ins);
int solve(const double* b,double* x);
};

#endif
#pragma once

//#include <map>
//#include <vector>
#include "Modelica.h"
//#include <stdexcept>

#ifdef USE_UMFPACK
#include "umfpack.h"

using std::map;
using std::pair;
using std::make_pair;

struct sparse_inserter {
struct t2 {
int i;
int j;
map< pair<int,int>, double> & content;
t2(int i, int j, map< pair<int,int>, double> & c): i(i), j(j), content(c) {}
void operator=(double t) {
content[make_pair(j,i)]=t;
}
};

struct t1 {
int i;
map< pair<int,int>, double> & content;
t1(int i,map< pair<int,int>, double> & c): i(i), content(c) {}
t2 operator[](size_t j) {
t2 res(i,j,content);
return res;
}
};


map< pair<int,int>, double> content;
t1 operator[](size_t i) {
t1 res(i,content);
return res;
}

};

struct sparse_matrix {
std::vector<int> Ap;
std::vector<int> Ai;
std::vector<double> Ax;
int n;
sparse_matrix(int n=-1): n(n) {}

void build(sparse_inserter& ins);
int solve(const double* b,double* x);
};

#endif

0 comments on commit 0910073

Please sign in to comment.