L
LeonLeon
Hi Experts,
I am a newbie in C++ and have a entry-level question about the array
duplication.
There is a array dphi[][], from which a new array dphi_fwd[][] would
be copies,
I tried without success to do it with pointer, this is my first poster
I know there
are many talents here, so anybody could help me out? Thanks in
advance.
Bests,
Liang
*************The part code ********************
AutoPtr<FEBase> fe (FEBase::build(dim, fe_type));
const std::vector<std::vector<RealGradient> >& dphi = fe->get_dphi();
// dphi is a 2d array going like dphi[j](2);
// push forward dphi[][]
std::vector<std::vector<RealGradient> > *dphi_fwd = &dphi; // error
// dphi_fwd array has the same structure as dphi, but occupies
different memory and
can be updated later.
// how to define the dphi_fwd?
I am a newbie in C++ and have a entry-level question about the array
duplication.
There is a array dphi[][], from which a new array dphi_fwd[][] would
be copies,
I tried without success to do it with pointer, this is my first poster
I know there
are many talents here, so anybody could help me out? Thanks in
advance.
Bests,
Liang
*************The part code ********************
AutoPtr<FEBase> fe (FEBase::build(dim, fe_type));
const std::vector<std::vector<RealGradient> >& dphi = fe->get_dphi();
// dphi is a 2d array going like dphi[j](2);
// push forward dphi[][]
std::vector<std::vector<RealGradient> > *dphi_fwd = &dphi; // error
// dphi_fwd array has the same structure as dphi, but occupies
different memory and
can be updated later.
// how to define the dphi_fwd?