genmodel 0.0.22 → 0.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/Genmodel/GenModel.h +4 -0
- data/ext/Genmodel/GenModelBase.cpp +18 -1
- data/ext/Genmodel/Genmodel.cpp +21271 -1316
- data/ext/Genmodel/extconf.rb +3 -3
- data/lib/Genmodel.rb +1 -1
- metadata +2 -4
- data/ext/Genmodel/InterfaceObject.cpp +0 -70
- data/ext/Genmodel/InterfaceObject.h +0 -28
data/ext/Genmodel/extconf.rb
CHANGED
@@ -2,7 +2,7 @@ require 'mkmf'
|
|
2
2
|
require 'rbconfig'
|
3
3
|
require 'find'
|
4
4
|
|
5
|
-
extension_name = '
|
5
|
+
extension_name = 'Genmodel/Genmodel'
|
6
6
|
dir_config(extension_name)
|
7
7
|
|
8
8
|
#abort "missing malloc()" unless have_func "malloc"
|
@@ -129,7 +129,7 @@ if is_darwin
|
|
129
129
|
|
130
130
|
path = "/usr/lib:/usr/local/lib/"
|
131
131
|
puts "Looking for OsiClp (function main) in "+path
|
132
|
-
if(is_osi && find_library("
|
132
|
+
if(is_osi && find_library("OsiClp",nil,path))
|
133
133
|
puts "found"
|
134
134
|
else
|
135
135
|
puts "not found"
|
@@ -213,7 +213,7 @@ elsif is_linux
|
|
213
213
|
|
214
214
|
path = "/usr/lib:/usr/local/lib/"
|
215
215
|
puts "Looking for OsiClp (function main) in "+path
|
216
|
-
if(is_osi && find_library("
|
216
|
+
if(is_osi && find_library("OsiClp",nil,path))
|
217
217
|
puts "found"
|
218
218
|
else
|
219
219
|
puts "not found"
|
data/lib/Genmodel.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: genmodel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mathieu Bouchard
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A generic tool to solve optimization model with different solvers
|
14
14
|
email: mathbouchard@gmail.com
|
@@ -26,8 +26,6 @@ files:
|
|
26
26
|
- ext/Genmodel/GenModelOsiInterface.cpp
|
27
27
|
- ext/Genmodel/GenModelOsiInterface.h
|
28
28
|
- ext/Genmodel/Genmodel.cpp
|
29
|
-
- ext/Genmodel/InterfaceObject.cpp
|
30
|
-
- ext/Genmodel/InterfaceObject.h
|
31
29
|
- ext/Genmodel/ProblemReaderOsi.cpp
|
32
30
|
- ext/Genmodel/ProblemReaderOsi.h
|
33
31
|
- ext/Genmodel/extconf.rb
|
@@ -1,70 +0,0 @@
|
|
1
|
-
//
|
2
|
-
// InterfaceObject.cpp
|
3
|
-
//
|
4
|
-
//
|
5
|
-
// Created by Mathieu Bouchard on 2014-03-19.
|
6
|
-
//
|
7
|
-
//
|
8
|
-
|
9
|
-
#include <stdio.h>
|
10
|
-
//#include <stdlib.h>
|
11
|
-
#include "InterfaceObject.h"
|
12
|
-
|
13
|
-
template<class T> InterfaceVector<T>::InterfaceVector()
|
14
|
-
{
|
15
|
-
val = NULL;
|
16
|
-
size = 0;
|
17
|
-
//printf("\tC++: Adress at creation is %p size = %d\n", val, size);
|
18
|
-
}
|
19
|
-
|
20
|
-
template<class T> InterfaceVector<T>::InterfaceVector(int _size)
|
21
|
-
{
|
22
|
-
size = _size;
|
23
|
-
val = new T[size];
|
24
|
-
//printf("\tC++: Adress at creation is %p size = %d\n", val, size);
|
25
|
-
//memset(val, 0, sizeof(T));
|
26
|
-
}
|
27
|
-
|
28
|
-
template<class T> InterfaceVector<T>::~InterfaceVector()
|
29
|
-
{
|
30
|
-
Delete();
|
31
|
-
}
|
32
|
-
|
33
|
-
template<class T> void InterfaceVector<T>::SetSize(int _size)
|
34
|
-
{
|
35
|
-
Delete();
|
36
|
-
size = _size;
|
37
|
-
val = new T[size];
|
38
|
-
}
|
39
|
-
template<class T> void InterfaceVector<T>::Delete()
|
40
|
-
{
|
41
|
-
size = 0;
|
42
|
-
if(val != NULL)
|
43
|
-
delete[] val;
|
44
|
-
}
|
45
|
-
|
46
|
-
template<class T> void InterfaceVector<T>::Set(int index, T inval)
|
47
|
-
{
|
48
|
-
if(index < 0 || index >= size)
|
49
|
-
printf("Index out of bound (%d not in 0..%d)\n", index, size);
|
50
|
-
else
|
51
|
-
val[index] = inval;
|
52
|
-
}
|
53
|
-
|
54
|
-
template<class T> T InterfaceVector<T>::Get(int index)
|
55
|
-
{
|
56
|
-
if(index < 0 || index >= size)
|
57
|
-
printf("Index out of bound (%d not in 0..%d)\n", index, size);
|
58
|
-
else
|
59
|
-
return val[index];
|
60
|
-
return 0.0;
|
61
|
-
}
|
62
|
-
|
63
|
-
template<class T> T* InterfaceVector<T>::Ptr()
|
64
|
-
{
|
65
|
-
return val;
|
66
|
-
}
|
67
|
-
|
68
|
-
template class InterfaceVector<int>;
|
69
|
-
template class InterfaceVector<long>;
|
70
|
-
template class InterfaceVector<double>;
|
@@ -1,28 +0,0 @@
|
|
1
|
-
//
|
2
|
-
// InterfaceObject.h
|
3
|
-
//
|
4
|
-
//
|
5
|
-
// Created by Mathieu Bouchard on 2014-03-19.
|
6
|
-
//
|
7
|
-
//
|
8
|
-
|
9
|
-
#ifndef _InterfaceObject_h
|
10
|
-
#define _InterfaceObject_h
|
11
|
-
|
12
|
-
template<class T> class InterfaceVector {
|
13
|
-
public:
|
14
|
-
InterfaceVector();
|
15
|
-
InterfaceVector(int size);
|
16
|
-
~InterfaceVector();
|
17
|
-
void SetSize(int size);
|
18
|
-
void Delete();
|
19
|
-
void Set(int index, T val);
|
20
|
-
T Get(int index);
|
21
|
-
T* Ptr();
|
22
|
-
|
23
|
-
private:
|
24
|
-
int size;
|
25
|
-
T * val;
|
26
|
-
};
|
27
|
-
|
28
|
-
#endif
|