Hi Evgueni,
On Thu, Feb 4, 2010 at 5:25 PM, Evgueni Kolossov <[email protected]> wrote:
>
>
> I have a vector RDKit::MOL_SPTR_VECT m_vF.
> Vector is populated Ok.
> Now i am trying to get mols from this vector:
> nCount = 0;
> RDKit::ROMol *fMol = new RDKit::ROMol(*m_vF[nCount]);
>
> This will compile OK but will throw an exception on execution in
> T * operator-> () const
> {
> BOOST_ASSERT(px != 0);
> return px;
> }
> which called from ROMol::initFromOther()
>
> Can you please suggest what is wrong with vector elements access by this
> way?
There's nothing in principle wrong with it. Here's a little sample I
just did that works without problems:
{
RWMol *m=new RWMol();
m->addAtom(new Atom(6));
m->addAtom(new Atom(6));
m->addBond(0,1,Bond::SINGLE);
ROMOL_SPTR msp((ROMol *)m);
RDKit::MOL_SPTR_VECT m_vF;
m_vF.push_back(msp);
ROMol *nm = new ROMol(*m_vF[0]);
}
are you 100% certain that the molecules in your vector are ok? You
could test like this:
nCount = 0;
RDKit::ROMol *tMol = m_vF[nCount].get();
tMol->debugMol(std::cerr);
-greg
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss