/[ascend]/trunk/ascxx/set.cpp
ViewVC logotype

Contents of /trunk/ascxx/set.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2327 - (show annotations) (download) (as text)
Wed Dec 22 07:17:24 2010 UTC (13 years, 8 months ago) by jpye
File MIME type: text/x-c++src
File size: 791 byte(s)
Merging in refactor of the C++ code, which is moved out of 'pygtk' and into 'ascxx'.
Adding support for IPOPT 3.9.1, the current latest version.
Support in dtar for parallel builds (possibly needs some testing still).
1 #include <iostream>
2 #include <stdexcept>
3 using namespace std;
4
5 #include "set.h"
6
7 template<>
8 const bool
9 ASCXX_Set<long>::isCorrectType() const{
10 return (SetKind(s)==integer_set);
11 }
12
13 template<>
14 const bool
15 ASCXX_Set<SymChar>::isCorrectType() const{
16 return (SetKind(s)==string_set);
17 }
18
19
20 template<>
21 const bool
22 ASCXX_Set<Empty>::isCorrectType() const{
23 return (SetKind(s)==string_set);
24 }
25
26
27 template<>
28 const long
29 ASCXX_Set<long>::operator[](const unsigned long &i) const{
30 return FetchIntMember(s,i);
31 }
32
33 template<>
34 const SymChar
35 ASCXX_Set<SymChar>::operator[](const unsigned long &i) const{
36 return SymChar(SCP(FetchStrMember(s,i)));
37 }
38
39 template<>
40 const Empty
41 ASCXX_Set<Empty>::operator[](const unsigned long &i) const{
42 throw runtime_error("Invalid attempt to retreive item from empty set");
43 }
44
45

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22