Changeset 394 for trunk/ADOL-C/include


Ignore:
Timestamp:
Jan 28, 2013 10:19:40 AM (7 years ago)
Author:
kulshres
Message:

DLL-Exporting fixes

std::vector cannot be dll-exported, so we cannot export our advector
as a class. Instead we export all the members other than std::vector

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ADOL-C/include/adolc/advector.h

    r354 r394  
    9898};
    9999
    100 class ADOLC_DLL_EXPORT advector {
     100class advector {
    101101private:
    102     struct blocker {
     102    struct ADOLC_DLL_EXPORT blocker {
    103103        adouble *dflt;
    104104        blocker() {}
     
    107107    } blk;
    108108    std::vector<adouble> data;
    109     bool nondecreasing() const;
     109    ADOLC_DLL_EXPORT bool nondecreasing() const;
    110110public:
    111     advector() : blk(), data() {}
    112     explicit advector(size_t n) : blk(n), data(n, *blk.dflt) { delete blk.dflt; }
    113     ~advector() {}
    114     advector(const advector& x) : blk(x.data.size()), data(x.data) { delete blk.dflt; }
    115     advector(const vector<adouble>& v) : blk(v.size()), data(v) { delete blk.dflt; }
    116     size_t size() const { return data.size(); }
    117     operator const vector<adouble>&() const { return data; }
    118     operator vector<adouble>&() { return data; }
    119     adub operator[](const badouble& index) const;
    120     adubref operator[](const badouble& index);
    121     adouble& operator[](size_t i) { return data[i]; }
    122     const adouble& operator[](size_t i) const { return data[i]; }
    123     adouble lookupindex(const badouble& x, const badouble& y) const;
     111    ADOLC_DLL_EXPORT advector() : blk(), data() {}
     112    ADOLC_DLL_EXPORT explicit advector(size_t n) : blk(n), data(n, *blk.dflt) { delete blk.dflt; }
     113    ADOLC_DLL_EXPORT ~advector() {}
     114    ADOLC_DLL_EXPORT advector(const advector& x) : blk(x.data.size()), data(x.data) { delete blk.dflt; }
     115    ADOLC_DLL_EXPORT advector(const vector<adouble>& v) : blk(v.size()), data(v) { delete blk.dflt; }
     116    ADOLC_DLL_EXPORT size_t size() const { return data.size(); }
     117    ADOLC_DLL_EXPORT operator const vector<adouble>&() const { return data; }
     118    ADOLC_DLL_EXPORT operator vector<adouble>&() { return data; }
     119    ADOLC_DLL_EXPORT adub operator[](const badouble& index) const;
     120    ADOLC_DLL_EXPORT adubref operator[](const badouble& index);
     121    ADOLC_DLL_EXPORT adouble& operator[](size_t i) { return data[i]; }
     122    ADOLC_DLL_EXPORT const adouble& operator[](size_t i) const { return data[i]; }
     123    ADOLC_DLL_EXPORT adouble lookupindex(const badouble& x, const badouble& y) const;
    124124};
    125125
Note: See TracChangeset for help on using the changeset viewer.